/*
Theme Name: WorldTimeTool
Theme URI: https://www.worldtimetool.com
Author: WorldTimeTool
Author URI: https://www.worldtimetool.com
Description: Ultra-fast, lightweight, SEO-optimized custom theme for WorldTimeTool. Built for instant conversions, live clocks, and complete multilingual support.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: worldtimetool
*/

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* Spacing */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-7: 1.75rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;

  /* Typography */
  --font-family-base: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-family-heading: 'Space Grotesk', sans-serif;
  --font-family-monospace: 'JetBrains Mono', monospace;

  /* Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Light Theme (Default) */
  --background: hsl(210 20% 98%);
  --foreground: hsl(220 40% 10%);
  --surface: #ffffff;
  --surface-foreground: hsl(220 40% 15%);
  --card: #ffffff;
  --card-foreground: hsl(220 40% 15%);
  --primary: hsl(245 80% 60%);
  --primary-foreground: #ffffff;
  --secondary: hsl(170 70% 40%);
  --secondary-foreground: #ffffff;
  --accent: hsl(35 90% 55%);
  --accent-foreground: hsl(35 10% 10%);
  --muted: hsl(220 15% 92%);
  --muted-foreground: hsl(220 10% 50%);
  --border: hsl(220 15% 90%);
  --hero-bg: #0f1b33;
  --hero-border: #24365a;
  --hero-top-line: #6c7cff;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --animation-fast: 150ms ease;
  --animation-normal: 250ms ease;
}

html.dark {
  --background: hsl(230 25% 8%);
  --foreground: hsl(210 20% 90%);
  --surface: hsl(230 20% 12%);
  --surface-foreground: hsl(210 20% 95%);
  --card: hsl(230 20% 14%);
  --card-foreground: hsl(210 20% 95%);
  --primary: hsl(245 70% 65%);
  --primary-foreground: #ffffff;
  --secondary: hsl(160 50% 50%);
  --secondary-foreground: #ffffff;
  --accent: hsl(35 90% 60%);
  --accent-foreground: hsl(35 10% 10%);
  --muted: hsl(230 20% 20%);
  --muted-foreground: hsl(230 10% 60%);
  --border: hsl(230 20% 20%);
  --hero-bg: #16233f;
  --hero-border: hsl(230 20% 25%);
  --hero-top-line: #6c7cff;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  margin-top: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}
html[dir="rtl"] .ml-auto {
  margin-left: unset;
  margin-right: auto;
}
html[dir="rtl"] .mr-auto {
  margin-right: unset;
  margin-left: auto;
}

/* Layout */
.wtt-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wtt-main {
  flex: 1;
  width: 100%;
}

.wtt-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.wtt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  transition: background-color var(--animation-fast);
}

html.dark .wtt-header {
  background-color: rgba(10, 10, 15, 0.85);
  border-bottom-color: var(--border);
}

.wtt-header-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Mobile Menu Toggle Button (Left on mobile) */
.wtt-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  z-index: 10;
  order: 0;
  transition: background-color var(--animation-fast);
}

.wtt-mobile-toggle:hover {
  background-color: var(--muted);
}

/* Logo Section (Centered on mobile, left on desktop) */
.wtt-logo-section {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.wtt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wtt-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* Desktop Navigation (Centered between logo and right actions) */
.wtt-desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

@media (min-width: 768px) {
  .wtt-mobile-toggle {
    display: none;
  }

  .wtt-logo-section {
    position: static;
    transform: none;
    order: 0;
  }

  .wtt-desktop-nav {
    display: flex;
    order: 1;
    margin: 0 auto;
  }

  .wtt-header-right {
    order: 2;
  }
}

/* Nav Link Styling */
.wtt-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-family: var(--font-family-base);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  line-height: 1;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.wtt-nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.wtt-nav-link:hover {
  color: var(--foreground);
  background-color: var(--muted);
}

.wtt-nav-link:hover svg {
  opacity: 1;
}

.wtt-nav-link.active {
  color: var(--primary);
  background-color: color-mix(in srgb, var(--primary) 12%, transparent);
  font-weight: 600;
}

.wtt-nav-link.active svg {
  opacity: 1;
  color: var(--primary);
}

html.dark .wtt-nav-link.active {
  background-color: color-mix(in srgb, var(--primary) 18%, transparent);
  color: hsl(245 80% 70%);
}

html.dark .wtt-nav-link:hover {
  background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
  color: #ffffff;
}

/* Right Header Controls */
.wtt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Switcher */
.wtt-theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--animation-fast);
}

