:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.8);
    --text-primary: #00f3ff;
    --text-secondary: #ff00ff;
    --accent: #fdf900;
    --neon-glow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
    --neon-border: 1px solid rgba(0, 243, 255, 0.5);
    --font-main: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

.light-mode {
    --bg-color: #e0e0e0;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #0077ff;
    --text-secondary: #d400ff;
    --accent: #ff8800;
    --neon-glow: 0 0 5px rgba(0, 119, 255, 0.3);
    --neon-border: 1px solid rgba(0, 119, 255, 0.5);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease;
}

/* Background Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.03),
        rgba(0, 255, 0, 0.01),
        rgba(0, 0, 255, 0.03)
    );
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 9;
}

.container {
    width: 90%;
    max-width: 1000px;
    padding: 2rem;
    z-index: 1;
    animation: fadeIn 1s ease-out;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--text-secondary);
    padding-bottom: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-primary);
}

.logo span {
    color: var(--text-secondary);
    text-shadow: var(--neon-glow);
}

/* Main Clock */
.main-clock-section {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.clock-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 5px;
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 600px;
}

.neon-border {
    border: var(--neon-border);
    box-shadow: var(--neon-glow);
}

.time-display {
    font-size: 5rem;
    font-family: var(--font-mono);
    margin: 1rem 0;
    text-shadow: var(--neon-glow);
    animation: flicker 2s infinite;
}

.date-display, .day-display {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

/* Grid Sections */
.secondary-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    padding-left: 10px;
    letter-spacing: 2px;
}

.section-title span {
    color: var(--text-secondary);
}

/* World Clocks */
.world-clocks-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.world-clock-item {
    background: var(--card-bg);
    padding: 1rem;
    border-left: 2px solid var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-clock-info .city {
    font-size: 0.9rem;
    color: var(--accent);
}

.world-clock-info .time {
    font-family: var(--font-mono);
    font-size: 1.2rem;
}

/* Alarms */
.alarms-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.alarm-item {
    background: var(--card-bg);
    padding: 1rem;
    border-left: 2px solid var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons and Inputs */
.btn-neon {
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.btn-neon:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    box-shadow: var(--neon-glow);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

select, input[type="time"] {
    background: var(--bg-color);
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
    font-family: var(--font-mono);
    outline: none;
}

.add-zone, .add-alarm {
    display: flex;
    gap: 0.5rem;
}

/* Overlay & Modal */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.hidden {
    display: none;
}

.alarm-modal {
    text-align: center;
}

/* Animations */
@keyframes flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.4;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.glitch-text {
    font-size: 3rem;
    font-weight: 700;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.05em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.05em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em -0.05em 0 rgba(0, 0, 255, 0.75); }
}

@media (max-width: 768px) {
    .secondary-sections {
        grid-template-columns: 1fr;
    }
    .time-display {
        font-size: 3rem;
    }
}
