/* Mobile-first CSS with utility classes */
* {
  box-sizing: border-box;
}

/* Help icon - simple visible text instead of hidden tooltip */
.help-icon {
  display: inline-block;
  cursor: help;
  margin-left: 0.25rem;
  color: #0066cc;
  font-size: 0.9em;
  font-weight: 600;
}

/* Help text shown below cabin selection - mobile friendly */
.cabin-help-text {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f0f7ff;
  border-left: 3px solid #0066cc;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.4;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

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

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0066cc;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  color: #555;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.nav a:hover {
  background-color: #f1f3f4;
  color: #0066cc;
}

/* Responsive navigation - nowrap for desktop, wrap for mobile */
@media (min-width: 769px) {
  .nav {
    flex-wrap: nowrap;
  }
}

/* Main content */
main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Footer */
footer {
  background: #fff;
  border-top: 1px solid #e9ecef;
  padding: 1.5rem 0;
  text-align: center;
  color: #6c757d;
  margin-top: auto;
}

footer a {
  color: #0066cc;
  text-decoration: none;
}

/* Layout utilities */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 -0.5rem;
}

.col {
  flex: 1;
  min-width: 0;
  padding: 0 0.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

/* Cards */
.card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.card-text {
  margin: 0 0 1rem 0;
  color: #6c757d;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #0066cc;
  color: #fff;
}

.btn:hover {
  background: #0052a3;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-outline {
  background: transparent;
  color: #0066cc;
  border: 1px solid #0066cc;
}

.btn-outline:hover {
  background: #0066cc;
  color: #fff;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border-radius: 0.25rem;
}

.badge-success {
  background: #28a745;
  color: #fff;
}

.badge-info {
  background: #17a2b8;
  color: #fff;
}

.badge-warning {
  background: #ffc107;
  color: #212529;
}

.badge-danger {
  background: #dc3545;
  color: #fff;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.muted {
  color: #6c757d;
}

.text-center {
  text-align: center;
}

.text-small {
  font-size: 0.875rem;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Toast with ARIA live region */
#toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  max-width: 350px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid #28a745;
}

.toast.error {
  border-left: 4px solid #dc3545;
}

.toast.info {
  border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Spinner */
#spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav {
    justify-content: center;
  }
  
  .row {
    flex-direction: column;
  }
  
  .container {
    padding: 0 0.5rem;
  }
}

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

/* Result cards */
.results-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

.result-card {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  background: white;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.result-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.result-header {
  padding: 1rem 1.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f3f4;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.4;
}

.result-rank {
  background: #0066cc;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 1rem;
}

.result-body {
  padding: 1rem 1.5rem;
}

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

.result-badge {
  text-align: center;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
  border: 1px solid #e9ecef;
}

.badge-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
}

.badge-value {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  display: block;
}

.voucher-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  justify-content: center;
}

.badge-voucher {
  background: #28a745;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.result-explanation {
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #0369a1;
  line-height: 1.5;
}

.result-footer {
  padding: 0.75rem 1.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid #f1f3f4;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.no-results h3 {
  color: #333;
  margin-bottom: 0.5rem;
}

.results-footnote {
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  text-align: center;
  color: #6c757d;
}

.results-footnote small {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Responsive adjustments for result cards */
@media (max-width: 768px) {
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .result-rank {
    margin-left: 0;
    align-self: flex-start;
  }
  
  .result-badges {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .voucher-badges {
    justify-content: flex-start;
  }
}

/* Centralized voucher badge styles */
.voucher-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  margin: 0.125rem;
}

.voucher-info-badge.ba-companion {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #3b82f6;
}

.voucher-info-badge.ba-upgrade {
  background-color: #e0e7ff;
  color: #4338ca;
  border-color: #6366f1;
}

.voucher-info-badge.virgin-companion {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #ef4444;
}

.voucher-info-badge.virgin-upgrade {
  background-color: #fed7aa;
  color: #ea580c;
  border-color: #f97316;
}

.voucher-info-badge.not-applied {
  background-color: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.voucher-info-icon {
  font-size: 0.875rem;
}

.cabin-transition {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.125rem 0.375rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.375rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.cabin-arrow {
  margin: 0 0.25rem;
  color: #059669;
  font-weight: 600;
}

.voucher-breakdown {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background-color: #f8fafc;
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
}

.voucher-breakdown-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.voucher-breakdown-details {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.4;
}

.voucher-comparison {
  margin: 0.5rem 0;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.comparison-row:last-child {
  border-bottom: none;
}

.comparison-row .label {
  font-weight: 500;
  color: #374151;
}

.comparison-row .value {
  font-weight: 600;
  color: #1e293b;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.voucher-note {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #1e40af;
  text-align: center;
  font-style: italic;
}

@media (max-width: 768px) {
  .voucher-info-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .cabin-transition {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    margin-left: 0.25rem;
  }
  
  .voucher-breakdown {
    padding: 0.5rem;
    margin-top: 0.5rem;
  }
}
/* Upgrade Banner */
.upgrade-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.upgrade-banner button {
  background: white;
  color: #667eea;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.upgrade-banner button:hover {
  opacity: 0.9;
}

/* Upgrade Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal h2 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.modal-benefits {
  margin: 0 0 1.5rem 0;
  color: #666;
  font-size: 0.95rem;
}

.pricing-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.pricing-options .btn {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 640px) {
  .upgrade-banner {
    text-align: center;
    justify-content: center;
  }
  
  .pricing-options {
    flex-direction: column;
  }
  
  .pricing-options .btn {
    width: 100%;
  }
}
