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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1e1e2e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Animated background particles */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s linear infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.clock-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 40px;
    border-radius: 30px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: containerGlow 3s ease-in-out infinite alternate;
    max-width: 700px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.clock-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent,
            rgba(64, 224, 208, 0.1),
            rgba(255, 20, 147, 0.1),
            transparent);
    animation: rotate 8s linear infinite;
    z-index: -1;
}

@keyframes containerGlow {
    0% {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    100% {
        box-shadow: 0 25px 80px rgba(64, 224, 208, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.time-zone {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.date {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-weight: 300;
    animation: textGlow 2s ease-in-out infinite alternate;
}

.clock {
    font-size: 72px;
    font-weight: 100;
    background: linear-gradient(135deg,
            #40e0d0,
            #ff1493,
            #00bfff,
            #ff6347);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 3s ease-in-out infinite,
        clockPulse 2s ease-in-out infinite alternate;
    letter-spacing: 8px;
    margin-bottom: 40px;
    position: relative;
    text-shadow: 0 0 30px rgba(64, 224, 208, 0.3);
}

@keyframes rainbowShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes clockPulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.02);
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }

    100% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

.seconds-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 30px 0;
    overflow: hidden;
    position: relative;
}

.seconds-fill {
    height: 100%;
    background: linear-gradient(90deg, #40e0d0, #ff1493);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.5);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: rgba(64, 224, 208, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(64, 224, 208, 0.3);
}

.control-btn.active {
    background: linear-gradient(135deg, #40e0d0, #ff1493);
    border-color: transparent;
    box-shadow: 0 0 25px rgba(64, 224, 208, 0.5);
}

.weather-info {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.weather-info.active {
    display: block;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.stopwatch {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.stopwatch.active {
    display: block;
    animation: slideUp 0.5s ease;
}

.stopwatch-time {
    font-size: 36px;
    color: #40e0d0;
    font-weight: 300;
    margin-bottom: 15px;
}

.alarm-section {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.alarm-section.active {
    display: block;
    animation: slideUp 0.5s ease;
}

.alarm-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    margin: 10px;
    font-size: 16px;
}

.alarm-input:focus {
    outline: none;
    border-color: #40e0d0;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .clock-container {
        padding: 40px 25px;
        margin: 20px;
    }

    .clock {
        font-size: 48px;
        letter-spacing: 4px;
    }

    .date {
        font-size: 22px;
    }

    .controls {
        gap: 10px;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .clock-container {
        padding: 30px 20px;
    }

    .clock {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .date {
        font-size: 18px;
    }

    .stopwatch-time {
        font-size: 28px;
    }
}

/* Dark mode toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 3px;
    transition: all 0.3s ease;
}

.theme-toggle::before {
    content: '';
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #40e0d0, #ff1493);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.5);
}

.clock-container:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}