/* Page-specific styles */

/* Page Header */
.page-header {
  padding: var(--space-xl) 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb {
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-red);
}

.breadcrumb-separator {
  margin: 0 var(--space-sm);
  color: var(--text-muted);
}

.page-title {
  font-size: var(--font-size-5xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-family: 'Crimson Text', Georgia, serif;
}

.page-description {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0;
}

/* Policy Sections */
.policy-section {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border-light);
}

.policy-section:last-child {
  border-bottom: none;
}

.policy-section.featured {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.policy-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xl);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.policy-header.no-icon {
  grid-template-columns: 1fr;
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0 0;
}

.bullet-list li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-red);
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.data-table th,
.data-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  min-width: 400px;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.region-block {
  margin-bottom: var(--space-xl);
}

.region-block h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.region-block p {
  color: var(--text-secondary);
  margin: 0;
}

.country-policy-controls {
  margin-bottom: var(--space-lg);
  max-width: 320px;
}

.country-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

.country-select {
  position: relative;
  width: 100%;
}

.country-select-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.country-select-toggle:hover,
.country-select-toggle:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(199, 62, 58, 0.1);
}

.country-select-toggle:focus {
  outline: none;
}

.country-select.open .country-select-toggle {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(199, 62, 58, 0.1);
}

.country-select-toggle.is-placeholder .country-select-label {
  color: var(--text-muted);
}

.country-select-flag {
  justify-self: start;
}

.country-select-flag.placeholder {
  border-style: dashed;
  background: transparent;
}

.country-select-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.country-select.open .country-select-icon {
  transform: rotate(180deg);
}

.country-select-options {
  position: absolute;
  top: calc(100% + var(--space-xs));
  left: 0;
  right: 0;
  z-index: 40;
  list-style: none;
  margin: 0;
  padding: var(--space-xs) 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.country-select.open .country-select-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.country-select-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background 0.15s ease, color 0.15s ease;
}

.country-select-option.placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.country-select-option:hover,
.country-select-option:focus {
  background: var(--bg-secondary);
  outline: none;
}

.country-select-option.selected {
  background: rgba(199, 62, 58, 0.1);
  color: var(--primary-red);
}

.country-select-option.selected .country-option-label {
  font-weight: 600;
}

.country-select-option .country-option-label {
  flex: 1;
}

.country-option-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.country-option-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.country-option-flag.placeholder {
  border: 1px dashed var(--border-light);
  background: transparent;
}

/* Smaller flag icon for options */
.country-flag-icon.country-flag-icon--sm {
  width: 20px;
  height: 14px;
}

.policy-result {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
}

.policy-result.empty {
  color: var(--text-muted);
  font-style: italic;
}

.selected-country {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.selected-country-flag,
.modal-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selected-country-flag .country-flag-icon,
.modal-country-flag .country-flag-icon {
  width: 32px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.modal-country-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 0;
}

.modal-country-flag + .modal-country-name {
  margin-left: var(--space-sm);
}

.selected-country-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.policy-table-wrapper {
  margin-top: var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.policy-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-lg);
}

.policy-result-table thead th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: var(--space-lg) var(--space-xl);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: var(--font-size-sm);
}

.policy-result-table tbody td {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-secondary);
}

.policy-result-table thead th:nth-child(2),
.policy-result-table tbody td:nth-child(2) {
  width: 160px;
  white-space: nowrap;
}

.policy-result-table thead th:nth-child(1),
.policy-result-table tbody td:nth-child(1) {
  /* width: 400px; */
  max-width: 480px;
}

.policy-result-table thead th:nth-child(3),
.policy-result-table tbody td:nth-child(3) {
  width: auto;
}

.policy-result-table tbody tr:first-child td {
  border-top: none;
}

.policy-row-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.policy-row-region {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
}

/* Keep policy name on one line to cap column by policy name length */
.policy-row-policy {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* removed subtitle style (reverted) */

.policy-row-description {
  margin-top: var(--space-md);
  font-size: var(--font-size-base);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Policy table links: keep neutral color with underline (override global link red) */
.policy-link,
.policy-link:visited,
.policy-link:hover,
.policy-link:active {
  color: inherit;
  text-decoration: underline;
}

.policy-stay-value {
  display: inline-block;
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--primary-red);
}

.policy-notes {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

.policy-no-notes {
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

.policy-icon-large {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-4xl);
  box-shadow: var(--shadow-lg);
}

.policy-header-content h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.policy-header-content p {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.policy-stats {
  display: flex;
  gap: var(--space-xl);
}

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

.stat-number {
  display: block;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--primary-red);
  font-family: 'Crimson Text', Georgia, serif;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.policy-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* Policy Explanation */
.policy-explanation h3 {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.policy-explanation p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.requirement-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  border-left: 4px solid var(--primary-red);
}

.requirement-card h4 {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.requirement-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.requirement-card li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.requirement-card li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-red);
  font-weight: 700;
}

/* Countries Showcase */
.countries-showcase {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
}

.countries-showcase h3 {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

/* Update Timeline */
.update-timeline {
  position: relative;
  padding-left: var(--space-lg);
}

.update-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-medium);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-red);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--border-light);
}

.timeline-date {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary-red);
  margin-bottom: var(--space-sm);
}

.timeline-content h4 {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.timeline-content p {
  color: var(--text-secondary);
  margin: 0;
}

/* Transit Map */
.transit-map {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
}

.city-clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.cluster-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.cluster-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.cluster-card h4 {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.cluster-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.airports {
  background: var(--primary-red);
  color: var(--bg-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.regions {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Transit Requirements */
.transit-requirements {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
}

.requirement-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.step-card {
  text-align: center;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary-red);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0 auto var(--space-md);
}

.step-card h4 {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.step-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  margin-top: var(--space-xl);
}

.cta-section h3 {
  color: var(--bg-primary);
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: var(--bg-primary);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  opacity: 0.9;
}

.cta-section .btn {
  background: var(--bg-primary);
  color: var(--primary-red);
  font-weight: 600;
}

.cta-section .btn:hover {
  background: var(--bg-secondary);
  color: var(--primary-red);
}

/* Special Policies */
.special-policies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-lg);
}

.special-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all 0.3s ease;
}

.special-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-red);
}

.special-card h3 {
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.special-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.special-details {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.detail-tag {
  background: var(--bg-accent);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Navigation Active State */
.nav-menu .active {
  color: var(--primary-red);
  background-color: rgba(199, 62, 58, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-title {
    font-size: var(--font-size-4xl);
  }

  .policy-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }

  .policy-icon-large {
    margin: 0 auto;
  }

  .policy-stats {
    justify-content: center;
  }

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

  .city-clusters {
    grid-template-columns: 1fr;
  }

  .requirement-steps {
    grid-template-columns: 1fr;
  }

  .special-policies {
    grid-template-columns: 1fr;
  }

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

  .transit-map,
  .transit-requirements {
    padding: var(--space-lg);
  }

  .cta-section {
    padding: var(--space-xl);
  }

  /* Hide desktop Notes column; use mobile toggle instead */
  .policy-result-table thead th:nth-child(3),
  .policy-result-table tbody td:nth-child(3) {
    display: none;
  }
  .mobile-notes-toggle {
    margin-top: var(--space-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
  }
  .mobile-notes-content {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: 1px dashed var(--border-light);
  }
}
