/**
 * Trips lab styles — aligned with photos-lab / Family Hub palette.
 */

:root {
  --primary: #2d2a26;
  --accent: #d4af37;
  --bg: #f5f2eb;
  --card: #fff;
  --text: #333;
  --soft-orange: #f4b251;
  --danger: #a33;
  --muted: #777;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--primary);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 0 0 14px;
  font-family: inherit;
  background: #fff;
  font-size: 1rem;
}

label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary);
}

button {
  font-family: Arial, sans-serif;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

#lock-screen {
  position: fixed;
  inset: 0;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: #fff;
  padding: 20px;
}

.lock-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 34px;
  border-radius: 14px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lock-box h1 {
  margin-bottom: 8px;
}

.lock-box p {
  color: #ddd;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.lock-box button {
  padding: 12px 20px;
  border: 0;
  border-radius: 30px;
  background: var(--soft-orange);
  color: var(--primary);
  font-weight: bold;
  width: 100%;
}

.site-header {
  background: var(--card);
  padding: 16px 18px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.lab-badge {
  background: #fff3d6;
  color: #8a6d1a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.btn-nav {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  border: 0;
  border-radius: 999px;
  background: #eee;
  color: var(--primary);
  font-weight: bold;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-nav:hover,
.btn-nav:focus-visible {
  background: #e3ddd3;
  outline: 2px solid var(--soft-orange);
  outline-offset: 2px;
}

#app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.status {
  max-width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 10px;
  background: #fff8df;
  border: 1px solid #ead28c;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px dashed #ddd;
}

.panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
}

.panel-chevron {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.85rem;
}

.panel-toggle.is-open .panel-chevron {
  transform: rotate(180deg);
}

.panel-body {
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.35rem;
  color: var(--primary);
}

.user-line {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-gold {
  background: var(--soft-orange);
  color: var(--primary);
}

.btn-ghost {
  background: #eee;
  color: var(--primary);
}

.btn-danger {
  background: #f4dddd;
  color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.trip-card-pending-sync {
  border-left: 4px solid var(--accent);
  background: #fffdf6;
}

.badge-pending-sync {
  color: #8b4513;
  font-weight: 700;
  background: #fff3d6;
}

.trip-card {
  background: var(--card);
  border: 1px solid #eadecc;
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-card:hover,
.trip-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  outline: 2px solid var(--soft-orange);
  outline-offset: 2px;
}

.trip-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.trip-destination {
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--soft-orange);
  font-weight: bold;
}

.trip-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.badge {
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-type {
  background: #eee;
  color: var(--primary);
}

.status-planning {
  background: #dceefb;
  color: #1a5276;
}

.status-booked {
  background: #e2f0e8;
  color: #1e5631;
}

.status-completed {
  background: #e8e8e8;
  color: #555;
}

.status-cancelled {
  background: #f4dddd;
  color: #a33;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid #eadecc;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.stat-value {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.stat-upcoming .stat-value {
  color: #1a5276;
}

.stat-group .stat-value {
  color: #6b4f1d;
}

.stat-individual .stat-value {
  color: #1e5631;
}

#trip-grid {
  margin-bottom: 20px;
}

#panel-plan-trip {
  margin-top: 4px;
}

.trip-name {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.25;
}

.trip-dates,
.trip-travelers {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.trip-summary {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  line-height: 1.5;
}

.empty-hint {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.92rem;
}

.detail-header {
  margin-bottom: 16px;
}

.detail-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.detail-sub {
  font-family: Arial, sans-serif;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.section-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #eadecc;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-weight: bold;
  font-size: 0.85rem;
  min-height: 44px;
}

.section-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.detail-block {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #eadecc;
}

.detail-block h3 {
  color: var(--primary);
  margin-bottom: 14px;
  font-size: 1.1rem;
}

.detail-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 14px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.detail-dl dt {
  color: var(--muted);
  font-weight: bold;
}

.detail-summary,
.detail-notes {
  margin-top: 14px;
  line-height: 1.5;
}

.detail-list {
  list-style: none;
}

.detail-list-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-family: Arial, sans-serif;
}

.detail-list-item:last-child {
  border-bottom: 0;
}

.detail-list-item strong {
  display: block;
  color: var(--primary);
  margin-bottom: 4px;
}

.item-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.item-sub {
  display: block;
  font-size: 0.88rem;
  color: #555;
  margin-top: 4px;
}

.section-empty,
.legacy-note {
  font-family: Arial, sans-serif;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.legacy-note {
  margin-top: 14px;
  padding: 10px;
  background: #faf9f5;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.nested-fieldset {
  border: 1px dashed #ddd;
  border-radius: 12px;
  padding: 14px;
  margin: 18px 0;
}

.nested-fieldset legend {
  padding: 0 8px;
  font-weight: bold;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nested-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nested-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #faf9f5;
  border-radius: 10px;
}

.nested-row input {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-panel {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-panel h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

.modal-panel p {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 14px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.footer-note {
  margin-top: 24px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  #app-shell {
    padding: 12px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .site-header h1 {
    font-size: 1.45rem;
  }

  .top-nav {
    gap: 6px;
  }

  .btn-nav {
    font-size: 0.78rem;
    padding: 10px 6px;
    min-height: 44px;
  }

  .trip-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .trip-card {
    padding: 18px;
  }

  .trip-badges {
    flex-direction: column;
    align-items: flex-end;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .detail-dl dt {
    margin-top: 8px;
  }

  .detail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-toolbar .btn-row {
    width: 100%;
  }

  .detail-toolbar .btn-row .btn {
    flex: 1;
    min-width: 0;
  }

  .form-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .nested-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .trip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .trip-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
