/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ── Floating nav bar ── */
.nav {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}

.nav__bar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 56px;
}

.nav__brand {
  position: relative;
  font-weight: 700;
  font-size: 18px;
  color: #111;
  text-decoration: none;
  margin-right: 32px;
  letter-spacing: -0.5px;
}

.nav__brand[data-deploy]::after {
  content: attr(data-deploy);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #1a1a1a;
  color: #f5f5f5;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav__brand[data-deploy]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.nav__menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav__menu a {
  display: block;
  padding: 6px 14px;
  border-radius: 8px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.nav__menu a:hover {
  background: #f0f0f0;
}

.nav__menu a.active {
  background: #f0f0f0;
  font-weight: 600;
  color: #111;
}

/* Dropdown nav item */
.nav__dropdown {
  position: static;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav__dropdown-trigger {
  display: block;
  padding: 6px 14px;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.15s;
  user-select: none;
}

.nav__dropdown-trigger:hover,
.nav__dropdown--open .nav__dropdown-trigger {
  background: #f0f0f0;
}

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #eee;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  padding: 8px 20px 12px;
  list-style: none;
  margin: 0;
  z-index: 200;
}

.nav__dropdown--open .nav__dropdown-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav__dropdown-menu li a {
  display: block;
  padding: 8px 14px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
  background: none;
}

.nav__dropdown-menu li a:hover {
  background: #f0f0f0;
}

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  margin-right: 12px;
}

.nav__burger span {
  display: block;
  height: 2px;
  background: #333;
  border-radius: 2px;
  width: 100%;
}

/* User info tooltip on logout */
.nav__user-info {
  margin-left: auto;
  position: relative;
}

.nav__user-info a {
  margin-left: 0 !important;
}

.nav__user-info::after {
  content: attr(data-user);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1a1a1a;
  color: #f5f5f5;
  font-size: 12px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav__user-info:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Push page content below the fixed nav */
.main-content {
  padding-top: 80px;
}

/* Collapsible JSON tree */
.struct-dump-container { list-style: none; margin: 0; padding: 0 0 0 16px; font-family: monospace; font-size: 12px; line-height: 1.6; }
.struct-dump-container-root { padding-left: 0; }
.struct-dump-key strong { color: #333; }
.struct-dump-value { color: #555; word-break: break-all; }
.struct-dump-container li { margin: 1px 0; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }

/* Mobile */
@media (max-width: 640px) {
  .nav__burger {
    display: flex;
  }

  .nav__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    padding: 8px;
    gap: 2px;
  }

  .nav__menu--open {
    display: flex;
  }

  .nav__menu a {
    padding: 10px 14px;
  }
}

/* JSON viewer toggle */
[data-controller="json-viewer"] { position: relative; }
.json-viewer-toggle {
  position: absolute; top: 0; right: 0;
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; cursor: pointer;
  color: #6b7280; font-family: monospace; line-height: 1.6;
}
.json-viewer-toggle:hover { background: #e5e7eb; color: #111; }
