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

:root {
  --primary: #0057A0;
  --primary-hover: #004882;
  --secondary: #6B7280;
  --success: #15803d;
  --error: #b91c1c;
  --bg: #F5F7FA;
  --card-bg: #ffffff;
  --text: #222222;
  --text-light: #666666;
  --border: #E5E7EB;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Navigation */
.nav {
  background: rgba(0, 10, 30, 0.8);
  border-bottom: 2px solid #014f86;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 98%;
  margin: 0 auto;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

@media (min-width: 1400px) {
  .nav-container {
    max-width: 1800px;
  }
}

@media (min-width: 1920px) {
  .nav-container {
    max-width: 95%;
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.6rem;
  color: #ffffff;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.nav-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

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

.nav-email {
  transition: opacity 0.2s;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.nav-email:hover {
  opacity: 0.8;
}

.nav a {
  text-decoration: none;
  color: inherit;
}

.nav a:hover {
  text-decoration: none;
}

#logout-btn {
  background: #c9a43b;
  color: #001a33;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  cursor: pointer;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

#logout-btn:hover {
  background: #ffdf70;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

#profile-btn {
  background: #c9a43b;
  color: #001a33;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  cursor: pointer;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

#profile-btn:hover {
  background: #ffdf70;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.api-env-toggle {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  user-select: none;
}

.api-env-toggle:hover {
  background: var(--border);
  border-color: var(--secondary);
}

.api-env-toggle.test {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.api-env-toggle.production {
  background: #d1ecf1;
  border-color: #0dcaf0;
  color: #055160;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Card */
.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.card h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* View Header with Tabs */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-header h2 {
  margin: 0;
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 8px;
}

.view-tab {
  padding: 0.5rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.view-tab:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.view-tab.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Drawer styles */
.drawer {
  overflow: hidden;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0;
  margin-bottom: 0;
  transition: background-color 0.2s;
}

.drawer-header:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 0.5rem;
  margin: -0.5rem;
}

.drawer-header h2 {
  margin-bottom: 0;
  flex: 1;
}

.drawer-icon {
  font-size: 0.875rem;
  color: var(--text-light);
  transition: transform 0.3s ease;
  margin-left: 1rem;
}

.drawer.collapsed .drawer-icon {
  transform: rotate(-90deg);
}

.drawer-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 1;
  margin-top: 1rem;
}

.drawer.collapsed .drawer-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.subtitle {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group-row .form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 160, 0.1);
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled,
button.btn-primary:disabled,
button.btn-primary.btn-full:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: var(--secondary) !important;
  color: #ffffff !important;
  pointer-events: none !important;
}

.btn-primary:disabled:hover,
button.btn-primary:disabled:hover,
button.btn-primary.btn-full:disabled:hover {
  background: var(--secondary) !important;
  opacity: 0.5 !important;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
}

/* Form Footer */
.form-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* Messages */
.error-message {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #FEE2E2;
  color: var(--error);
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}

.error-message.show {
  display: block;
  color: var(--error) !important;
}

.success-message {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #D1FAE5;
  color: var(--success);
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
}

/* Dashboard */
#dashboard-page {
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 2rem 2rem 0 2rem;
  padding-top: calc(1rem + 80px); /* Match block spacing (1rem) + header height */
  min-height: 100vh;
  color: #ffffff;
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  margin-top: 0;
}

/* Dashboard background - extends to top of viewport */
#dashboard-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom right, #001a33, #014f86);
  z-index: -2;
  pointer-events: none;
}

/* Break dashboard out of container constraints */
body:has(#dashboard-page[style*="display: block"]) #main-content.container,
body:has(#dashboard-page:not([style*="display: none"])) #main-content.container {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Ensure dashboard breaks out of container */
#main-content.container #dashboard-page {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
  left: 0;
  right: 0;
  top: 0;
}

/* Dashboard content wrapper - uses more width */
#dashboard-page .dashboard-content {
  max-width: 98%;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
}

@media (min-width: 1400px) {
  #dashboard-page .dashboard-content {
    max-width: 95%;
    padding: 0 2rem;
  }
}

@media (min-width: 1920px) {
  #dashboard-page .dashboard-content {
    max-width: 95%;
    padding: 0 2rem;
  }
}

