/* =============================================================================
   CruiseDucky v2 — Main Stylesheet
   /public_htmlv2/assets/css/app.css
   Mobile-first | Nautical Duck Theme
============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&family=Nunito:wght@400;500;600&display=swap');

/* =============================================================================
   CSS VARIABLES
============================================================================= */
:root {
  /* Brand colors */
  --duck-yellow:   #F5C518;
  --duck-amber:    #E8A000;
  --navy:          #0D1B2A;
  --navy-mid:      #1A2F45;
  --navy-light:    #243B55;
  --ocean:         #1B6CA8;
  --ocean-light:   #2E86C1;
  --foam:          #E8F4FD;
  --white:         #FFFFFF;

  /* UI */
  --text-primary:   #0D1B2A;
  --text-secondary: #4A6480;
  --text-muted:     #8A9BB0;
  --border:         #D8E6F0;
  --border-strong:  #B0C8DC;
  --bg-page:        #F0F6FC;
  --bg-card:        #FFFFFF;
  --bg-input:       #FFFFFF;

  /* Status */
  --success:  #1A9E5C;
  --warning:  #E8A000;
  --danger:   #D63031;
  --info:     #1B6CA8;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  /* Typography */
  --font-display: 'Poppins', sans-serif;
  --font-body:    'Nunito', sans-serif;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(13,27,42,0.08), 0 1px 2px rgba(13,27,42,0.04);
  --shadow-md:  0 4px 12px rgba(13,27,42,0.10), 0 2px 4px rgba(13,27,42,0.06);
  --shadow-lg:  0 10px 30px rgba(13,27,42,0.12), 0 4px 8px rgba(13,27,42,0.08);
  --shadow-duck: 0 4px 16px rgba(245,197,24,0.30);

  /* Nav heights */
  --topnav-height:       90px;
  --sailctx-bar-height:   0px;  /* set to 36px by JS when sailing bar is present */
  --header-total-height: calc(var(--topnav-height) + var(--sailctx-bar-height));
  --bottomnav-height:    64px;
}

/* =============================================================================
   RESET & BASE
============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  /* Room for top nav + sailing context bar + bottom nav on mobile */
  padding-top: var(--header-total-height);
  padding-bottom: var(--bottomnav-height);
}

a { color: var(--ocean); text-decoration: none; }
a:hover { color: var(--ocean-light); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
}

ul, ol { list-style: none; }

/* =============================================================================
   TYPOGRAPHY
============================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

.text-muted    { color: var(--text-muted); font-size: 0.875rem; }
.text-secondary{ color: var(--text-secondary); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.text-center   { text-align: center; }
.font-display  { font-family: var(--font-display); }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* =============================================================================
   LAYOUT
============================================================================= */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--wide {
  max-width: 1100px;
}

.page-content {
  padding: 8px 0 var(--space-lg);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-title .duck-icon {
  font-size: 1.5rem;
}

/* Two-column grid for larger screens */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

/* =============================================================================
   TOP NAVIGATION
============================================================================= */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-height);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.topnav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.topnav__logo-img {
  height: 80px;
  width: auto;
  display: block;
}

@media (max-width: 480px) {
  .topnav__logo-img {
    height: 56px;
  }
}

.topnav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Notification bell */
.topnav__bell {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--navy-mid);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.topnav__bell:hover { background: var(--navy-light); color: var(--white); text-decoration: none; }

.badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--navy);
}

/* Avatar button */
.topnav__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--navy-mid);
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
  display: block;
}

.topnav__avatar:hover { border-color: var(--duck-yellow); }
.topnav__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================================================
   BOTTOM NAVIGATION (mobile)
============================================================================= */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(13,27,42,0.08);
}

.bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.bottomnav__item:hover,
.bottomnav__item.active {
  color: var(--ocean);
  text-decoration: none;
}

.bottomnav__item.active .bottomnav__icon {
  background: var(--foam);
  color: var(--ocean);
}

.bottomnav__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.15s, color 0.15s;
}

/* Duck button in the middle — special style */
.bottomnav__duck {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  cursor: pointer;
}

