/* CSS Variables for Design System */
:root {
  /* Color System */
  --ocean-blue-500: #0077B6;
  --ocean-blue-700: #005A8D;
  --ocean-blue-100: #E6F2F8;
  --neutral-900: #1F2937;
  --neutral-600: #6B7280;
  --neutral-200: #E5E7EB;
  --neutral-100: #FFFFFF;
  --neutral-50: #F8F9FA;
  --terracotta-500: #E57373;
  --lush-green-500: #4CAF50;
  --error-500: #EF4444;

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-xxxl: 96px;

  /* Layout */
  --max-width: 1280px;
  --border-radius-card: 16px;
  --border-radius-button: 8px;

  /* Shadows */
  --shadow-card: 0 4px 12px rgba(31, 41, 55, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(0, 119, 182, 0.12);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--neutral-900);
  background-color: var(--neutral-50);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--space-xxxl) 0 var(--space-xxl);
  background: linear-gradient(135deg, var(--ocean-blue-500) 0%, var(--ocean-blue-700) 100%);
  color: var(--neutral-100);
  margin: 0 calc(-1 * var(--space-sm));
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: 20px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
}

.tab-button {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  color: var(--neutral-600);
  background: transparent;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  position: relative;
  border-radius: var(--border-radius-button);
}

.tab-button:hover {
  color: var(--neutral-900);
  background-color: var(--ocean-blue-100);
}

.tab-button.active {
  color: var(--ocean-blue-500);
  background-color: var(--ocean-blue-100);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background-color: var(--ocean-blue-500);
  border-radius: 1px;
}

/* Tab Content */
.tab-content {
  padding-bottom: var(--space-xxxl);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--neutral-900);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.section-description {
  font-size: 18px;
  color: var(--neutral-600);
  text-align: center;
  margin-bottom: var(--space-xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Subsection Styling */
.subsection {
  margin-top: var(--space-xxl);
}

.subsection h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: var(--space-lg);
  text-align: center;
  border-bottom: 2px solid var(--ocean-blue-500);
  padding-bottom: var(--space-sm);
}

/* Destinations Grid */
.destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* Analytics Summary */
.analytics-summary {
  background: linear-gradient(135deg, var(--ocean-blue-100) 0%, var(--neutral-100) 100%);
  border: 2px solid var(--ocean-blue-500);
  border-radius: var(--border-radius-card);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease-in-out;
}

.analytics-summary.active {
  background: linear-gradient(135deg, var(--ocean-blue-500) 0%, var(--ocean-blue-700) 100%);
  color: var(--neutral-100);
}

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

.analytics-summary h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: var(--space-sm);
}

.analytics-summary.active h3 {
  color: var(--neutral-100);
}

.analytics-summary p {
  font-size: 16px;
  color: var(--neutral-600);
  margin-bottom: var(--space-lg);
}

.analytics-summary.active p {
  color: rgba(255, 255, 255, 0.9);
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.stat {
  background: var(--neutral-100);
  border-radius: var(--border-radius-button);
  padding: var(--space-md);
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.1);
}

.analytics-summary.active .stat {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--terracotta-500);
  line-height: 1;
}

.analytics-summary.active .stat-number {
  color: var(--neutral-100);
}

.stat-label {
  display: block;
  font-size: 14px;
  color: var(--neutral-600);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-summary.active .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

.itinerary-suggestion {
  background: var(--neutral-100);
  border-radius: var(--border-radius-button);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border-left: 4px solid var(--ocean-blue-500);
}

.analytics-summary.active .itinerary-suggestion {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-left-color: var(--neutral-100);
}

.itinerary-suggestion h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: var(--space-sm);
}

.analytics-summary.active .itinerary-suggestion h4 {
  color: var(--neutral-100);
}

.itinerary-suggestion p {
  color: var(--neutral-700);
  font-size: 16px;
  line-height: 1.6;
}

