/* Global Time Converter — Colorful & Dynamic Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.3);
    --glow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* ============ THEME COLORS ============ */

/* Dark Theme (Manual) */
body[data-theme="dark"] {
    --bg: #0a0e27;
    --bg-secondary: #13182e;
    --bg-card: rgba(25, 32, 56, 0.95);
    --bg-card-hover: rgba(30, 38, 65, 0.95);
    --text: #ffffff;
    --text-secondary: #a0aec0;
    --accent: #667eea;
    --accent-secondary: #764ba2;
    --accent-glow: rgba(102, 126, 234, 0.4);
    --border: rgba(255, 255, 255, 0.1);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(135deg, #0a0e27 0%, #13182e 50%, #1a1f3a 100%);
    --widget-bg: linear-gradient(135deg, #0b1020 0%, #1b1f3a 45%, #0f1227 100%);
    --widget-surface: rgba(16, 22, 40, 0.9);
    --widget-border: rgba(138, 164, 255, 0.35);
    --widget-title: #f8fafc;
    --widget-time: #9aa9ff;
    --widget-accent: #8aa4ff;
    --widget-glow: rgba(138, 164, 255, 0.45);
    --widget-muted: #cbd5f5;
    --widget-second: #ff6b6b;
}

/* Light Theme (Manual) */
body[data-theme="light"] {
    --bg: #f0f4f8;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(248, 250, 252, 0.98);
    --text: #1a202c;
    --text-secondary: #4a5568;
    --accent: #4299e1;
    --accent-secondary: #3182ce;
    --accent-glow: rgba(66, 153, 225, 0.3);
    --border: rgba(0, 0, 0, 0.08);
    --gradient-1: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    --gradient-bg: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #d6dee8 100%);
    --widget-bg: linear-gradient(135deg, #e3f2ff 0%, #fefefe 50%, #e8f0ff 100%);
    --widget-surface: rgba(255, 255, 255, 0.9);
    --widget-border: rgba(66, 153, 225, 0.35);
    --widget-title: #1a202c;
    --widget-time: #2563eb;
    --widget-accent: #4299e1;
    --widget-glow: rgba(66, 153, 225, 0.35);
    --widget-muted: #425466;
    --widget-second: #ef4444;
}

/* Auto Theme - Morning (6am-12pm) */
body[data-time-theme="morning"] {
    --bg: #fff8e1;
    --bg-secondary: #ffecb3;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 252, 245, 0.95);
    --text: #2d3748;
    --text-secondary: #4a5568;
    --accent: #ff6f61;
    --accent-secondary: #ff9f43;
    --accent-glow: rgba(255, 111, 97, 0.3);
    --border: rgba(255, 159, 67, 0.15);
    --gradient-1: linear-gradient(135deg, #ff6f61 0%, #ff9f43 100%);
    --gradient-bg: linear-gradient(135deg, #fff8e1 0%, #ffecb3 30%, #ffe0b2 100%),
                   radial-gradient(ellipse at 20% 30%, rgba(255, 111, 97, 0.15), transparent 50%),
                   radial-gradient(ellipse at 80% 70%, rgba(255, 159, 67, 0.12), transparent 50%);
    --widget-bg: linear-gradient(135deg, #fff3e0 0%, #ffe8c8 45%, #fff6ed 100%);
    --widget-surface: rgba(255, 255, 255, 0.9);
    --widget-border: rgba(255, 111, 97, 0.35);
    --widget-title: #3b2a2a;
    --widget-time: #ff6f61;
    --widget-accent: #ff8a65;
    --widget-glow: rgba(255, 111, 97, 0.4);
    --widget-muted: #6b4b3e;
    --widget-second: #ff3b3b;
}

/* Auto Theme - Afternoon (12pm-5pm) */
body[data-time-theme="afternoon"] {
    --bg: #e3f2fd;
    --bg-secondary: #bbdefb;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(250, 252, 255, 0.95);
    --text: #1a237e;
    --text-secondary: #3949ab;
    --accent: #42a5f5;
    --accent-secondary: #2196f3;
    --accent-glow: rgba(66, 165, 245, 0.35);
    --border: rgba(33, 150, 243, 0.12);
    --gradient-1: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    --gradient-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 40%, #90caf9 100%),
                   radial-gradient(ellipse at 30% 20%, rgba(66, 165, 245, 0.15), transparent 60%),
                   radial-gradient(ellipse at 70% 80%, rgba(30, 136, 229, 0.1), transparent 55%);
    --widget-bg: linear-gradient(135deg, #e1f5fe 0%, #e8f7ff 45%, #e3f2fd 100%);
    --widget-surface: rgba(255, 255, 255, 0.92);
    --widget-border: rgba(66, 165, 245, 0.35);
    --widget-title: #1a237e;
    --widget-time: #1e88e5;
    --widget-accent: #42a5f5;
    --widget-glow: rgba(66, 165, 245, 0.4);
    --widget-muted: #3949ab;
    --widget-second: #ff3b3b;
}

/* Auto Theme - Evening (5pm-8pm) */
body[data-time-theme="evening"] {
    --bg: #fce4ec;
    --bg-secondary: #f8bbd0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 250, 252, 0.95);
    --text: #4a148c;
    --text-secondary: #6a1b9a;
    --accent: #ec407a;
    --accent-secondary: #ab47bc;
    --accent-glow: rgba(236, 64, 122, 0.35);
    --border: rgba(171, 71, 188, 0.15);
    --gradient-1: linear-gradient(135deg, #ec407a 0%, #ab47bc 100%);
    --gradient-bg: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 35%, #f48fb1 100%),
                   radial-gradient(ellipse at 25% 25%, rgba(236, 64, 122, 0.15), transparent 55%),
                   radial-gradient(ellipse at 75% 75%, rgba(171, 71, 188, 0.12), transparent 50%);
    --widget-bg: linear-gradient(135deg, #fde2f3 0%, #fbcfe8 45%, #f8bbd0 100%);
    --widget-surface: rgba(255, 255, 255, 0.9);
    --widget-border: rgba(236, 64, 122, 0.35);
    --widget-title: #4a148c;
    --widget-time: #ec407a;
    --widget-accent: #ab47bc;
    --widget-glow: rgba(236, 64, 122, 0.4);
    --widget-muted: #6a1b9a;
    --widget-second: #ff3b3b;
}

/* Auto Theme - Night (8pm-6am) */
body[data-time-theme="night"] {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: rgba(22, 27, 34, 0.95);
    --bg-card-hover: rgba(30, 36, 46, 0.95);
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #a78bfa;
    --accent-secondary: #c084fc;
    --accent-glow: rgba(167, 139, 250, 0.4);
    --border: rgba(167, 139, 250, 0.15);
    --gradient-1: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
    --gradient-bg: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1c2128 100%),
                   radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.08), transparent 50%),
                   radial-gradient(ellipse at 80% 80%, rgba(192, 132, 252, 0.06), transparent 50%);
    --widget-bg: linear-gradient(135deg, #0b1220 0%, #171b2f 45%, #0f1428 100%);
    --widget-surface: rgba(16, 20, 34, 0.92);
    --widget-border: rgba(167, 139, 250, 0.4);
    --widget-title: #eef2ff;
    --widget-time: #c4b5fd;
    --widget-accent: #a78bfa;
    --widget-glow: rgba(167, 139, 250, 0.45);
    --widget-muted: #cbd5ff;
    --widget-second: #f43f5e;
}

/* ============ GLOBAL STYLES ============ */

.hidden {
    display: none !important;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.6s ease, color 0.4s ease;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--gradient-bg);
    pointer-events: none;
    transition: background 1s ease;
}

/* ============ APP LOADING ============ */

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-loading[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading-content {
    text-align: center;
}

.app-loading-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.app-loading-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============ CONTAINER ============ */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 32px);
}

/* ============ HEADER ============ */

.header {
    padding: clamp(24px, 5vw, 40px) 0 clamp(20px, 4vw, 32px);
    animation: fadeDown 0.7s ease-out;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
    min-width: 250px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.header-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.1;
}

.header-subtitle {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    color: var(--text-secondary);
    font-weight: 500;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-btn {

/* ============ API TAB ============ */

.api-config {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.api-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.api-group h4 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.api-endpoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.api-widget-options,
.api-widget-theme {
    margin-top: 12px;
}
    min-width: 68px;
    padding: 8px 10px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.icon-btn .icon {
    font-size: 1.4rem;
    line-height: 1;
}

.icon-btn .label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.icon-btn:active {
    transform: translateY(-1px);
}

/* ============ FAVORITES SECTION ============ */

.favorites-section {
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out;
}

.favorites-header {
    margin-bottom: 16px;
}

.favorites-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.favorite-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.favorite-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25), var(--glow);
}

.favorite-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.favorite-flag {
    font-size: 2.5rem;
}

.favorite-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.favorite-remove:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: scale(1.1);
}

.favorite-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.favorite-time {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
}

/* ============ HERO CARD ============ */

.hero-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(28px, 5vw, 48px);
    margin-bottom: clamp(24px, 4vw, 32px);
    box-shadow: var(--shadow), var(--glow);
    animation: fadeUp 0.6s ease-out 0.1s both;
    transition: all var(--transition);
    position: relative;
}

.hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3), var(--glow);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Widget Mode Styling */
.hero-card.widget-mode-active {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: var(--widget-bg, var(--bg-card)) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    animation: none !important;
}

.widget-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 24px 18px;
    gap: 12px;
    background: var(--widget-surface, var(--bg-card));
    border: 1px solid var(--widget-border, var(--border));
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 45px var(--widget-glow, var(--accent-glow));
    box-sizing: border-box;
    overflow: hidden;
}

.widget-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0;
}

.widget-flag {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    line-height: 1;
}

.widget-country {
    font-size: clamp(1.3rem, 6vw, 2rem);
    font-weight: 700;
    color: var(--widget-title, var(--text));
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-time-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.widget-digital-time {
    font-size: clamp(2.3rem, 14vw, 4.8rem);
    line-height: 1;
    letter-spacing: 0.05em;
    margin: 0;
    font-weight: 900;
    font-family: 'Orbitron', monospace;
    color: var(--widget-time, var(--accent));
    text-shadow: 0 10px 30px var(--widget-glow, var(--accent-glow));
}

.widget-analog-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.widget-clock-face {
    width: clamp(120px, 32vw, 220px);
    height: clamp(120px, 32vw, 220px);
    border-radius: 50%;
    background: var(--widget-surface, var(--bg-secondary));
    border: 6px solid var(--widget-accent, var(--accent));
    box-shadow: 0 0 40px var(--widget-glow, var(--accent-glow)), inset 0 0 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: visible;
}

.widget-clock-face::before {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.25), rgba(255,255,255,0.0));
    opacity: 0.6;
    animation: clockAura 18s linear infinite;
    pointer-events: none;
}

