/* =====================================================
   Global Performance Variables
   ===================================================== */
:root {
  /* Cards */
  --card-bg-light: #ffffffee;
  --card-bg-dark: rgba(15, 23, 42, 0.96);
  --card-radius: 18px;

  /* Shadows */
  --card-shadow-desktop: 0 18px 40px rgba(15, 23, 42, 0.12);
  --card-shadow-dark: 0 18px 40px rgba(0, 0, 0, 0.8);

  --city-shadow-desktop: 0 10px 26px rgba(15,23,42,0.08);
  --city-shadow-hover: 0 14px 34px rgba(15,23,42,0.14);
  --city-shadow-mobile: 0 4px 10px rgba(0,0,0,0.08);

  /* Blur */
  --card-blur-desktop: 14px;
}

/* =====================================================
   Layout: Hero / Main
   ===================================================== */

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* =====================================================
   Card
   ===================================================== */

.card {
  background: var(--card-bg-light);
  border-radius: var(--card-radius);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--card-shadow-desktop);
  padding: 18px 20px;
  backdrop-filter: blur(var(--card-blur-desktop));
}

body.dark-mode .card {
  background: var(--card-bg-dark);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: var(--card-shadow-dark);
}

/* =====================================================
   Info Block
   ===================================================== */

.info-block {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* =====================================================
   Country Title
   ===================================================== */

.country-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  color: #0f172a;
}

body.dark-mode .title-main {
  color: #e5e7eb;
}

.tz-small {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
}

body.dark-mode .tz-small {
  color: #9ca3af;
}

/* Flag – base */
.flag-inline-title {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* Flag – India title (premium) */
.country-title .flag-inline-title {
  height: 1.1em;
  width: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

/* =====================================================
   Main Clock Row
   ===================================================== */

.main-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* UTC pill (desktop = compact) */
.utc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body.dark-mode .utc-row {
  background: rgba(37, 99, 235, 0.12);
}

.clock-time {
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.clock-tz {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
}

body.dark-mode .clock-tz {
  color: #9ca3af;
}

/* =====================================================
   Big Country Clock
   ===================================================== */

.country-big-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
  margin-top: 8px;
  border-radius: 20px;
  background: radial-gradient(
    circle at top,
    rgba(37, 99, 235, 0.18),
    transparent 65%
  );
}

.above-clock {
  text-align: center;
  margin-top: 6px;
  margin-bottom: 6px;
}

.country-time-value {
  font-size: clamp(3rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

body.dark-mode .country-time-value {
  color: #e5e7eb;
}

.country-time-label {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #6b7280;
}

body.dark-mode .country-time-label {
  color: #9ca3af;
}

/* =====================================================
   Meta Row
   ===================================================== */

.meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 16px;
}

.meta {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #4b5563;
  padding: 8px 10px;
  background: rgba(241, 245, 249, 0.9);
  border-left: 3px solid rgba(148, 163, 184, 0.6);
  border-radius: 0 10px 10px 0;
}

body.dark-mode .meta {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.7);
}

/* =====================================================
   Section Titles
   ===================================================== */

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 12px 0 10px;
  color: #0f172a;
}

body.dark-mode .section-title {
  color: #e5e7eb;
}

/* =====================================================
   SEO Text Links (Popular Searches)
   ===================================================== */

.seo-text a {
  color: #2563eb;                 /* light mode blue */
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.seo-text a:hover {
  color: #1d4ed8;
  text-decoration-thickness: 2px;
}

/* Dark mode */
body.dark-mode .seo-text a {
  color: #93c5fd;                 /* soft readable blue */
}

body.dark-mode .seo-text a:hover {
  color: #60a5fa;
}

/* =====================================================
   Cities – India & World (Premium Cards)
   ===================================================== */

.cities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.city-card {
  padding: 14px 14px 12px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.14), transparent 55%),
    rgba(255,255,255,0.96);
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: var(--city-shadow-desktop);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .12s ease, box-shadow .12s ease;
}

@media (hover:hover) {
  .city-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--city-shadow-hover);
  }
}

.city-name {
  font-size: .95rem;
  font-weight: 600;
  color: #0f172a;
}

.city-time {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.city-offset {
  font-size: .8rem;
  color: #6b7280;
}

/* Dark mode */
body.dark-mode .city-card {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.22), transparent 55%),
    var(--card-bg-dark);
  border-color: rgba(148,163,184,0.25);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