/* Dashboard Footer */
.dashboard-footer {
  background: #000d1a;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  border-top: 2px solid #014f86;
  margin-top: 2rem;
  margin-bottom: 0;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
  left: 0;
  right: 0;
}

/* Dashboard cards - darker theme with better readability */
#dashboard-page .card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#dashboard-page .card h2 {
  color: var(--text);
}

#dashboard-page .card p,
#dashboard-page .card .subtitle {
  color: var(--text);
}

#dashboard-page .card .status-loading,
#dashboard-page .card .status-error,
#dashboard-page .card .status-message {
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

/* API Key */
.api-key-container {
  margin: 1.5rem 0;
}

.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.api-key-code {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text);
}

.info-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.info-box strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.info-box p {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.code-block {
  display: block;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text);
}

/* Extension Status */
.status-loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
}

.status-badge.installed {
  background: #D1FAE5;
  color: var(--success);
}

.status-badge.not-installed {
  background: #FEE2E2;
  color: var(--error);
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Connect Section */
#connect-status {
  margin-top: 1rem;
  min-height: 1.5rem;
}

.status-ok {
  color: var(--success);
  font-size: 0.9rem;
}

.status-warn {
  color: var(--error);
  font-size: 0.9rem;
}

.divider {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
}

/* Download Steps */
.download-steps {
  margin-top: 1.5rem;
}

.step {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step-content p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.step-content ol {
  margin-left: 1.5rem;
  color: var(--text-light);
}

.step-content ol li {
  margin-bottom: 0.5rem;
}

.step-content code {
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  #dashboard-page {
    max-width: 100%;
    padding: 1rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-container {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Sync Status */
.sync-status-display {
  padding: 1rem 0;
}

.status-badge.needs-sync {
  background: #f59e0b;
  color: white;
}

.status-badge.not-synced {
  background: #6b7280;
  color: white;
}

.status-badge.synced {
  background: #10b981;
  color: white;
}

.mobile-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
}

.mobile-notice p {
  margin: 0;
}

/* Filters */
.filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  color: var(--text);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 160, 0.1);
}

#clear-filters-btn {
  align-self: flex-end;
  margin-top: 1.5rem;
}

/* Sailings Table */
.sailings-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  grid-column: 1 / -1; /* Span full width of grid */
}

.offers-container {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1; /* Span full width of grid */
}

.saved-filters-container {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1; /* Span full width of grid */
}

/* Filters Block (Excel-style multi-select) */
.filters-block {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filters-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filters-block-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.filters-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: var(--text);
  transition: all 0.2s;
}

.btn-toggle:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.btn-toggle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-toggle.active .toggle-switch {
  background: white;
}

.btn-toggle.active .toggle-switch::after {
  transform: translateX(16px);
}

.toggle-label {
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.filters-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

#save-filter-btn {
  width: auto;
  min-width: 120px;
}

.filter-group-single {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-group-single > label:first-child {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.filter-group-single > label:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.filter-group-single input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.filter-group-multi {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-group-multi > label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.multi-select-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  /* Add scroll indicators on mobile */
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--border);
}

.multi-select-container::-webkit-scrollbar {
  width: 8px;
}

.multi-select-container::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 4px;
}

.multi-select-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.multi-select-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Disabled filter styles for free_play users */
.filter-disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.filter-group-multi.filter-disabled {
  opacity: 0.5;
}

.filter-disabled-message {
  color: #999;
  font-size: 0.875rem;
  font-style: italic;
  padding: 0.5rem;
  text-align: center;
}