.widget-clock-face .clock-number {
    position: absolute;
    width: 100%;
    height: 50%;
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    color: var(--text);
    transform: rotate(calc(var(--number) * 30deg));
    transform-origin: center bottom;
    line-height: 1;
    top: 0;
    left: 0;
}

.widget-clock-face .clock-number span {
    display: inline-block;
    transform: rotate(calc(var(--number) * -30deg));
    padding-top: 3px;
}

.widget-clock-face .hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: var(--widget-title, var(--text));
    border-radius: 6px;
}

.widget-clock-face .hour-hand {
    width: 8px;
    height: 25%;
    background: var(--widget-title, var(--text));
    margin-left: -4px;
}

.widget-clock-face .minute-hand {
    width: 6px;
    height: 35%;
    background: var(--widget-title, var(--text));
    margin-left: -3px;
}

.widget-clock-face .second-hand {
    width: 3px;
    height: 40%;
    background: var(--widget-second, #ff3b3b);
    margin-left: -1.5px;
}

.widget-clock-face .clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    background: var(--widget-accent, var(--accent));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px var(--widget-glow, var(--accent-glow));
    animation: clockPulse 3s ease-in-out infinite;
    z-index: 10;
}

.widget-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--widget-border, var(--border));
    width: 100%;
    align-self: stretch;
}