body.dark-mode .city-name { color:#e5e7eb; }
body.dark-mode .city-time { color:#f9fafb; }
body.dark-mode .city-offset { color:#9ca3af; }

/* =====================================================
   States / UTs
   ===================================================== */

.states-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.division-link {
  display: inline-flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
  text-decoration: none;
  background: #f9fafb;
  color: #4b5563;
  border: 1px solid rgba(148,163,184,0.4);
}

.division-link::after {
  content: "→";
  opacity: .7;
}

.division-link:hover {
  background: rgba(37,99,235,0.06);
  border-color: #2563eb;
  color: #111827;
}

/* =====================================================
   Explore States & UTs – Dark Mode Fix
   ===================================================== */

/* Card background already handled by .card, no change needed */

/* State links */
body.dark-mode .division-link {
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.45);
}

/* Arrow color inherit */
body.dark-mode .division-link::after {
  color: #9ca3af;
}

/* Hover state (important for UX) */
body.dark-mode .division-link:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: #60a5fa;
  color: #f9fafb;
}

/* =====================================================
   Converter + States Wrapper
   ===================================================== */

.converter-countries-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* =====================================================
   Time Converter – US Style (India Page)
   ===================================================== */

.converter {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.converter .section-title {
  margin-bottom: 4px;
}

/* Inputs row */
.converter .row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr;
  gap: 8px;
}

/* Select & input */
.converter select,
.converter input[type="datetime-local"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: #f9fafb;
  color: #111827;
  font-size: 0.9rem;
  outline: none;
  appearance: none;
}

.converter select:focus,
.converter input[type="datetime-local"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Dark mode */
body.dark-mode .converter select,
body.dark-mode .converter input[type="datetime-local"] {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.5);
}

/* Action buttons row */
.convert-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Base CTA */
.cta {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #2563eb;
  color: #f9fafb;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.45);
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.1s ease;
}

.cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.45);
}

/* Convert button – outlined (US style) */
#convert-btn {
  background: transparent !important;
  color: #2563eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: none;
}

#convert-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
}

body.dark-mode #convert-btn {
  color: #93c5fd;
  border-color: rgba(148, 163, 184, 0.6);
}

body.dark-mode #convert-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  color: #e5f0ff;
}

/* Swap button */
.swap-btn {
  flex: 0 0 auto;
  width: 40px;
  padding-inline: 0;
  font-size: 1.1rem;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: none;
}

.swap-icon {
  color: #2563eb;
}

.swap-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: #2563eb;
}

.swap-btn:hover .swap-icon {
  color: #1d4ed8;
}

body.dark-mode .swap-btn {
  border-color: rgba(148, 163, 184, 0.6);
}

body.dark-mode .swap-icon {
  color: #93c5fd;
}

/* Result box */
#convert-result-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

body.dark-mode #convert-result-box {
  background: rgba(15, 23, 42, 0.95);
}

#convert-result {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Info text */
.info-text {
  font-size: 0.82rem;
  color: #6b7280;
}

body.dark-mode .info-text {
  color: #9ca3af;
}

/* Mobile */
@media (max-width: 960px) {
  .converter .row {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   Back Button
   ===================================================== */

.back-home-wrapper {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 16px;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  text-decoration: none;
  font-size: .9rem;
  color: #6b7280;
  background: #f9fafb;
}

body.dark-mode .back-home-button {
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.45);
}

body.dark-mode .back-home-button:hover {
  background: rgba(37, 99, 235, 0.12);  
  border-color: rgba(96, 165, 250, 0.6); 
  color: #e5e7eb;   
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 960px) {
  .main-clock {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {

  .country-big-clock { background: none; }
  .country-title .flag-inline-title { height: 1em; }

  .utc-row {
    justify-content: space-between;
    max-width: 320px;
    margin: 6px auto 0;
  }

  .country-time-value {
    font-size: 2.8rem;
    letter-spacing: .04em;
  }

  .cities { grid-template-columns: 1fr; }
  .city-time { font-size: 1.25rem; }

  .city-card {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(148,163,184,0.3) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }

  body.dark-mode .city-card {
    background: #0f172a !important;
    border-color: rgba(148,163,184,0.25) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
  }

  .card {
    backdrop-filter: none !important;
  }
  
  .title-main{
    align-items: flex-start;   /* flag top align */
  }

  .country-title .flag-inline-title{
    align-self: flex-start;
    margin-top: 6px;
  }
}