.bottomnav__duck-btn {
  width: 48px;
  height: 48px;
  background: var(--duck-yellow);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-duck);
  transform: translateY(-8px);
  transition: transform 0.15s, box-shadow 0.15s;
}

.bottomnav__duck:hover .bottomnav__duck-btn {
  transform: translateY(-10px);
  box-shadow: 0 8px 24px rgba(245,197,24,0.40);
}

.bottomnav__duck-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--duck-amber);
  margin-top: -4px;
}

/* =============================================================================
   CARDS
============================================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.card__body {
  padding: var(--space-lg);
}

.card__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}

/* Cruise card */
.cruise-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.cruise-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--ocean-light);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.cruise-card__ship-icon {
  width: 52px;
  height: 52px;
  background: var(--foam);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cruise-card__info { flex: 1; min-width: 0; }

.cruise-card__ship {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cruise-card__line {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.cruise-card__meta {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
  flex-wrap: wrap;
}

/* Duck card */
.duck-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.duck-card__photo {
  aspect-ratio: 4/3;
  background: var(--foam);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.duck-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duck-card__body { padding: var(--space-md); }

/* =============================================================================
   CHIPS / TAGS
============================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chip--blue   { background: var(--foam);  color: var(--ocean); }
.chip--yellow { background: #FEF9E7; color: var(--duck-amber); }
.chip--green  { background: #E8F8F1; color: var(--success); }
.chip--red    { background: #FDEDEC; color: var(--danger); }
.chip--grey   { background: #F0F3F6; color: var(--text-secondary); }

/* =============================================================================
   BUTTONS
============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--ocean);
  color: var(--white);
  border-color: var(--ocean);
}
.btn--primary:hover {
  background: var(--ocean-light);
  border-color: var(--ocean-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27,108,168,0.35);
}

.btn--duck {
  background: var(--duck-yellow);
  color: var(--navy);
  border-color: var(--duck-yellow);
}
.btn--duck:hover {
  background: var(--duck-amber);
  border-color: var(--duck-amber);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-duck);
}

.btn--outline {
  background: transparent;
  color: var(--ocean);
  border-color: var(--ocean);
}
.btn--outline:hover {
  background: var(--foam);
  color: var(--ocean);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn--danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: var(--white);
}

.btn--sm { padding: 7px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn--lg { padding: 14px 28px; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn--full { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* =============================================================================
   FORMS
============================================================================= */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px rgba(27,108,168,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A6480' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-help {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 4px;
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(214,48,49,0.15);
}

/* =============================================================================
   ALERTS / FLASH MESSAGES
============================================================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  border: 1px solid transparent;
  margin-bottom: var(--space-md);
}

.alert--success {
  background: #E8F8F1;
  border-color: #A9DFBF;
  color: #1A7A46;
}

.alert--error {
  background: #FDEDEC;
  border-color: #F1948A;
  color: #A93226;
}

.alert--warning {
  background: #FEF9E7;
  border-color: #F9E79F;
  color: #9A7D0A;
}

.alert--info {
  background: var(--foam);
  border-color: #AED6F1;
  color: #1A5276;
}

/* =============================================================================
   ACTIVITY FEED
============================================================================= */
.feed { display: flex; flex-direction: column; gap: 2px; }

.feed-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  transition: background 0.1s;
}

.feed-item:hover { background: var(--foam); }

.feed-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.feed-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-item__content { flex: 1; min-width: 0; }

.feed-item__text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.feed-item__text strong { font-weight: 700; }

.feed-item__time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.feed-item__emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--foam);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================================================
   EMPTY STATES
============================================================================= */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.empty-state__icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-md);
}

.empty-state__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto var(--space-lg);
  font-size: 0.9375rem;
}

/* =============================================================================
   DIVIDER
============================================================================= */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* =============================================================================
   ITINERARY / PORT LIST
============================================================================= */
.port-list { display: flex; flex-direction: column; }

.port-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.port-item:last-child { border-bottom: none; }