.widget-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.08);
    border: 1px solid var(--widget-border, var(--border));
    width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

.widget-timezone {
    font-size: clamp(0.85rem, 3vw, 1.05rem);
    color: var(--widget-muted, var(--text-secondary));
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.widget-dial {
    font-size: clamp(0.85rem, 3vw, 1.05rem);
    font-weight: 700;
    color: var(--widget-title, var(--text));
    white-space: nowrap;
    display: block;
}

.widget-clock-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.15);
    border: 2px solid var(--accent);
    z-index: 100;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    padding: 0 !important;
}

.widget-clock-toggle .icon {
    font-size: 1.5rem;
}

.widget-clock-toggle .label {
    display: none !important;
}

.widget-clock-toggle:hover {
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.25) !important;
    border-color: var(--accent) !important;
    transform: scale(1.15) !important;
}

.country-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.flag-emoji {
    font-size: clamp(3rem, 10vw, 4.5rem);
    line-height: 1;
}

@media (min-width: 769px) {
    .flag-emoji {
        display: none;
    }
}

.country-name {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    flex: 1;
}

.favorite-btn {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    transform: scale(1.15);
    border-color: var(--accent);
}

.favorite-btn #favoriteIcon {
    color: #ffd700;
}

/* ============ TIME BLOCK ============ */

