/* ============================================
   D-TERMINAL V2 — World Clock Dashboard
   Dark & Glassy Theme
   ============================================ */

/* ── CSS Custom Properties ── */
:root {
    /* Core palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d0d14;
    --bg-tertiary: #12121c;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.12);

    /* Accent colors */
    --accent: #f5a623;
    --accent-dim: rgba(245, 166, 35, 0.3);
    --accent-glow: rgba(245, 166, 35, 0.15);
    --accent-secondary: #ff6b35;
    --accent-cool: #4ecdc4;
    --accent-cool-dim: rgba(78, 205, 196, 0.25);

    /* Text */
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.55);
    --text-muted: rgba(240, 240, 245, 0.3);

    /* Glass */
    --glass-bg: rgba(18, 18, 30, 0.65);
    --glass-bg-heavy: rgba(12, 12, 22, 0.82);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 24px;

    /* Sizing */
    --navbar-height: 62px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Background Effects ── */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.1), transparent 70%);
    bottom: -15%;
    right: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.08), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -13s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 100%);
}

/* ── Clock Navbar (Ticker Bar) ── */
.clock-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-height);
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-glow-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 15%,
        var(--accent-secondary) 50%,
        var(--accent) 85%,
        transparent 100%
    );
    opacity: 0.9;
    animation: tickerPulse 3s ease-in-out infinite;
}

.ticker-glow-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-dim) 20%,
        var(--accent-dim) 80%,
        transparent 100%
    );
    opacity: 0.5;
}

@keyframes tickerPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.ticker-container {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 16px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.ticker-container::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
    min-width: 120px;
    padding: 6px 16px;
    position: relative;
    cursor: default;
    transition: all 0.3s var(--ease-out);
}

.ticker-item:hover {
    background: var(--surface-hover);
}

.ticker-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--border-bright), transparent);
}

.ticker-time {
    font-family: 'Orbitron', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1.5px;
    line-height: 1.3;
    text-shadow: 0 0 20px var(--accent-glow);
}

.ticker-city {
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 1px;
}

/* ── Main Content ── */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: var(--navbar-height);
}

/* ── Hero Section ── */
.hero-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

.hero-glass-card {
    text-align: center;
    padding: 60px 80px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    max-width: 700px;
    width: 100%;
    animation: heroFadeIn 1s var(--ease-out) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes heroFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.hero-glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
        rgba(245, 166, 35, 0.05) 0%,
        transparent 40%,
        transparent 60%,
        rgba(78, 205, 196, 0.03) 100%
    );
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent-dim);
    padding: 6px 18px;
    border-radius: 100px;
    margin-bottom: 28px;
}

.hero-title {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}

.title-accent {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
}

.title-version {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 40px;
    font-weight: 300;
}

.hero-local-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.local-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: var(--text-muted);
}

.local-clock {
    font-family: 'Orbitron', monospace;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 3px;
    text-shadow: 0 0 40px rgba(245, 166, 35, 0.15);
}

.local-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Section Title ── */
.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

.title-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

/* ── Clocks Grid Section ── */
.clocks-section {
    padding: 40px 24px 80px;
    max-width: 1300px;
    margin: 0 auto;
}

.clocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.clock-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    cursor: default;
    opacity: 0;
    transform: translateY(16px);
    animation: cardAppear 0.6s var(--ease-out) forwards;
}

.clock-card:nth-child(1) { animation-delay: 0.05s; }
.clock-card:nth-child(2) { animation-delay: 0.1s; }
.clock-card:nth-child(3) { animation-delay: 0.15s; }
.clock-card:nth-child(4) { animation-delay: 0.2s; }
.clock-card:nth-child(5) { animation-delay: 0.25s; }
.clock-card:nth-child(6) { animation-delay: 0.3s; }
.clock-card:nth-child(7) { animation-delay: 0.35s; }
.clock-card:nth-child(8) { animation-delay: 0.4s; }
.clock-card:nth-child(9) { animation-delay: 0.45s; }

@keyframes cardAppear {
    to { opacity: 1; transform: translateY(0); }
}

.clock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.clock-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-4px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--accent-glow);
}

.clock-card:hover::before {
    opacity: 1;
}

.clock-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.clock-card-city {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.clock-card-flag {
    font-size: 1.3rem;
    line-height: 1;
}

.clock-card-time {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 25px var(--accent-glow);
}

.clock-card-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.clock-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.clock-card-offset {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
    letter-spacing: 0.5px;
}

.clock-card-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    margin-left: auto;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.night {
    background: #7b68ee;
    box-shadow: 0 0 8px rgba(123, 104, 238, 0.5);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Dateline Section ── */
.dateline-section {
    padding: 20px 24px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.dateline-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 50px 40px;
}

.dateline-visual {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.dateline-visual::-webkit-scrollbar {
    display: none;
}

.dateline-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 0 auto;
    min-width: 100px;
    padding: 12px 10px;
    position: relative;
}

.dateline-block::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--border);
}

.dateline-block:last-child::after {
    display: none;
}

.dateline-utc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.dateline-time {
    font-family: 'Orbitron', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.dateline-city {
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ── Footer ── */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 0 24px 40px;
}

.footer-glass {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.footer-glass p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 3px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-glass-card {
        padding: 40px 28px;
    }

    .title-accent {
        font-size: 1.8rem;
    }

    .title-version {
        font-size: 1rem;
    }

    .local-clock {
        font-size: 2rem;
    }

    .clock-navbar {
        height: 56px;
    }

    :root {
        --navbar-height: 56px;
    }

    .ticker-time {
        font-size: 0.95rem;
    }

    .ticker-item {
        min-width: 100px;
        padding: 6px 10px;
    }

    .clocks-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }

    .clock-card-time {
        font-size: 1.5rem;
    }

    .dateline-glass {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 50px 16px;
    }

    .hero-glass-card {
        padding: 30px 20px;
    }

    .title-accent {
        font-size: 1.4rem;
    }

    .local-clock {
        font-size: 1.6rem;
    }

    .clocks-section {
        padding: 30px 16px 60px;
    }

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