/* Make scrollbar more visible on mobile to indicate scrollability */
@media (max-width: 768px) {
  .multi-select-container {
    /* Show scrollbar more prominently on mobile */
    scrollbar-width: auto;
    /* Add padding to make scrollbar more visible */
    padding-right: 0.5rem;
    /* Add visual scroll indicators with inset shadows (especially for iOS) */
    box-shadow: 
      inset 0 -20px 20px -20px rgba(0, 0, 0, 0.15), 
      inset 0 20px 20px -20px rgba(0, 0, 0, 0.15),
      0 0 0 2px rgba(0, 87, 160, 0.1);
  }
  
  /* Add gradient fade overlays to indicate scrollability on iOS */
  .multi-select-container::before,
  .multi-select-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    z-index: 5;
    border-radius: 6px;
  }
  
  .multi-select-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(249, 250, 251, 1), rgba(249, 250, 251, 0.7), transparent);
  }
  
  .multi-select-container::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(249, 250, 251, 1), rgba(249, 250, 251, 0.7), transparent);
  }
  
  .multi-select-container::-webkit-scrollbar {
    width: 12px;
  }
  
  .multi-select-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border: 2px solid var(--card-bg);
  }
  
  .multi-select-container::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 6px;
  }
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  cursor: pointer;
  font-size: 0.875rem;
  user-select: none;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.multi-select-item:hover {
  background: #f3f4f6;
  border-radius: 4px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.multi-select-item input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.multi-select-item span {
  flex: 1;
  color: var(--text);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.sailings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  font-size: 0.9rem;
}

.sailings-table thead {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sailings-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.sailings-table .filter-row th {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
}

.sailings-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  opacity: 1;
}

.sailing-row-faded td {
  opacity: 0.3 !important;
}

.sailings-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s;
  opacity: 1;
  position: relative;
}

.sailings-table tbody tr:hover {
  background: #f9fafb;
}

.sailings-table tbody tr:last-child td {
  border-bottom: none;
}

/* Faded rows for free_play subscription limit */
.sailing-row-faded {
  opacity: 0.3 !important;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}

.sailing-row-faded::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
  pointer-events: none;
  z-index: 1;
}

/* Upgrade message for free_play users */
.sailing-limit-message {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #001a33 0%, #014f86 100%);
  border-radius: 12px;
  text-align: center;
  border: 2px solid #c9a43b;
  box-shadow: 0 4px 12px rgba(201, 164, 59, 0.3);
  color: #ffffff;
  opacity: 1 !important;
  position: relative;
  z-index: 10;
}

.limit-message-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.75rem;
}

.limit-message-subtext {
  font-size: 1rem;
  color: #ffffff !important;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.limit-upgrade-link {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: #c9a43b;
  color: #001a33;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(201, 164, 59, 0.4);
}

.limit-upgrade-link:hover {
  background: #ffdf70;
  box-shadow: 0 4px 12px rgba(201, 164, 59, 0.6);
  transform: translateY(-2px);
}

/* Friend profile circles in "Sail With" column */
.sail-with-cell {
  text-align: center;
  white-space: nowrap;
}

.friend-profile-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0 2px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: help;
  vertical-align: middle;
}

.friend-profile-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Friend filter indicator (matches profile circle color) */
.friend-filter-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 0.7rem;
  margin-right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
  flex-shrink: 0;
}

/* Table Filters */
.table-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-filter label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-filter-select {
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  background: white;
  color: var(--text);
  min-width: 120px;
}

.table-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 87, 160, 0.1);
}

/* Sail Date filter has two selects */
.table-filter-row th:first-child .table-filter {
  flex-direction: row;
  gap: 0.5rem;
}

