:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --primary: #00e5ff;
    /* Cyan Neon */
    --secondary: #bd00ff;
    /* Purple Neon */
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --danger: #ff2a6d;
    --success: #05ff00;

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --glow-primary: 0 0 20px rgba(0, 229, 255, 0.4);
    --glow-secondary: 0 0 20px rgba(189, 0, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

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

/* Background Ambient */
.ambient-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, rgba(189, 0, 255, 0.05) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
}

/* Header */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

.logo .highlight {
    color: var(--primary);
    text-shadow: var(--glow-primary);
}

.mode-selector {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4px;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.settings-btn {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.settings-btn:hover {
    color: var(--text-main);
}

/* Main Timer */
.timer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.timer-ring-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke 0.5s ease;
    stroke: var(--primary);
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.time-display {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-value {
    font-family: var(--font-mono);
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.time-value:focus {
    border-bottom-color: var(--primary);
}

.time-label {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.2rem;
    margin-top: 10px;
    font-weight: 600;
}

/* Controls */
.controls {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
}

.main-btn.running {
    background: linear-gradient(135deg, #ff2a6d, #ff6b6b);
    box-shadow: 0 0 40px rgba(255, 42, 109, 0.2);
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-2px);
}

/* Presets */
.presets-bar {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 8px;
    display: flex;
    gap: 10px;
    backdrop-filter: blur(20px);
    margin-bottom: 2rem;
}

.preset-pill {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 70px;
}

.preset-pill:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.preset-pill.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .progress-ring {
        transform: rotate(-90deg) scale(0.8);
    }

    .timer-ring-wrapper {
        width: 320px;
        height: 320px;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #101010;
    width: 300px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 20px;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.params-info {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card-bg);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Range Slider */
.slider-range {
    -webkit-appearance: none;
    width: 50%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

.slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    transition: transform 0.2s;
}

.slider-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}