.wtt-theme-toggle:hover {
  background-color: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}

/* Language Selector */
.wtt-lang-select-wrapper {
  position: relative;
}

.wtt-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-lang-btn:hover {
  border-color: var(--primary);
  background-color: var(--muted);
}

.wtt-lang-btn-text {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 3-Column Grid Language Dropdown */
.wtt-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(26rem, calc(100vh - 5rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  z-index: 200;
}

@media (max-width: 640px) {
  .wtt-lang-dropdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100vw - 2rem);
    right: -10px;
  }
}

html[dir="rtl"] .wtt-lang-dropdown {
  right: auto;
  left: 0;
}

.wtt-lang-dropdown.open {
  display: grid;
}

.wtt-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--foreground);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background-color var(--animation-fast);
}

.wtt-lang-item:hover {
  background-color: var(--muted);
}

.wtt-lang-item.active {
  background-color: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 600;
}

.wtt-lang-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wtt-lang-code {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-family: var(--font-family-monospace);
}

.wtt-lang-item.active .wtt-lang-code {
  color: var(--primary);
}

/* Mobile Navigation Drawer */
.wtt-mobile-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  z-index: 99;
  padding: 1.5rem 1.25rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.wtt-mobile-drawer.open {
  display: flex;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wtt-mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wtt-mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--animation-fast);
}

.wtt-mobile-nav-link svg {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.wtt-mobile-nav-link:hover,
.wtt-mobile-nav-link.active {
  background-color: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.wtt-mobile-nav-link:hover svg,
.wtt-mobile-nav-link.active svg {
  color: var(--primary);
}

.wtt-mobile-controls {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wtt-mobile-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wtt-mobile-tool-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--foreground);
}

.wtt-mobile-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.wtt-mobile-lang-pill {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  text-align: center;
  color: var(--foreground);
  text-decoration: none;
  transition: all var(--animation-fast);
}

.wtt-mobile-lang-pill:hover {
  background-color: var(--muted);
}

.wtt-mobile-lang-pill.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
}

/* ==========================================================================
   Hero Live Clock Card
   ========================================================================== */
.wtt-hero-clock-card {
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-top: 3px solid var(--hero-top-line);
  border-radius: var(--radius-lg);
  padding: var(--spacing-8);
  color: #ffffff;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-8);
}

.wtt-hero-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-3);
}

.wtt-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.wtt-pulsing-dot {
  width: 7px;
  height: 7px;
  background-color: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
  animation: wtt-pulse 1.8s infinite;
}

@keyframes wtt-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.wtt-hero-date {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
  font-weight: 500;
}

.wtt-hero-time {
  font-family: var(--font-family-monospace);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: var(--spacing-2) 0;
}

.wtt-hero-seconds {
  font-size: 0.55em;
  opacity: 0.8;
  margin-left: 4px;
}

.wtt-hero-location {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
}

.wtt-hero-location a {
  color: #a5b4ff;
  font-weight: 600;
  text-decoration: underline;
}

.wtt-hero-location a:hover {
  color: #c7d0ff;
}

@media (max-width: 640px) {
  .wtt-hero-time {
    font-size: 2.5rem;
  }
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.wtt-search-container {
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  margin-bottom: var(--spacing-8);
  position: relative;
}

.wtt-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.wtt-search-icon {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

html[dir="rtl"] .wtt-search-icon {
  left: auto;
  right: 14px;
}

.wtt-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-family-base);
  transition: all var(--animation-fast);
}

html[dir="rtl"] .wtt-search-input {
  padding: 12px 42px 12px 14px;
}

.wtt-search-input:focus {
  outline: none;
  border-color: #6c7cff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(108, 124, 255, 0.25);
}

.wtt-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.wtt-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 80;
  display: none;
}

.wtt-search-results.open {
  display: block;
}

.wtt-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  transition: background-color var(--animation-fast);
}

.wtt-search-item:last-child {
  border-bottom: none;
}

.wtt-search-item:hover {
  background-color: var(--muted);
}

.wtt-search-item-info {
  display: flex;
  flex-direction: column;
}

