/* === App Theme — Vestige overrides for Bootstrap (authenticated pages) === */
/* Uses CSS custom properties defined in landing.css :root */

/* Typography */
body {
  font-family: var(--font-body);
  color: var(--body-text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  font-weight: 400;
  background: var(--warm-white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy);
  font-weight: 500;
}

/* === Authenticated Nav === */
.app-nav {
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  transition: box-shadow 0.3s;
}

.app-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.app-nav > .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand area */
.app-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.app-brand:hover {
  text-decoration: none;
}

.app-brand .brand-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-brand .brand-icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--amber-muted);
  opacity: 0.5;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.app-brand-name {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--navy);
  letter-spacing: 6px;
  text-transform: uppercase;
}

.app-brand-estate {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
}

.app-brand-tagline {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--amber-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Nav links */
.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 1;
  min-width: 0;
}

.app-nav-link {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  color: var(--body-text);
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.app-nav-link:hover {
  background: var(--ice);
  color: var(--navy);
}

.app-nav-link i {
  font-size: 1rem;
}

/* Admin dropdown in app nav */
.app-nav .nav-dropdown {
  position: relative;
  display: inline-flex;
}

.app-nav .nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 0.35rem 0;
}

/* Mobile hamburger */
#mobileMenuToggle {
  background: none;
  border: none;
  padding: 0.5rem;
  min-height: 48px;
  min-width: 48px;
  color: var(--body-text);
  cursor: pointer;
}

#mobileMenuToggle:hover {
  background: var(--ice);
  border-radius: var(--radius-pill);
}

/* Mobile menu */
.app-mobile-menu {
  background: var(--white);
  border-top: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}

.app-mobile-menu .app-nav-link {
  padding: 0.75rem 0.5rem;
  display: flex;
  align-items: center;
  min-height: 48px;
  width: 100%;
}

.app-mobile-menu hr {
  border-color: var(--border-soft);
  margin: 0.5rem 0;
}

/* === Bootstrap Component Overrides === */

/* Cards */
.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.category-card:hover,
.item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-header {
  background: var(--ice);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-heading);
  font-weight: 400;
}

/* Buttons — navy primary */
.btn-primary {
  background: var(--navy);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 42, 58, 0.3);
  color: var(--white);
}

/* Success — amber for selection hearts */
.btn-success {
  background: var(--amber-muted);
  border-color: var(--amber-muted);
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.btn-success:hover,
.btn-success:active {
  background: var(--navy);
  border-color: var(--navy);
}

/* Outline variants */
.btn-outline-primary {
  color: var(--navy);
  border-color: var(--navy);
  border-radius: var(--radius-pill);
  font-weight: 400;
}

.btn-outline-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.btn-outline-secondary {
  color: var(--body-text);
  border-color: var(--border-soft);
  border-radius: var(--radius-pill);
  font-weight: 400;
}

.btn-outline-secondary:hover {
  background: var(--ice);
  border-color: var(--navy);
  color: var(--navy);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-pill);
  font-weight: 400;
}

.btn-secondary:hover {
  background: var(--ice);
  border-color: var(--navy);
  color: var(--navy);
}

.btn-outline-danger {
  border-radius: var(--radius-pill);
  font-weight: 400;
}

.btn-outline-light {
  border-radius: var(--radius-pill);
}

.btn-warning {
  border-radius: var(--radius-pill);
  font-weight: 400;
}

.btn-danger {
  border-radius: var(--radius-pill);
  font-weight: 400;
}

/* Badges — softer, pill-shaped */
.badge {
  border-radius: var(--radius-pill);
  font-weight: 400;
  font-family: var(--font-heading);
}

.badge.bg-success {
  background: var(--amber-muted) !important;
}

.badge.bg-secondary {
  background: var(--muted) !important;
}

.badge.bg-primary {
  background: var(--navy) !important;
}

.badge.bg-warning {
  background: var(--cream) !important;
  color: var(--navy) !important;
}