.time-block {
    text-align: center;
}

.clock-container {
    margin-bottom: 20px;
}

/* Digital Clock */
.digital-clock .time {
    font-family: 'Orbitron', monospace;
    font-size: clamp(3rem, 12vw, 5.5rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px var(--accent-glow);
    margin-bottom: 12px;
    line-height: 1.1;
    transition: all var(--transition);
}

/* Analog Clock */
.analog-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.clock-face {
    width: clamp(200px, 40vw, 280px);
    height: clamp(200px, 40vw, 280px);
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 6px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow), inset 0 0 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.clock-face::before {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.25), rgba(255,255,255,0.0));
    opacity: 0.6;
    animation: clockAura 18s linear infinite;
    pointer-events: none;
}

.clock-face::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    animation: clockRingPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hour-hand {
    width: 8px;
    height: 28%;
    margin-left: -4px;
    background: var(--accent);
}

.minute-hand {
    width: 6px;
    height: 38%;
    margin-left: -3px;
    background: var(--accent-secondary);
}

.second-hand {
    width: 3px;
    height: 42%;
    margin-left: -1.5px;
    background: #ff6b6b;
}

.clock-number {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.8rem;
    height: 2.8rem;
    margin: -1.4rem 0 0 -1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* Position each number correctly around the clock face */
/* 12 is at top, 3 is at right, 6 is at bottom, 9 is at left */
.clock-number[style*="--number: 1"] { transform: translate(44px, -76px); }
.clock-number[style*="--number: 2"] { transform: translate(76px, -44px); }
.clock-number[style*="--number: 3"] { transform: translate(88px, 0); }
.clock-number[style*="--number: 4"] { transform: translate(76px, 44px); }
.clock-number[style*="--number: 5"] { transform: translate(44px, 76px); }
.clock-number[style*="--number: 6"] { transform: translate(0, 88px); }
.clock-number[style*="--number: 7"] { transform: translate(-44px, 76px); }
.clock-number[style*="--number: 8"] { transform: translate(-76px, 44px); }
.clock-number[style*="--number: 9"] { transform: translate(-88px, 0); }
.clock-number[style*="--number: 10"] { transform: translate(-76px, -44px); }
.clock-number[style*="--number: 11"] { transform: translate(-44px, -76px); }
.clock-number[style*="--number: 12"] { transform: translate(0, -88px); }

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--accent-glow);
    z-index: 10;
    animation: clockPulse 3s ease-in-out infinite;
}

@keyframes clockAura {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes clockPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes clockRingPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.03); opacity: 0.9; }
}

