:root {
  --bg-primary: #0a1120;
  --bg-secondary: #0f1c32;
  --bg-card: rgba(18, 32, 58, 0.85);
  --bg-card-hover: rgba(26, 45, 80, 0.95);
  --border-color: rgba(56, 189, 248, 0.2);
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-teal: #14b8a6;
  --accent-blue: #0284c7;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-rose: #f43f5e;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --glass-blur: blur(12px);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.12) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Header & Top Bar */
.navbar {
  background: rgba(10, 17, 32, 0.9);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.couple-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #f43f5e;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
  flex-shrink: 0;
}

.couple-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wedding-ring-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.brand-logo svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #bae6fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-btn-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

/* Main Container */
.main-wrapper {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Friend Status Highlight Hero */
.hero-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.hero-voyage-tag {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.hero-voyage-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.form-control-compact {
  background: rgba(15, 28, 50, 0.9);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.form-control-compact:focus {
  border-color: var(--accent-cyan);
}

/* Current Leg Summary */
.leg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.leg-card {
  background: rgba(15, 28, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.leg-card.active-leg {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(145deg, rgba(18, 38, 70, 0.7), rgba(15, 28, 50, 0.6));
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.15);
}

.leg-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.leg-label.origin { color: var(--accent-gold); }
.leg-label.destination { color: var(--accent-cyan); }
.leg-label.current { color: var(--accent-green); }

.port-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Crisp SVG Country Flag Icons (cross-platform, replaces Windows text letters) */
.flag-icon {
  display: inline-block;
  width: 1.35em;
  height: 0.95em;
  vertical-align: -0.12em;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  margin-right: 0.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.port-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.leg-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.leg-arrow {
  color: var(--accent-cyan);
  font-size: 1.5rem;
  animation: pulse-arrow 2s infinite ease-in-out;
}

@keyframes pulse-arrow {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(5px); opacity: 1; }
}

/* Leg Progress Bar */
.progress-section {
  background: rgba(15, 28, 50, 0.5);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0284c7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.8s ease-in-out;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  background: rgba(15, 28, 50, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.stat-val small {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Two-column Layout for Map & Itinerary */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 65% 35%;
  }
}

/* Map Card */
.map-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 550px;
}

.map-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-tools {
  display: flex;
  gap: 0.5rem;
}

#map {
  width: 100%;
  height: 540px;
  background: #091322;
  z-index: 10;
}

/* Custom Map Marker Styling */
.vessel-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vessel-pulse-ring {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.35);
  animation: radar-sweep 2.5s infinite ease-out;
  pointer-events: none;
}

@keyframes radar-sweep {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.vessel-marker-img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
  transition: transform 0.5s ease-out;
}

.port-badge-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #38bdf8;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.port-badge-marker.completed {
  border-color: #64748b;
  background: #1e293b;
  color: #94a3b8;
}

.port-badge-marker.origin {
  border-color: #f59e0b;
  background: #78350f;
  color: #fef3c7;
}

.port-badge-marker.destination {
  border-color: #38bdf8;
  background: #0369a1;
  color: #ffffff;
  box-shadow: 0 0 12px #38bdf8;
}

/* Map Popups */
.leaflet-popup-content-wrapper {
  background: #0f1c32 !important;
  color: #f8fafc !important;
  border: 1px solid var(--border-color);
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8) !important;
}

.leaflet-popup-tip {
  background: #0f1c32 !important;
}

.port-popup {
  padding: 0.25rem;
}

.port-popup h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.25rem;
}

.port-popup .popup-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.port-popup p {
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* Itinerary Sidebar Card */
.itinerary-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  max-height: 640px;
}

.itinerary-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.itinerary-list {
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Custom Scrollbar */
.itinerary-list::-webkit-scrollbar {
  width: 6px;
}
.itinerary-list::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 10px;
}