.analytics-summary.active .itinerary-suggestion p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.analytics-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.btn-clear, .btn-export {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--border-radius-button);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-clear {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

.btn-clear:hover {
  background: var(--neutral-300);
  transform: translateY(-2px);
}

.btn-export {
  background: var(--ocean-blue-500);
  color: var(--neutral-100);
}

.btn-export:hover {
  background: var(--ocean-blue-700);
  transform: translateY(-2px);
}

.analytics-summary.active .btn-clear {
  background: rgba(255, 255, 255, 0.2);
  color: var(--neutral-100);
}

.analytics-summary.active .btn-clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Destination Cards with Selection */
.destination-card {
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  border-radius: var(--border-radius-card);
  padding: var(--space-lg);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.destination-card.selected {
  border-color: var(--ocean-blue-500);
  box-shadow: 0 4px 20px rgba(0, 119, 182, 0.2);
  background: linear-gradient(135deg, var(--neutral-100) 0%, var(--ocean-blue-50) 100%);
}

.destination-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
}

/* Selection Checkbox */
.card-selection {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 10;
}

.destination-checkbox {
  display: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--neutral-600);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-button);
  background: var(--neutral-50);
  transition: all 0.3s ease;
  user-select: none;
}

.checkbox-label:hover {
  background: var(--ocean-blue-100);
  color: var(--ocean-blue-700);
}

.destination-checkbox:checked + .checkbox-label {
  background: var(--ocean-blue-500);
  color: var(--neutral-100);
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--neutral-300);
  border-radius: 3px;
  background: var(--neutral-100);
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 1px;
  font-size: 12px;
  color: var(--neutral-100);
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.destination-checkbox:checked + .checkbox-label .checkbox-custom {
  background: var(--ocean-blue-500);
  border-color: var(--ocean-blue-500);
}

.destination-checkbox:checked + .checkbox-label .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

/* Adjust card header to accommodate selection */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg); /* Space for checkbox */
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--neutral-900);
}

.region-icon {
  font-size: 32px;
  opacity: 0.8;
}

.visa-info {
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  background: var(--ocean-blue-100);
  border-radius: var(--border-radius-button);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visa-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 500;
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.visa-duration {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--terracotta-500);
}

.card-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--neutral-900);
  margin-bottom: var(--space-md);
}

.itinerary-preview {
  font-size: 14px;
  color: var(--neutral-600);
  font-style: italic;
  border-top: 1px solid var(--neutral-200);
  padding-top: var(--space-sm);
}

.itinerary-preview strong {
  font-style: normal;
  color: var(--ocean-blue-500);
}

/* Special styling for unlimited stay */
.visa-duration.unlimited {
  color: var(--lush-green-500);
  font-size: 18px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .destinations-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-sm);
  }

  .hero h1 {
    font-size: 36px;
  }

  .tab-panel h2 {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-sm);
  }

  .hero {
    padding: var(--space-xxl) 0;
    margin: 0 calc(-1 * var(--space-sm));
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .tab-navigation {
    gap: var(--space-xs);
  }

  .tab-button {
    padding: var(--space-sm) var(--space-md);
    font-size: 14px;
  }

  .destinations-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .destination-card {
    padding: var(--space-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .region-icon {
    align-self: flex-end;
  }

  .visa-info {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .tab-panel h2 {
    font-size: 24px;
  }

  .section-description {
    font-size: 16px;
  }

  .subsection h3 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .destination-card h3 {
    font-size: 20px;
  }

  .visa-duration {
    font-size: 18px;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .destination-card,
  .tab-button {
    transition: none;
  }

  .tab-panel {
    animation: none;
  }

  .destination-card:hover {
    transform: none;
  }
}

/* Focus styles for keyboard navigation */
.tab-button:focus {
  outline: 2px solid var(--ocean-blue-500);
  outline-offset: 2px;
}

.destination-card:focus {
  outline: 2px solid var(--ocean-blue-500);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .tab-navigation {
    display: none;
  }

  .tab-panel {
    display: block !important;
    page-break-before: always;
  }

  .destination-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--neutral-200);
  }
}