/* Date & Meta */
.date {
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 24px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.meta-item {
    background: var(--bg-secondary);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.meta-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.meta-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.timezone,
.utc-offset,
.season,
.time-diff,
.dial-code {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.timezone {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sun Times */
.sun-times {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.sun-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sun-icon {
    font-size: 2.5rem;
}

.sun-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sun-time {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

/* ============ PANEL (TABS) ============ */

.panel {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 32px);
    box-shadow: var(--shadow);
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 4px;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all var(--transition);
    position: relative;
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.tab-btn.active {
    color: var(--accent);
    background: var(--bg-secondary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 3px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ MAP ============ */

.map-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

#map {
    height: 450px;
    width: 100%;
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
}

.map-terminator {
    --terminator-shift: 0%;
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg,
        rgba(10, 16, 30, 0.55) 0%,
        rgba(10, 16, 30, 0.55) 28%,
        rgba(255, 170, 110, 0.35) 40%,
        rgba(255, 220, 170, 0.22) 50%,
        rgba(140, 190, 255, 0.22) 60%,
        rgba(10, 16, 30, 0.55) 72%,
        rgba(10, 16, 30, 0.55) 100%
    );
    background-size: 200% 100%;
    background-position: calc(50% + var(--terminator-shift)) 50%;
    mix-blend-mode: multiply;
    opacity: 0.5;
    transition: background-position 1s ease;
}

.map-marker-wrapper {
    background: none;
    border: none;
}

.map-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.95rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.map-marker .marker-star {
    opacity: 0;
    transform: scale(0.8);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.map-marker.is-favorite {
    background: var(--accent);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
}

.map-marker.is-favorite .marker-star {
    opacity: 1;
    transform: scale(1);
}

.map-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

.map-offline {
    text-align: center;
    padding: 40px 20px;
}

.map-offline-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.map-offline-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.map-offline-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.map-offline-country-btn {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.map-offline-country-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ============ COUNTRY LIST ============ */

.search-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 20px;
    transition: all var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.country-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.country-list::-webkit-scrollbar {
    width: 8px;
}

.country-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.country-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.country-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(5px);
}

.country-item.selected {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.country-item-flag {
    font-size: 2rem;
}

.country-item-name {
    flex: 1;
    font-weight: 600;
    color: var(--text);
    font-size: 1.05rem;
}

.country-item-timezone {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.country-item-dial {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
    white-space: nowrap;
}

/* ============ CALENDAR ============ */

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cal-nav {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: scale(1.1);
}

.cal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.calendar-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.view-toggle-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.view-toggle-btn:hover {
    border-color: var(--accent);
}

.view-toggle-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.cal-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    font-style: italic;
}

.calendar-wrap {
    position: relative;
    min-height: 200px;
    width: 100%;
    overflow: hidden;
}

.calendar-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calendar-loading[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.calendar-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.calendar-day-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    transition: all var(--transition);
    cursor: pointer;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    border-color: var(--accent);
    background: var(--bg-card);
    font-weight: 700;
}

.calendar-day.has-events {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.calendar-day.has-events:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.day-number {
    font-size: 1rem;
    margin-bottom: 4px;
}

.calendar-day-festivals {
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============ FESTIVAL MODAL ============ */

.festival-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.festival-modal-visible {
    opacity: 1;
}

.festival-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.festival-modal-box {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.festival-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.festival-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.festival-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.festival-modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.festival-modal-list {
    list-style: none;
}

.festival-modal-list li {
    padding: 14px 18px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
}

/* ============ TOAST ============ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text);
    padding: 16px 28px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    font-weight: 600;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-visible {
    transform: translateX(-50%) translateY(0);
}

/* ============ FOOTER ============ */

.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer p {
    margin-bottom: 12px;
}

.install-btn {
    margin-top: 16px;
    padding: 14px 32px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ============ BANNERS ============ */

.offline-banner,
.file-protocol-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.offline-banner[aria-hidden="true"],
.file-protocol-banner[aria-hidden="true"] {
    transform: translateY(-100%);
}

.file-protocol-banner code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Orbitron', monospace;
}

/* ============ BULK COMPARISON ============ */

.panel-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    font-style: italic;
}

.comparison-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comparison-btn {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.comparison-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.comparison-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comparison-btn.secondary {
    border-color: var(--border);
    background: var(--bg-secondary);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.comparison-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all var(--transition);
}

.comparison-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comp-flag {
    font-size: 2rem;
}

.comp-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all var(--transition);
}

.comp-remove:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.comp-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.comp-time {
    font-size: 1.8rem;
    font-family: 'Orbitron', monospace;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 700;
}

.comp-tz {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.comp-dial {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    padding: 6px 10px;
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.1);
    border-radius: 4px;
    text-align: center;
}

/* ============ COMPARE DROPDOWN ============ */

.compare-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.compare-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 1px solid var(--border);
}

.compare-dropdown-item:last-child {
    border-bottom: none;
}

.compare-dropdown-item:hover {
    background: var(--bg-card-hover);
    padding-left: 20px;
}

.comp-drop-flag {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.comp-drop-info {
    flex: 1;
    min-width: 0;
}

.comp-drop-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.comp-drop-tz {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comp-drop-dial {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.compare-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.compare-search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

/* ============ COMPARISON DETAILS ============ */

.comparison-details {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}

.comparison-detail-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

.comparison-detail-card:last-child {
    margin-bottom: 0;
}

.comparison-detail-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.comp-detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.comp-detail-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comp-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.05);
    border-radius: 6px;
}

.comp-detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.comp-detail-value {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 700;
    font-family: 'Orbitron', monospace;
}

.comp-detail-warning {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left: 3px solid #ffc107;
}

.comp-detail-warning .comp-detail-value {
    color: #ffc107;
}

.comp-detail-schedule {
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.08);
    border-left: 3px solid var(--accent);
}

.comp-detail-overlap {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
    font-weight: 600;
}

.comp-detail-overlap .comp-detail-value {
    color: var(--text);
    font-weight: 600;
}

/* ============ META GRID DATE ============ */

.meta-item-date {
    grid-column: 1 / -1;
    background: rgba(var(--accent-rgb, 100, 200, 255), 0.1);
    border: 2px solid var(--accent);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.meta-item-date .meta-label {
    font-weight: 700;
    color: var(--accent);
}

.current-date-meta {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* ============ WIDGET ============ */

.widget-preview {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.widget-code-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.widget-code-section h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--text);
}

.widget-code {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
    transition: border-color var(--transition);
}

.widget-code:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.copy-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.copy-btn:active {
    transform: translateY(0);
}

.widget-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.widget-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    user-select: none;
}

.widget-options label:first-of-type {
    font-weight: 600;
    margin-bottom: 4px;
    cursor: default;
}

.widget-options label:hover:not(:first-of-type) {
    color: var(--accent);
}

.widget-options input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.widget-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.widget-country-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-country-select label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.widget-select {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
}

.widget-select:hover {
    border-color: var(--accent);
}

.widget-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.widget-theme-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-theme-select label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    user-select: none;
}

.widget-theme-select label:first-of-type {
    font-weight: 600;
    margin-bottom: 4px;
    cursor: default;
}

.widget-theme-select label:hover:not(:first-of-type) {
    color: var(--accent);
}

.widget-theme-select input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }

    #installBtn {
        display: none !important;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
    }
    
    .sun-times {
        flex-direction: column;
        gap: 16px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    #map {
        height: 350px;
    }
    
    .calendar {
        gap: 4px;
        width: 100%;
    }
    
    .calendar-day {
        padding: 4px;
        font-size: 0.85rem;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .calendar-day-festivals {
        font-size: 0.65rem;
    }
    
    .calendar-toolbar {
        gap: 12px;
    }
    
    .cal-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .icon-btn {
        min-width: 58px;
        padding: 6px 8px;
        border-radius: 14px;
        gap: 3px;
    }

    .icon-btn .icon {
        font-size: 1.2rem;
    }

    .icon-btn .label {
        font-size: 0.55rem;
    }
    
    .favorite-card {
        padding: 16px;
    }
    
    .festival-modal-box {
        padding: 24px;
    }
    
    .panel {
        padding: clamp(12px, 3vw, 20px);
    }
    
    .tabs {
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .calendar {
        gap: 1px;
    }
    
    .calendar-day {
        padding: 2px;
        font-size: 0.75rem;
        min-width: 0;
    }
    
    .calendar-day-header {
        padding: 8px 2px;
        font-size: 0.7rem;
    }
    
    .day-number {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .calendar-day-festivals {
        font-size: 0.55rem;
    }
    
    .calendar-toolbar {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .cal-nav {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .cal-title {
        font-size: 0.95rem;
    }
    
    .view-toggle-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