.table-filter-row th:first-child .table-filter-select {
  min-width: 80px;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.badge.comp {
  background: #10b981;
  color: white;
}

.badge.dollars-off {
  background: #3b82f6;
  color: white;
}

.badge.freeplay {
  background: #8b5cf6;
  color: white;
}

.badge.gty {
  background: #f3e8ff;
  color: #6b21a8;
}

.badge.gobo {
  background: #ffe4e6;
  color: #991b1b;
}

/* Offer Type Badges */
.badge-offer-type {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-offer-type.badge-comp {
  background: #10b981;
  color: white;
}

.badge-offer-type.badge-gty {
  background: #fbbf24;
  color: #78350f;
}

.badge-offer-type.badge-gobo {
  background: #f97316;
  color: white;
}

.badge-offer-type.badge-dollars-off {
  background: #9333ea;
  color: white;
}

.badge-offer-type.badge-freeplay {
  background: #dc2626;
  color: white;
}

/* Perk Code Styles */
.perk-code {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  margin-right: 0.25rem;
}

/* Perks Column Styles */
.perks-cell {
  text-align: center;
  white-space: nowrap;
}

.perks-star {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: help;
  position: relative;
}

.star-icon {
  color: #fbbf24;
  font-size: 1.25rem;
  line-height: 1;
}

.perks-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* Perks List in Modal */
.perks-list {
  list-style-type: disc;
  color: var(--text);
}

.perks-list li {
  margin: 0.25rem 0;
  line-height: 1.5;
}

/* Offers Grid */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.offers-grid .status-loading {
  grid-column: 1 / -1;
  text-align: center;
}

.offer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.offer-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.offer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.offer-code {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.2;
}

.offer-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}

.offer-type-badge-container {
  flex-shrink: 0;
}

.offer-card-body {
  margin-bottom: 1rem;
}

.offer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.offer-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.offer-stat-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.offer-stat-value {
  font-weight: 600;
}

.offer-dates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.offer-date-item {
  display: flex;
  justify-content: space-between;
}

.offer-date-label {
  font-weight: 500;
}

.offer-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-view-offer {
  padding: 0.5rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
}

.btn-view-offer:hover {
  background: var(--primary-hover);
}

.status-error {
  color: var(--error);
  padding: 1rem;
  text-align: center;
}

.status-message {
  color: var(--text-light);
  padding: 2rem;
  text-align: center;
  font-style: italic;
}

@media (max-width: 768px) {
  .sailings-table {
    font-size: 0.8rem;
  }
  
  .sailings-table th,
  .sailings-table td {
    padding: 0.5rem 0.75rem;
  }
  
  .table-filter-select {
    min-width: 100px;
  }
}

/* Homepage New Design */
#homepage {
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom right, #001a33, #014f86);
  color: #ffffff;
  min-height: 100vh;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 0;
  right: 0;
  margin-left: 0;
  margin-right: 0;
}

/* Override container constraints when homepage is shown */
body:has(#homepage[style*="display: block"]) #main-content.container,
body:has(#homepage:not([style*="display: none"])) #main-content.container {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Ensure homepage breaks out of container */
#main-content.container #homepage {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
  left: 0;
  right: 0;
}

/* Remove body padding/margin when homepage is shown */
body:has(#homepage[style*="display: block"]),
body:has(#homepage:not([style*="display: none"])) {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

#homepage .homepage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  background: rgba(0, 10, 30, 0.8);
  border-bottom: 2px solid #014f86;
}

#homepage .homepage-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.6rem;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
}

#homepage .homepage-logo:hover {
  opacity: 0.8;
}

#homepage .homepage-logo img {
  height: 64px;
  width: 64px;
  filter: drop-shadow(0 0 3px #ffffff);
}

#homepage .homepage-header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Hide Sign Up button on mobile */
@media (max-width: 550px) {
  #homepage-signup-header {
    display: none !important;
  }
}

#homepage .cta-button {
  background: #c9a43b;
  color: #001a33;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  display: inline-block;
}

#homepage .cta-button:hover {
  background: #ffdf70;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

#homepage .homepage-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 7rem 2rem 5rem;
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 20, 40, 0.7);
  background-blend-mode: overlay;
  color: #ffffff;
}

#homepage .homepage-hero h1 {
  font-size: 3.2rem;
  max-width: 800px;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#homepage .homepage-hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin-bottom: 2rem;
}

#homepage .homepage-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  padding: 5rem 3rem;
  background: linear-gradient(to bottom right, #001a33, #01294d);
  border-top: 1px solid rgba(255,255,255,0.1);
}

#homepage .homepage-features .feature {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#homepage .homepage-features .feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 18px rgba(0, 170, 255, 0.3);
}

#homepage .homepage-features .feature img {
  width: 85px;
  height: 85px;
  margin-bottom: 1.2rem;
}

#homepage .homepage-features .feature h3 {
  margin-bottom: 0.75rem;
  color: #ffffff;
  font-size: 1.2rem;
}

#homepage .homepage-features .feature p {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

#homepage .homepage-connect {
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(90deg, #001a33, #014f86);
  color: #ffffff;
}

#homepage .homepage-connect h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

#homepage .homepage-connect p {
  max-width: 700px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: #ffffff;
}

#homepage .homepage-subscriptions {
  padding: 5rem 3rem;
  background: linear-gradient(to bottom, #001a33, #000d1a);
  border-top: 1px solid rgba(255,255,255,0.1);
}

#homepage .homepage-subscriptions h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

#homepage .subscription-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

#homepage .subscription-tier {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
  position: relative;
}

#homepage .subscription-tier:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 18px rgba(0, 170, 255, 0.3);
}

