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

:root {
    --primary-gradient: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    --work-gradient: linear-gradient(135deg, rgba(255, 107, 107, 0.9) 0%, rgba(255, 142, 142, 0.9) 100%);
    --break-gradient: linear-gradient(135deg, rgba(78, 205, 196, 0.9) 0%, rgba(68, 160, 141, 0.9) 100%);
    --long-break-gradient: linear-gradient(135deg, rgba(168, 237, 234, 0.9) 0%, rgba(254, 214, 227, 0.9) 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Dynamic nature background */
.nature-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.nature-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 180, 120, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(180, 120, 180, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 150, 200, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.nature-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="tree" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(34,139,34,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(34,139,34,0);stop-opacity:0" /></radialGradient></defs><circle cx="15" cy="25" r="8" fill="url(%23tree)" /><circle cx="85" cy="75" r="12" fill="url(%23tree)" /><circle cx="70" cy="20" r="6" fill="url(%23tree)" /><circle cx="25" cy="80" r="10" fill="url(%23tree)" /></svg>');
    opacity: 0.4;
    animation: sway 25s ease-in-out infinite;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes sway {
    0%, 100% { transform: translateX(0px); }
    25% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* Enhanced particles with nature theme */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

.particle.leaf {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(34, 139, 34, 0.6) 0%, rgba(34, 139, 34, 0.2) 100%);
    animation: leafFall 12s linear infinite;
}

.particle.pollen {
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.7) 0%, rgba(255, 215, 0, 0.1) 100%);
    animation: pollenFloat 15s ease-in-out infinite;
}

.particle.bubble {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
    animation: bubbleRise 10s ease-in-out infinite;
}

@keyframes leafFall {
    0% { 
        transform: translateY(-10px) translateX(0px) rotate(0deg); 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(100vh) translateX(50px) rotate(360deg); 
        opacity: 0; 
    }
}

@keyframes pollenFloat {
    0%, 100% { 
        transform: translateY(0px) translateX(0px); 
        opacity: 0.3; 
    }
    50% { 
        transform: translateY(-30px) translateX(20px); 
        opacity: 0.8; 
    }
}

@keyframes bubbleRise {
    0% { 
        transform: translateY(100vh) scale(0.5); 
        opacity: 0; 
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { 
        transform: translateY(-10px) scale(1.2); 
        opacity: 0; 
    }
}

.timer-container {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 35px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 10;
    animation: slideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.session-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: all 0.3s ease;
}

.session-dot.completed {
    background: #4caf50;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.2); 
    }
    to { 
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4); 
    }
}

.timer-circle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 30px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.progress-ring-circle {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 10;
    fill: transparent;
    r: 130;
    cx: 150;
    cy: 150;
    transition: stroke-dasharray 0.5s ease-in-out;
}

.progress-ring-progress {
    stroke: var(--text-primary);
    stroke-width: 10;
    fill: transparent;
    r: 130;
    cx: 150;
    cy: 150;
    stroke-linecap: round;
    stroke-dasharray: 817;
    stroke-dashoffset: 817;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 52px;
    font-weight: 300;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.timer-display.pulse {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

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

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(56, 142, 60, 0.4));
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.4), rgba(245, 124, 0, 0.4));
}

.btn-danger {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.4), rgba(211, 47, 47, 0.4));
}

.settings {
    display: flex;
    justify-content: space-around;
    margin-top: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.setting-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.setting-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-btn {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.setting-value {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 35px;
    text-align: center;
    font-size: 16px;
}

.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.sound-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.sound-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Audio visualization */
.audio-visualizer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    opacity: 0.6;
}

.bar {
    width: 3px;
    height: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.8));
    border-radius: 2px;
    animation: audioBar 1.5s ease-in-out infinite;
}

.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes audioBar {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Responsive Design */
@media (max-width: 640px) {
    .timer-container {
        padding: 30px 25px;
        margin: 15px;
    }

    .timer-circle {
        width: 260px;
        height: 260px;
    }

    .progress-ring-circle,
    .progress-ring-progress {
        r: 110;
        cx: 130;
        cy: 130;
    }

    .timer-display {
        font-size: 42px;
    }

    .status {
        font-size: 26px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .controls {
        gap: 15px;
    }

    .settings {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .timer-circle {
        width: 220px;
        height: 220px;
    }

    .progress-ring-circle,
    .progress-ring-progress {
        r: 90;
        cx: 110;
        cy: 110;
    }

    .timer-display {
        font-size: 36px;
    }

    .session-counter {
        flex-direction: column;
        gap: 15px;
    }

    .sound-controls {
        top: 15px;
        right: 15px;
    }

    .stats {
        gap: 30px;
    }
}

/* Theme transitions */
.theme-work {
    background: var(--work-gradient);
}

.theme-break {
    background: var(--break-gradient);
}

.theme-long-break {
    background: var(--long-break-gradient);
}