.itinerary-item {
  background: rgba(15, 28, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.itinerary-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.itinerary-item.active-next {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(15, 28, 50, 0.8));
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.itinerary-item.active-prev {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.stop-status-icon {
  font-size: 1.1rem;
  margin-top: 2px;
}

.stop-details {
  flex: 1;
}

.stop-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stop-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.badge-completed { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-origin { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-dest { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-upcoming { background: rgba(255, 255, 255, 0.05); color: #64748b; }

.stop-time {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 0.2rem;
}

/* Secondary Panels (Weather, Specs, Marine Radar) */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

/* Honeymoon Card Styling */
.honeymoon-card {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(145deg, rgba(30, 25, 45, 0.85), rgba(15, 28, 50, 0.9));
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.12), var(--shadow-lg);
  grid-column: 1 / -1; /* Stretch across top of secondary grid for maximum elegance */
}

.honeymoon-content {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.honeymoon-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  flex-shrink: 0;
}

.honeymoon-photo-frame {
  width: 150px;
  height: 190px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(244, 63, 94, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  background: #091322;
}

.honeymoon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.honeymoon-thumbs {
  display: flex;
  gap: 0.5rem;
}

.honeymoon-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.honeymoon-thumb:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.honeymoon-thumb.active {
  border-color: #f43f5e;
  opacity: 1;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.honeymoon-bio {
  flex: 1;
  min-width: 260px;
}

.honeymoon-stats-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.honeymoon-pill {
  background: rgba(15, 28, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

/* Specs Table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.specs-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-table td {
  padding: 0.5rem 0;
}

.specs-table td:first-child {
  color: var(--text-dim);
  font-weight: 600;
  width: 45%;
}

.specs-table td:last-child {
  color: #fff;
  text-align: right;
  font-weight: 500;
}

/* Weather Widget */
.weather-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.weather-temp {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
}

.weather-condition {
  font-size: 1rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.weather-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.weather-box {
  background: rgba(15, 28, 50, 0.6);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.weather-box-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.weather-box-val {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* Free Source Banner */
.info-banner {
  background: rgba(15, 28, 50, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-banner-icon {
  font-size: 1.8rem;
  color: var(--accent-cyan);
}

.info-banner-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.info-banner-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2rem;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #0f1c32;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-tabs {
  display: flex;
  background: rgba(10, 18, 32, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-tab {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.modal-tab:hover {
  color: #fff;
}

.modal-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 60vh;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-control {
  width: 100%;
  background: rgba(15, 28, 50, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.form-help code {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.form-check-group {
  background: rgba(15, 28, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #fff;
}

.switch-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
}

.modal-actions-inline {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-secondary {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

.triggers-box {
  background: rgba(15, 28, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1.25rem;
}

.modal-feedback-box {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-top: 1rem;
  line-height: 1.4;
}

.modal-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #a7f3d0;
}

.modal-feedback-box.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid #f43f5e;
  color: #fecdd3;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 18, 32, 0.6);
}

.history-item {
  background: rgba(15, 28, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

/* ========================================================
   Dual Times in Leg Cards (Ship Local vs User EST Time)
   ======================================================== */
.leg-dual-times {
  margin-top: 0.65rem;
  background: rgba(15, 28, 50, 0.6);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  box-sizing: border-box;
}

.leg-time-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.leg-time-row:last-child {
  margin-bottom: 0;
}

.leg-time-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.leg-time-badge.ship-badge {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.leg-time-badge.est-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.leg-time-text {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.78rem;
  word-break: break-word;
}

/* ========================================================
   Dual Times in Itinerary List (Ship Local vs User EST)
   ======================================================== */
.stop-time-dual {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.stop-time-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.stop-time-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stop-time-badge.ship-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.stop-time-badge.est-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.stop-time-val {
  color: #e2e8f0;
  font-weight: 500;
  word-break: break-word;
}

/* ========================================================
   Comprehensive Mobile & Tablet Responsive Design
   ======================================================== */

/* Tablet & Smaller Desktops (<= 1024px) */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .map-card {
    min-height: 480px;
  }
}

/* Tablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0.65rem 0.85rem;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    text-align: center;
  }

  .brand {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
    width: 100%;
    gap: 0.75rem;
  }

  .brand-text h1 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .brand-text p {
    font-size: 0.72rem;
  }

  .nav-status {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-align: center;
  }

  .nav-btn-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 360px;
    justify-content: center;
  }

  .nav-btn-group .btn {
    flex: 1 1 50%;
    min-width: 0;
    font-size: 0.78rem;
    padding: 0.48rem 0.4rem;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .live-pill {
    font-size: 0.7rem;
    padding: 0.22rem 0.65rem;
    margin: 0 auto;
  }

  #lastUpdatedTime {
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
  }

  /* Main wrapper */
  .main-wrapper {
    margin: 0.85rem auto;
    padding: 0 0.65rem;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Hero Card */
  .hero-card {
    padding: 1.15rem 0.95rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .hero-title {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    width: 100%;
    font-size: 1.05rem;
  }

  .hero-title i {
    font-size: 1.25rem;
  }

  .hero-title span {
    text-align: center;
    line-height: 1.35;
  }

  .hero-voyage-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: stretch;
  }

  #voyageSelector {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.78rem;
    padding: 0.45rem 0.5rem;
    text-align: center;
    text-align-last: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .hero-voyage-tag {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: block;
    box-sizing: border-box;
  }

  /* Leg Grid & Cards */
  .leg-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .leg-card {
    padding: 1rem 0.85rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .port-title {
    font-size: 1.05rem;
    word-break: break-word;
  }

  .leg-time-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-bottom: 0.35rem;
  }

  /* Stats Row */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .stat-item {
    padding: 0.6rem 0.65rem;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
  }

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

  .stat-val {
    font-size: 0.95rem;
    justify-content: center;
    word-break: break-word;
  }

  .stat-val small {
    font-size: 0.65rem;
  }

  /* Map Card */
  .map-card {
    min-height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
  }

  .map-header {
    padding: 0.65rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    text-align: center;
  }

  .map-title {
    justify-content: center;
    font-size: 0.92rem;
    text-align: center;
  }

  .map-tools {
    justify-content: center;
    width: 100%;
  }

  .map-tools .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.74rem;
    padding: 0.4rem 0.5rem;
  }

  #map, .leaflet-container {
    height: 340px;
    width: 100%;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .leaflet-control-attribution {
    font-size: 8px !important;
    max-width: 75% !important;
    word-break: break-word !important;
  }

  /* Itinerary Card */
  .itinerary-card {
    max-height: 480px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .itinerary-header {
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .itinerary-list {
    padding: 0.4rem;
  }

  .itinerary-item {
    padding: 0.65rem;
    gap: 0.5rem;
  }

  .stop-details {
    min-width: 0;
    width: 100%;
  }

  .stop-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 0.85rem;
  }

  .stop-badge {
    font-size: 0.62rem;
    align-self: flex-start;
  }

  .stop-time-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    margin-bottom: 0.25rem;
  }

  /* Honeymoon Card (Duncan & Corinna) */
  .panel-card {
    padding: 1rem 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .panel-title {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.45rem !important;
  }

  .panel-title > div {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
  }

  .honeymoon-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    width: 100%;
  }

  .honeymoon-gallery {
    width: 100%;
    align-items: center;
    justify-content: center;
  }

  .honeymoon-photo-frame {
    width: 170px;
    height: 215px;
    margin: 0 auto;
  }

  .honeymoon-thumbs {
    justify-content: center;
    margin: 0 auto;
  }

  .honeymoon-bio {
    min-width: 0;
    width: 100%;
    text-align: center;
  }

  .honeymoon-bio h4 {
    text-align: center;
    font-size: 1.2rem;
  }

  .honeymoon-bio p {
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .honeymoon-stats-mini {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .honeymoon-pill {
    text-align: center;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.65rem;
  }

  /* Weather & Specs */
  .weather-temp {
    font-size: 1.75rem;
  }

  .weather-condition {
    font-size: 0.9rem;
  }

  .weather-details-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .weather-box {
    padding: 0.5rem 0.65rem;
  }

  .specs-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.74rem;
  }

  .specs-table td {
    padding: 0.4rem 0.15rem;
    word-break: break-word;
  }

  .specs-table td:first-child {
    width: 44%;
  }

  .specs-table td:last-child {
    width: 56%;
  }

  .info-banner {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem;
  }

  .info-banner-icon {
    font-size: 1.5rem;
    margin: 0 auto;
  }

  footer {
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
  }

  footer > div {
    flex-direction: column !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
  }

  .brand-text h1 {
    font-size: 0.98rem;
    text-align: center;
  }

  .brand-text p {
    font-size: 0.68rem;
    text-align: center;
  }

  .nav-btn-group .btn {
    font-size: 0.76rem;
    padding: 0.45rem 0.3rem;
  }

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

  .stat-val {
    font-size: 0.88rem;
  }

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

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .modal-overlay {
    padding: 0.4rem;
  }

  .modal-card {
    border-radius: 12px;
    max-height: 95vh;
  }

  .modal-body {
    padding: 0.85rem;
  }

  .modal-actions-inline {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-actions-inline .btn {
    width: 100%;
    justify-content: center;
  }
}