.wtt-search-item-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.wtt-search-item-sub {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.wtt-search-item-offset {
  font-family: var(--font-family-monospace);
  font-size: 0.8125rem;
  background: var(--muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
}

/* ==========================================================================
   Timeline Converter (Interactive)
   ========================================================================== */
.wtt-timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: var(--spacing-10);
}

.wtt-timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-3);
  padding: var(--spacing-4) var(--spacing-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.wtt-timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.wtt-timeline-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.wtt-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-date-btn:hover {
  border-color: var(--primary);
}

.wtt-btn-today {
  padding: 6px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-btn-today:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Timeline Desktop Scroll Area */
.wtt-timeline-container {
  display: none;
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .wtt-timeline-container {
    display: block;
  }
}

.wtt-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: thin;
}

.wtt-timeline-scroll::-webkit-scrollbar {
  height: 8px;
}
.wtt-timeline-scroll::-webkit-scrollbar-track {
  background: var(--muted);
}
.wtt-timeline-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.wtt-timeline-rows {
  display: flex;
  flex-direction: column;
}

.wtt-timeline-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  height: 64px;
}

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

.wtt-timeline-city-info {
  width: 260px;
  min-width: 260px;
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--card);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
}

html[dir="rtl"] .wtt-timeline-city-info {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.04);
}

.wtt-timeline-city-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wtt-timeline-city-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--foreground);
  text-decoration: none;
}

.wtt-timeline-city-name:hover {
  color: var(--primary);
  text-decoration: underline;
}

.wtt-timeline-remove-btn {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  transition: opacity var(--animation-fast);
}

.wtt-timeline-remove-btn:hover {
  opacity: 1;
  color: #ef4444;
}

.wtt-timeline-city-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.wtt-timeline-time-badge {
  font-family: var(--font-family-monospace);
  font-weight: 700;
  color: var(--foreground);
}

.wtt-timeline-blocks-wrapper {
  display: flex;
}

.wtt-timeline-block {
  width: 48px;
  min-width: 48px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  user-select: none;
  position: relative;
  cursor: pointer;
  transition: filter var(--animation-fast);
  padding: 4px 2px;
}

.wtt-timeline-block:hover {
  filter: brightness(0.92);
}

.wtt-hour-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  pointer-events: none;
}

.wtt-hour-num {
  font-family: var(--font-family-monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--foreground);
}

.wtt-hour-period {
  font-family: var(--font-family-base);
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: lowercase;
}

.wtt-date-block {
  width: 38px;
  height: 42px;
  background-color: var(--foreground);
  color: var(--background);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.wtt-date-month {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
}

.wtt-date-day {
  font-size: 0.8125rem;
  font-weight: 800;
  font-family: var(--font-family-monospace);
  color: inherit;
}

/* Block Hour States */
.wtt-block-night {
  background-color: hsl(220 20% 90%);
  color: hsl(220 20% 40%);
}
.wtt-block-night .wtt-hour-num {
  color: hsl(220 20% 35%);
}
.wtt-block-night .wtt-hour-period {
  color: hsl(220 15% 50%);
}
html.dark .wtt-block-night {
  background-color: hsl(230 25% 10%);
  color: hsl(230 15% 45%);
}
html.dark .wtt-block-night .wtt-hour-num {
  color: hsl(230 15% 65%);
}
html.dark .wtt-block-night .wtt-hour-period {
  color: hsl(230 15% 45%);
}

.wtt-block-business {
  background-color: color-mix(in srgb, var(--secondary) 18%, transparent);
  color: color-mix(in srgb, var(--secondary) 80%, black);
  font-weight: 600;
}
.wtt-block-business .wtt-hour-num {
  color: color-mix(in srgb, var(--secondary) 85%, black);
}
.wtt-block-business .wtt-hour-period {
  color: color-mix(in srgb, var(--secondary) 75%, black);
}
html.dark .wtt-block-business {
  background-color: color-mix(in srgb, var(--secondary) 25%, transparent);
  color: #a7f3d0;
}
html.dark .wtt-block-business .wtt-hour-num {
  color: #a7f3d0;
}
html.dark .wtt-block-business .wtt-hour-period {
  color: #6ee7b7;
}

.wtt-block-day {
  background-color: var(--surface);
  color: var(--foreground);
}

.wtt-block-current {
  outline: 2px solid var(--primary) !important;
  outline-offset: -2px;
  font-weight: 700;
  z-index: 5;
}

.wtt-block-date-marker {
  position: absolute;
  top: 2px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
}

/* Timeline Mobile View */
.wtt-timeline-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  padding: var(--spacing-4);
}