#homepage .subscription-tier.featured {
  border-color: #C0C0C0;
  box-shadow: 0 0 20px rgba(201, 164, 59, 0.4);
  transform: scale(1.05);
}

#homepage .subscription-tier.featured:hover {
  transform: scale(1.08) translateY(-6px);
  box-shadow: 0 0 25px rgba(201, 164, 59, 0.6);
}

#homepage .subscription-tier.featured2 {
  border-color: #c9a43b;
  box-shadow: 0 0 20px rgba(201, 164, 59, 0.4);
  transform: scale(1.05);
}

#homepage .subscription-tier.featured2:hover {
  transform: scale(1.08) translateY(-6px);
  box-shadow: 0 0 25px rgba(201, 164, 59, 0.6);
}

#homepage .subscription-tier h3 {
  margin: 0 0 1rem 0;
  color: #c9a43b;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#homepage .subscription-price {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
}

#homepage .subscription-description {
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  min-height: 3rem;
}

#homepage .subscription-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  text-align: left;
}

#homepage .subscription-features li {
  color: #ffffff;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.4;
}

#homepage .subscription-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #c9a43b;
  font-weight: bold;
}

/* Manage Subscription Modal Styles */
#manage-subscription-modal-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  z-index: 1000;
}

#manage-subscription-modal-page.login-page-bg {
  background: rgba(0, 0, 0, 0.5);
}

#manage-subscription-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

#manage-subscription-modal {
  position: relative;
  z-index: 2;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 1200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.subscription-tiers-modal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.subscription-tier-modal {
  background: rgba(0, 26, 51, 0.05);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
  position: relative;
}

.subscription-tier-modal:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 87, 160, 0.2);
}

.subscription-tier-modal.featured {
  border-color: #C0C0C0;
  box-shadow: 0 0 15px rgba(201, 164, 59, 0.3);
}

.subscription-tier-modal.featured2 {
  border-color: #c9a43b;
  box-shadow: 0 0 15px rgba(201, 164, 59, 0.3);
}

.subscription-tier-modal.current {
  border-color: #0057A0;
  background: rgba(0, 87, 160, 0.05);
}

.subscription-tier-modal h3 {
  margin: 0 0 1rem 0;
  color: #c9a43b;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.subscription-tier-modal .subscription-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: #001a33;
  margin-bottom: 1rem;
}

.subscription-tier-modal .subscription-description {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  min-height: 3rem;
}

.subscription-tier-modal .subscription-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  text-align: left;
}

.subscription-tier-modal .subscription-features li {
  color: #333;
  font-size: 0.9rem;
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.4;
}

.subscription-tier-modal .subscription-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #c9a43b;
  font-weight: bold;
}

.subscription-tier-modal .subscription-who {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.current-subscription-label {
  color: #0057A0;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 1rem 0 0 0;
  padding: 0.5rem;
  background: rgba(0, 87, 160, 0.1);
  border-radius: 6px;
}

.subscription-action-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.subscription-action-btn.upgrade {
  background: #c9a43b;
  color: #001a33;
}

.subscription-action-btn.upgrade:hover {
  background: #ffdf70;
  box-shadow: 0 2px 8px rgba(201, 164, 59, 0.4);
}

.subscription-action-btn.downgrade {
  background: #6c757d;
  color: #ffffff;
}

.subscription-action-btn.downgrade:hover {
  background: #5a6268;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.4);
}

.subscription-action-btn.cancel {
  background: #dc3545;
  color: #ffffff;
}

.subscription-action-btn.cancel:hover {
  background: #c82333;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

@media (max-width: 768px) {
  #manage-subscription-modal {
    width: 95%;
    padding: 1.5rem;
    max-height: 85vh;
  }
  
  .subscription-tiers-modal {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

#homepage .subscription-who {
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#homepage .subscription-who strong {
  color: #c9a43b;
}

@media (max-width: 768px) {
  #homepage .subscription-tiers {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #homepage .subscription-tier.featured {
    transform: scale(1);
  }
  
  #homepage .subscription-tier.featured:hover {
    transform: translateY(-6px);
  }
  
  #homepage .homepage-subscriptions {
    padding: 3rem 1.5rem;
  }
}

#homepage .homepage-footer {
  background: #000d1a;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  border-top: 2px solid #014f86;
}