.port-item__timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
  padding-top: 4px;
}

.port-item__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ocean);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--ocean);
  flex-shrink: 0;
}

.port-item__dot--sea { background: var(--text-muted); box-shadow: 0 0 0 2px var(--text-muted); }
.port-item__dot--home { background: var(--duck-yellow); box-shadow: 0 0 0 2px var(--duck-amber); }

.port-item__line {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: var(--border);
  margin: 4px 0;
}

.port-item__info { flex: 1; }

.port-item__date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.port-item__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.port-item__times {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* =============================================================================
   LOADING SPINNER
============================================================================= */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--ocean);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  gap: var(--space-sm);
  font-size: 0.9375rem;
}

/* =============================================================================
   TABS
============================================================================= */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: var(--ocean); text-decoration: none; }

.tab.active {
  color: var(--ocean);
  border-bottom-color: var(--ocean);
}

/* =============================================================================
   RESPONSIVE — Tablet & up
============================================================================= */
@media (min-width: 640px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }

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

}

@media (min-width: 768px) {
  .container { padding: 0 var(--space-lg); }
  .page-content { padding: 8px 0 var(--space-xl); }
}

/* =============================================================================
   UTILITY
============================================================================= */
.d-flex     { display: flex; }
.d-none     { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm     { gap: var(--space-sm); }
.gap-md     { gap: var(--space-md); }
.mt-sm      { margin-top: var(--space-sm); }
.mt-md      { margin-top: var(--space-md); }
.mt-lg      { margin-top: var(--space-lg); }
.mb-sm      { margin-bottom: var(--space-sm); }
.mb-md      { margin-bottom: var(--space-md); }
.mb-lg      { margin-bottom: var(--space-lg); }
.p-md       { padding: var(--space-md); }
.w-full     { width: 100%; }
.overflow-hidden { overflow: hidden; }

/* =============================================================================
   THEME SYSTEM — CruiseDucky v2
   Applied via data-theme attribute on <html> or <body>
   Stored in localStorage by app.js
   Default (no attribute) = Classic Ocean (original)
============================================================================= */

/* ── THEME: TROPICAL PARADISE ── */
/* Warm turquoise + coral + sandy white */
[data-theme="tropical"] {
  --duck-yellow:   #FF6B6B;
  --duck-amber:    #E85D5D;
  --navy:          #1A3C5E;
  --navy-mid:      #1F4A73;
  --navy-light:    #255888;
  --ocean:         #00B4A0;
  --ocean-light:   #00CDB8;
  --foam:          #E0F9F6;
  --text-primary:   #0F2D45;
  --text-secondary: #2D6680;
  --text-muted:     #6FA8C0;
  --border:         #B8EAE4;
  --border-strong:  #7ECEC5;
  --bg-page:        #F0FAFA;
  --bg-card:        #FFFFFF;
  --bg-input:       #FFFFFF;
  --success:  #00A87A;
  --shadow-duck: 0 4px 16px rgba(255,107,107,0.30);
}

/* ── THEME: SUNSET CRUISE ── */
/* Deep purple-navy dusk + golden orange + soft lavender */
[data-theme="sunset"] {
  --duck-yellow:   #FF9A3C;
  --duck-amber:    #E8820A;
  --navy:          #1E1145;
  --navy-mid:      #2A1960;
  --navy-light:    #352178;
  --ocean:         #7C4DFF;
  --ocean-light:   #9C6FFF;
  --foam:          #F0EBFF;
  --text-primary:   #1E1145;
  --text-secondary: #5A4090;
  --text-muted:     #9B8EC0;
  --border:         #DDD5F5;
  --border-strong:  #B8A8E8;
  --bg-page:        #F7F4FF;
  --bg-card:        #FFFFFF;
  --bg-input:       #FFFFFF;
  --success:  #1A9E5C;
  --shadow-duck: 0 4px 16px rgba(255,154,60,0.35);
}

/* ── THEME: SANDY BEACH ── */
/* Warm sand + driftwood + ocean horizon */
[data-theme="beach"] {
  --duck-yellow:   #F5A623;
  --duck-amber:    #D4891A;
  --navy:          #3D2B1F;
  --navy-mid:      #4F3828;
  --navy-light:    #624530;
  --ocean:         #2E86AB;
  --ocean-light:   #3DA0C8;
  --foam:          #FEF6E4;
  --text-primary:   #2C1A0E;
  --text-secondary: #7A5C3D;
  --text-muted:     #B09070;
  --border:         #EDD9B8;
  --border-strong:  #D4B88A;
  --bg-page:        #FBF5E8;
  --bg-card:        #FFFEF8;
  --bg-input:       #FFFEF8;
  --success:  #2E7D32;
  --shadow-duck: 0 4px 16px rgba(245,166,35,0.30);
}

/* ── THEME: DEEP SEA ── */
/* Dark mode nautical — near-black with bioluminescent teal accents */
[data-theme="deepsea"] {
  --duck-yellow:   #00F5C4;
  --duck-amber:    #00D4AA;
  --navy:          #050E1A;
  --navy-mid:      #0A1628;
  --navy-light:    #0F2040;
  --ocean:         #00B8D9;
  --ocean-light:   #00D4F0;
  --foam:          #071524;
  --white:         #E8F4F8;
  --text-primary:   #D0E8F0;
  --text-secondary: #7AACC0;
  --text-muted:     #4A7A90;
  --border:         #0D2A3D;
  --border-strong:  #1A4060;
  --bg-page:        #030C16;
  --bg-card:        #07182A;
  --bg-input:       #0A1E30;
  --success:  #00D4AA;
  --danger:   #FF5E78;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.6), 0 4px 8px rgba(0,0,0,0.4);
  --shadow-duck: 0 4px 20px rgba(0,245,196,0.40);
}

/* Deep sea needs light text on dark backgrounds for nav + bottom nav */
[data-theme="deepsea"] .bottomnav {
  background: var(--bg-card);
  border-top-color: var(--border);
}
[data-theme="deepsea"] .form-control {
  color: var(--text-primary);
}

/* ── THEME: ISLAND BREEZE ── */
/* Fresh lime + sky blue + coconut white — daytime poolside */
[data-theme="island"] {
  --duck-yellow:   #00C875;
  --duck-amber:    #00A860;
  --navy:          #0A3352;
  --navy-mid:      #0E4068;
  --navy-light:    #124E80;
  --ocean:         #0099CC;
  --ocean-light:   #00B5E8;
  --foam:          #E6F9F2;
  --text-primary:   #062033;
  --text-secondary: #1E6E8A;
  --text-muted:     #5CA8BC;
  --border:         #B0E4D4;
  --border-strong:  #72C8AC;
  --bg-page:        #EBF8F5;
  --bg-card:        #FFFFFF;
  --bg-input:       #FFFFFF;
  --success:  #00A860;
  --shadow-duck: 0 4px 16px rgba(0,200,117,0.30);
}

/* ── THEME PICKER — topnav dropdown ── */
.topnav__theme-wrap {
  position: relative;
}

.topnav__theme-panel {
  display: none;
  position: fixed;
  top: var(--topnav-height);
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-width: calc(100vw - 16px);
  flex-direction: column;
  gap: 4px;
  z-index: 2000;
}

.topnav__theme-panel.open { display: flex; }

/* Arrow pointer */
.topnav__theme-panel::before {
  content: '';
  position: absolute;
  top: -6px; right: 14px;
  width: 12px; height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.topnav__theme-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  white-space: nowrap;
}

.theme-btn:hover { background: var(--bg-page); border-color: var(--border); }
.theme-btn.active { background: var(--foam); border-color: var(--ocean); color: var(--ocean); }

.theme-btn__swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,0.08);
}

/* =============================================================================
   UPLOAD PROGRESS BAR
============================================================================= */
.upload-progress {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.upload-progress__track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.upload-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ocean), var(--duck-yellow));
  border-radius: 999px;
  transition: width 0.2s ease;
  will-change: width;
}

.upload-progress__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}