@media (min-width: 900px) {
  .wtt-timeline-mobile {
    display: none;
  }
}

.wtt-mobile-city-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-3) var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wtt-mobile-city-card.wtt-base-city {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.wtt-mobile-city-info {
  display: flex;
  flex-direction: column;
}

.wtt-mobile-city-title {
  font-weight: 700;
  font-size: 1rem;
}

.wtt-mobile-city-sub {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.wtt-mobile-time-col {
  text-align: right;
}
html[dir="rtl"] .wtt-mobile-time-col {
  text-align: left;
}

.wtt-mobile-time {
  font-family: var(--font-family-monospace);
  font-size: 1.25rem;
  font-weight: 700;
}

.wtt-mobile-relative-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* ==========================================================================
   Popular Cities Grid (12 Cards)
   ========================================================================== */
.wtt-section-header {
  margin-bottom: var(--spacing-6);
}

.wtt-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-1);
}

.wtt-section-subtitle {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  margin: 0;
}

.wtt-popular-cities-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-12);
}

@media (min-width: 600px) {
  .wtt-popular-cities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .wtt-popular-cities-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.wtt-city-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--animation-fast);
  text-decoration: none;
  color: inherit;
}

.wtt-city-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.wtt-city-card-info {
  display: flex;
  flex-direction: column;
}

.wtt-city-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--foreground);
}

.wtt-city-card-country {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.wtt-city-card-icon {
  color: var(--muted-foreground);
  transition: color var(--animation-fast), transform var(--animation-fast);
}

.wtt-city-card:hover .wtt-city-card-icon {
  color: var(--primary);
  transform: translateX(3px);
}
html[dir="rtl"] .wtt-city-card:hover .wtt-city-card-icon {
  transform: translateX(-3px);
}

/* ==========================================================================
   SEO Content Block (Features, How it Works, Guide, FAQ)
   ========================================================================== */
.wtt-seo-block {
  margin-top: var(--spacing-12);
  margin-bottom: var(--spacing-16);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-12);
}

.wtt-features-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-6);
}

@media (min-width: 640px) {
  .wtt-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .wtt-features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wtt-feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.wtt-feature-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.wtt-feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.wtt-feature-desc {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

/* FAQ Accordion */
.wtt-faq-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.wtt-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
}

.wtt-faq-question {
  width: 100%;
  padding: var(--spacing-4) var(--spacing-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  font-family: var(--font-family-heading);
}

html[dir="rtl"] .wtt-faq-question {
  text-align: right;
}

.wtt-faq-question:hover {
  color: var(--primary);
}

.wtt-faq-chevron {
  transition: transform var(--animation-fast);
  color: var(--muted-foreground);
}

.wtt-faq-item.open .wtt-faq-chevron {
  transform: rotate(180deg);
}

.wtt-faq-answer {
  display: none;
  padding: 0 var(--spacing-5) var(--spacing-5);
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.wtt-faq-item.open .wtt-faq-answer {
  display: block;
}

/* Abbreviations Table */
.wtt-table-container {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: var(--spacing-6) 0;
}

.wtt-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

html[dir="rtl"] .wtt-table {
  text-align: right;
}

.wtt-table th {
  background: var(--muted);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
}

.wtt-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

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

.wtt-table code {
  font-family: var(--font-family-monospace);
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   World Clock Page
   ========================================================================== */
.wtt-world-clock-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-10);
}

@media (min-width: 600px) {
  .wtt-world-clock-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .wtt-world-clock-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wtt-clock-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all var(--animation-fast);
}

.wtt-clock-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.wtt-clock-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-3);
}

.wtt-clock-city-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.wtt-clock-city-title a:hover {
  color: var(--primary);
}

.wtt-clock-offset {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-family: var(--font-family-monospace);
}

.wtt-clock-icon {
  color: var(--accent);
}

.wtt-clock-time {
  font-family: var(--font-family-monospace);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--foreground);
  margin-bottom: var(--spacing-2);
}

.wtt-clock-date {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.wtt-clock-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--muted);
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--animation-fast);
}

.wtt-clock-card:hover .wtt-clock-delete-btn {
  opacity: 1;
}

.wtt-clock-delete-btn:hover {
  background-color: #ef4444;
  color: #ffffff;
}

/* Explore Cities Pills */
.wtt-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-8);
}

.wtt-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--animation-fast);
}