.border-success {
  border-color: var(--amber-muted) !important;
}

/* Tables */
.table {
  font-family: var(--font-body);
}

.table-dark,
.thead-dark th {
  background-color: var(--navy) !important;
}

.table-success {
  background-color: var(--cream) !important;
}

/* Alerts */
.alert {
  border-radius: var(--radius);
  font-family: var(--font-body);
}

/* Forms */
.form-control,
.form-select {
  border-radius: 0.75rem;
  border-color: var(--border-soft);
  font-family: var(--font-body);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 42, 58, 0.12);
}

.form-label {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--navy);
}

/* Breadcrumbs */
.breadcrumb-item a {
  color: var(--amber-muted);
  font-weight: 400;
}

.breadcrumb-item a:hover {
  color: var(--navy);
}

/* Drop zones */
.batch-drop-zone:hover,
.batch-drop-zone.dragover,
.video-drop-zone:hover,
.video-drop-zone.dragover {
  border-color: var(--navy);
  background-color: var(--ice);
}

/* Progress bar */
.progress-bar {
  background: var(--navy);
}

/* Card image areas */
.card-img-top-wrap {
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-img-placeholder {
  color: var(--muted);
  background: var(--cream);
}

.card-img-placeholder.large {
  background: var(--cream);
  border-radius: var(--radius);
}

/* Family stories */
.family-story {
  background: var(--cream) !important;
  border-left: 3px solid var(--amber-muted) !important;
  border-radius: var(--radius) !important;
}

/* Saved toast */
.saved-toast {
  background: var(--amber-muted);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 400;
}

/* Text-size toggle */
.text-size-toggle {
  border: 2px solid var(--border-soft);
  color: var(--body-text);
  background: var(--white);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 500;
}

.text-size-toggle:hover,
.text-size-toggle:focus-visible {
  background: var(--ice);
  border-color: var(--navy);
}

/* === Footer === */
.app-footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  background: var(--ice);
  font-family: var(--font-body);
}

.app-footer p {
  color: var(--body-text);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.app-footer a {
  color: var(--navy);
  font-weight: 400;
  text-decoration: none;
  margin: 0 0.6rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: var(--amber-muted);
}

/* Dropdown items — larger touch targets */
.dropdown-menu {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
}

.dropdown-item {
  font-weight: 400;
  color: var(--body-text);
}

.dropdown-item:hover {
  background: var(--ice);
  color: var(--navy);
}

/* Responsive */

/* Desktop nav — always use icons only to fit all tabs */
@media (min-width: 992px) {
  .app-nav-link .nav-label {
    display: none;
  }

  .app-nav-link {
    padding: 8px;
  }

  .app-nav-link i {
    margin-right: 0 !important;
    font-size: 1.1rem;
  }

  /* Keep Home label visible */
  .app-nav-link[href="/home"] .nav-label {
    display: inline;
  }

  .app-nav-link[href="/home"] i.me-1 {
    margin-right: 0.25rem !important;
  }

  /* Keep Admin label visible since it has a dropdown */
  .nav-dropdown-toggle .nav-label {
    display: inline;
  }

  .nav-dropdown-toggle i.me-1 {
    margin-right: 0.25rem !important;
  }
}

/* Accordion — themed for app */
.app-accordion .accordion-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.app-accordion .accordion-button {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--navy);
  background: var(--ice);
  box-shadow: none;
}

.app-accordion .accordion-button:not(.collapsed) {
  background: var(--cream);
  color: var(--navy);
}

.app-accordion .accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(30, 42, 58, 0.12);
}

.app-accordion .accordion-body {
  background: var(--warm-white);
}

@media (max-width: 991.98px) {
  .app-brand-name {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }

  .app-brand-estate {
    font-size: 0.72rem;
  }
}

@media (max-width: 575.98px) {
  .app-brand-estate {
    display: none;
  }
}
