/* UK TRUE SOLAR TIME - Modern Oriental Luxury Theme & Tu Vi Font System */
:root {
  --primary-burgundy: #6E0E0A;
  --burgundy-light: #8B1A16;
  --burgundy-dark: #4A0808;
  --royal-navy: #1B365D;
  --navy-light: #2c4d7e;
  --navy-dark: #0f2038;
  --warm-cream: #F5EFE6;
  --cream-card: #FFFDF7;
  --gold-accent: #C9A24A;
  --gold-soft: #E6CB85;
  --gold-hover: #D4AF37;
  --slate-dark: #1C1410;
  --slate-muted: #5B4636;
  --border-light: #D8C79B;
  --shadow-sm: 0 4px 6px -1px rgba(60, 40, 10, 0.05);
  --shadow-md: 0 10px 20px -3px rgba(60, 40, 10, 0.08);
  --shadow-lg: 0 14px 34px rgba(60, 40, 10, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-body: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Noto Serif", Georgia, serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--warm-cream);
  color: var(--slate-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Internal Navigation & Breadcrumb Links */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  color: var(--slate-muted);
  background: rgba(255, 253, 247, 0.8);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.breadcrumb-nav a {
  color: var(--primary-burgundy);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-nav a:hover {
  color: var(--gold-accent);
  text-decoration: underline;
}

.breadcrumb-nav .sep {
  color: var(--border-light);
}

.breadcrumb-nav .current {
  color: var(--navy-dark);
  font-weight: 700;
}

.btn-secondary-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #FFF5E5;
  color: var(--primary-burgundy);
  border: 1.5px solid var(--gold-accent);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.98rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
}

.btn-secondary-home:hover {
  background: var(--primary-burgundy);
  color: #FFFFFF;
  border-color: var(--primary-burgundy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Header & Nav */
.header-hero {
  background: linear-gradient(135deg, var(--burgundy-dark) 0%, var(--primary-burgundy) 55%, #2a0404 100%);
  color: white;
  padding: 3.5rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border-bottom: 2px solid var(--gold-accent);
}

.header-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(201,162,74,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.brand-tagline {
  color: var(--gold-accent);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  color: #FFFFFF;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.hero-subtitle {
  font-size: 1.12rem;
  max-width: 820px;
  margin: 0 auto 1.5rem;
  color: #F5EFE6;
  font-weight: 400;
  line-height: 1.65;
}

/* Main Container */
.container {
  max-width: 1240px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 10;
}

/* Engine Grid Layout - Centered by default on Desktop before calculation */
.engine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 720px;
  margin: 0 auto;
  transition: max-width 0.4s ease;
}

.engine-grid.has-results {
  grid-template-columns: 1fr 1fr;
  max-width: 1240px;
}

@media (max-width: 992px) {
  .engine-grid, .engine-grid.has-results {
    grid-template-columns: 1fr;
    max-width: 720px;
  }
}

.card {
  background: var(--cream-card);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--primary-burgundy);
  position: relative;
  width: 100%;
}

.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-accent);
  border-radius: 11px;
  pointer-events: none;
}

.card > * {
  position: relative;
}

.card-title {
  font-family: var(--font-serif);
  color: var(--primary-burgundy);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--gold-accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
  color: #3A2D20;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--slate-dark);
  background-color: #FFFFFF;
  transition: all 0.2s ease;
  outline: none;
}

.form-select:focus, .form-input:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.22);
}

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

.form-row.three {
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 0.5rem;
}

.btn-primary {
  width: 100%;
  background: var(--primary-burgundy);
  color: white;
  border: 1.5px solid var(--primary-burgundy);
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(110,14,10,0.25);
  margin-top: 1rem;
}

.btn-primary:hover {
  background: var(--burgundy-dark);
  border-color: var(--burgundy-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(110,14,10,0.35);
}

/* Output Cards & Badges */
.result-badge-card {
  background: linear-gradient(180deg, #FFFDF9 0%, #FFF5E5 100%);
  border: 2px solid var(--gold-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.result-can-chi {
  font-family: var(--font-serif);
  font-size: 2.85rem;
  font-weight: 700;
  color: var(--primary-burgundy);
  letter-spacing: 1px;
}

.result-chi-only {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--royal-navy);
  margin-top: 0.25rem;
  font-family: var(--font-body);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-box {
  background-color: #FDF9F0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--royal-navy);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.info-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--slate-muted);
  font-weight: 600;
}

.info-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-dark);
  font-family: var(--font-serif);
}

/* Sundial Widget */
.sundial-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  width: 100%;
}

.sundial-svg {
  width: 100%;
  max-width: 230px;
  height: auto;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background-color: white;
}

.data-table th {
  background-color: var(--primary-burgundy);
  color: white;
  padding: 0.8rem;
  text-align: center;
  font-weight: 600;
  font-family: var(--font-body);
}

.data-table td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.data-table tr:nth-child(even) {
  background-color: #FFFDF9;
}

.data-table tr.highlight-row {
  background-color: #FDF0EC;
  font-weight: bold;
  color: var(--primary-burgundy);
}

/* Country Grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.country-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--slate-dark);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.country-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-accent);
  background: #FFFDF7;
}

.country-flag {
  font-size: 2rem;
}

.country-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-burgundy);
  font-family: var(--font-serif);
}

.country-info p {
  font-size: 0.8rem;
  color: var(--slate-muted);
}

/* MOBILE OPTIMIZATION - EXPAND CARD HORIZONTAL WIDTH & CLEAN SINGLE-ROW DROPDOWNS */
@media (max-width: 768px) {
  .header-hero {
    padding: 2.25rem 1rem 3rem;
  }

  .hero-title {
    font-size: 2.05rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .container {
    padding: 0 0.4rem;
    margin: 1.25rem auto 3rem;
  }

  .card {
    padding: 1.5rem 0.85rem;
    border-radius: 12px;
  }

  .card::before {
    inset: 4px;
    border-radius: 9px;
  }

  .card-title {
    font-size: 1.35rem;
    margin-bottom: 1.1rem;
  }

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

  .form-select, .form-input {
    padding: 0.75rem 0.5rem;
    font-size: 0.92rem;
  }

  .form-row.three {
    grid-template-columns: 1fr 1fr 1.05fr;
    gap: 0.35rem;
  }

  .form-row.three .form-select {
    padding: 0.75rem 0.25rem;
    font-size: 0.88rem;
    text-align: center;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .breadcrumb-nav {
    font-size: 0.84rem;
    padding: 0.5rem 0.75rem;
  }
}