.wtt-pill:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}

/* ==========================================================================
   Cities Directory (/cities)
   ========================================================================== */
.wtt-cities-sticky-bar {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 95%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--spacing-4) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--spacing-8);
}

.wtt-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
  margin-top: var(--spacing-3);
}

.wtt-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-tab-btn:hover {
  border-color: var(--primary);
}

.wtt-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.wtt-country-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  margin-bottom: var(--spacing-6);
}

.wtt-country-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-3);
  border-bottom: 1px solid var(--border);
}

.wtt-country-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.wtt-country-count {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.wtt-cities-grid-4col {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-3);
}

@media (min-width: 600px) {
  .wtt-cities-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .wtt-cities-grid-4col {
    grid-template-columns: repeat(4, 1fr);
  }
}

.wtt-directory-city-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--animation-fast);
}

.wtt-directory-city-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.wtt-expand-btn {
  margin-top: var(--spacing-4);
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-expand-btn:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-style: solid;
}

/* ==========================================================================
   Single City Page (/time/{slug})
   ========================================================================== */
.wtt-city-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-10) var(--spacing-6);
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-8);
  position: relative;
}

.wtt-city-hero-pin {
  color: var(--primary);
  margin-bottom: var(--spacing-2);
}

.wtt-city-hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 var(--spacing-1);
}

.wtt-city-hero-country {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: var(--spacing-6);
}

.wtt-city-hero-clock {
  font-family: var(--font-family-monospace);
  font-size: 4rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: var(--spacing-3) 0;
}

@media (max-width: 640px) {
  .wtt-city-hero-clock {
    font-size: 2.75rem;
  }
}

.wtt-city-hero-date {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Detail 3 Cards */
.wtt-city-details-row {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-8);
}

@media (min-width: 640px) {
  .wtt-city-details-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wtt-detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.wtt-detail-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: var(--spacing-1);
}

.wtt-detail-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-family-heading);
}

/* Amber Did You Know Box */
.wtt-did-you-know-card {
  background: linear-gradient(135deg, hsl(35 90% 95%) 0%, hsl(35 80% 90%) 100%);
  border: 1px solid hsl(35 80% 75%);
  border-radius: var(--radius-md);
  padding: var(--spacing-6);
  margin-bottom: var(--spacing-8);
  color: hsl(35 20% 20%);
}

html.dark .wtt-did-you-know-card {
  background: linear-gradient(135deg, hsl(35 40% 16%) 0%, hsl(35 30% 12%) 100%);
  border-color: hsl(35 40% 30%);
  color: hsl(35 70% 85%);
}

.wtt-did-you-know-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-2);
}

.wtt-did-you-know-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Contact Page (/contact)
   ========================================================================== */
.wtt-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
  margin-top: var(--spacing-6);
  margin-bottom: var(--spacing-16);
}

@media (min-width: 768px) {
  .wtt-contact-grid {
    grid-template-columns: 1fr 1.6fr;
  }
}

.wtt-contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-8);
  box-shadow: var(--shadow-sm);
}

.wtt-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--spacing-5);
}

.wtt-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.wtt-form-input,
.wtt-form-select,
.wtt-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.9375rem;
  font-family: var(--font-family-base);
  transition: all var(--animation-fast);
}

.wtt-form-input:focus,
.wtt-form-select:focus,
.wtt-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.wtt-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-fast);
}

.wtt-btn-submit:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.wtt-footer {
  background-color: var(--muted);
  color: var(--foreground);
  padding: var(--spacing-12) var(--spacing-4) var(--spacing-6);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.wtt-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .wtt-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .wtt-footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.6fr;
  }
}

.wtt-footer-col-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-4);
  color: var(--foreground);
}

.wtt-footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wtt-footer-links a {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: color var(--animation-fast);
}

.wtt-footer-links a:hover {
  color: var(--foreground);
}

.wtt-footer-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
}

.wtt-footer-lang-link {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--animation-fast);
}

.wtt-footer-lang-link:hover {
  color: var(--primary);
}

.wtt-footer-bottom {
  max-width: 1200px;
  margin: var(--spacing-8) auto 0;
  padding-top: var(--spacing-6);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .wtt-footer-bottom {
    flex-direction: row;
  }
}

.wtt-footer-legal-links {
  display: flex;
  gap: var(--spacing-4);
}

.wtt-footer-legal-links a:hover {
  color: var(--foreground);
}