@media (max-width: 768px) {
  #homepage .homepage-hero h1 {
    font-size: 2rem;
  }
  
  #homepage .homepage-hero p {
    font-size: 1rem;
  }
  
  #homepage .homepage-header {
    padding: 1rem 1.5rem;
  }
  
  #homepage .homepage-logo {
    font-size: 1.2rem;
  }
  
  #homepage .homepage-logo img {
    height: 36px;
    width: 36px;
  }
}

/* Force the login page to take full screen */
#login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; /* Hidden by default, shown via JavaScript */
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  z-index: 1000;
}

/* When login page is shown, JavaScript sets display: flex */

/* Background layer */
#login-page.login-page-bg {
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Backdrop overlay (dark transparent) */
#login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* The centered modal */
#login-modal {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  #login-modal {
    max-width: 90%;
    padding: 2rem;
  }
}

/* Password Reset Page - Same styling as login page */
#password-reset-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; /* Hidden by default, shown via JavaScript */
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  z-index: 1000;
}

#password-reset-page.login-page-bg {
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Backdrop overlay (dark transparent) */
#password-reset-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* The centered modal */
#password-reset-modal {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  #password-reset-modal {
    max-width: 90%;
    padding: 2rem;
  }
}

/* Reset Password with Token Page - Same styling as login page */
#reset-password-with-token-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; /* Hidden by default, shown via JavaScript */
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  z-index: 1000;
}

#reset-password-with-token-page.login-page-bg {
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Backdrop overlay (dark transparent) */
#reset-password-token-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* The centered modal */
#reset-password-token-modal {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  #reset-password-token-modal {
    max-width: 90%;
    padding: 2rem;
  }
}

/* Register Page - Same styling as login page */
#register-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; /* Hidden by default, shown via JavaScript */
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  z-index: 1000;
}

#register-page.register-page-bg {
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#register-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

#register-modal {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 518px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  #register-page {
    align-items: flex-start;
    padding-top: 2rem;
    padding-bottom: 4rem;
  }
  
  #register-modal {
    max-width: 90%;
    padding: 2rem;
    margin-top: 1rem;
    margin-bottom: 4rem;
  }
}

.register-header {
  text-align: center;
  margin-bottom: 2rem;
}

.register-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text);
}

.login-logo {
  display: block;
  margin: 0 auto 1rem;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 60px;
}

.show-password-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  text-decoration: underline;
}

.show-password-btn:hover {
  color: var(--primary-hover);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.form-link-small {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  margin-top: 0.25rem;
  display: block;
}

.form-link-small:hover {
  text-decoration: underline;
}

.btn-full {
  width: 100%;
}

/* Friends Section */
.friends-list {
  min-height: 100px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.friend-item:hover {
  background: var(--bg);
}

.friend-item.pending {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.friend-item.confirmed {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

.friend-item.pending .friend-avatar {
  background: #f97316;
}

.friend-item.confirmed .friend-avatar {
  background: #10b981;
}

.friend-info {
  flex: 1;
}

.friend-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.friend-status {
  font-size: 0.75rem;
  color: var(--text-light);
}

.friend-remove {
  opacity: 0;
  transition: opacity 0.2s;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.friend-item:hover .friend-remove {
  opacity: 1;
}

.friend-remove:hover {
  background: #991b1b;
}

.no-friends {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

/* Back link styling */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.back-link span:first-child {
  font-size: 1.2rem;
  line-height: 1;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background-color: #f3f4f6;
}

.modal-body {
  padding: 1.5rem;
}

/* Sailing Details Content */
.sailing-details-content {
  max-width: 900px;
}

.details-section {
  margin-bottom: 2rem;
}

.details-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.details-section h3 .data-source {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.detail-value.empty {
  color: var(--text-light);
  font-style: italic;
}

/* Saved Filters */
.saved-filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.saved-filter-item:hover {
  box-shadow: var(--shadow);
}

.saved-filter-info {
  flex: 1;
  min-width: 0;
}

.saved-filter-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.saved-filter-summary {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.saved-filter-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.saved-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.save-filter-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  width: auto;
  min-width: 100px;
}

.warning-message {
  color: #f59e0b;
  font-size: 0.875rem;
  padding: 0.5rem;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
}

