:root {
    --bg-main: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --accent-blue: #3498db;
    --accent-blue-hover: #2980b9;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --preset-bg: #e8eaed;
    --preset-active-bg: #dbeafe;
    --preset-active-text: #2563eb;
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.timer-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.08);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(4rem, 18vw, 8rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    line-height: 1;
    transition: color 0.3s ease, transform 0.2s ease;
    user-select: none;
}

.time-display.running {
    color: var(--accent-blue);
}

.time-display.completed {
    color: var(--accent-green);
    animation: pulse 1s ease-in-out infinite;
}

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

.progress-container {
    width: 90%;
    height: 10px;
    background: var(--preset-bg);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #5dade2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-bar.animating {
    transition: width 1s linear;
}

.presets-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: var(--preset-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: #dcdfe3;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: var(--preset-active-bg);
    color: var(--preset-active-text);
}

.controls-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.control-btn .btn-icon {
    font-size: 1.1rem;
}

.control-btn.primary {
    background: var(--accent-blue);
    color: white;
    min-width: 130px;
    justify-content: center;
}

.control-btn.primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.35);
}

.control-btn.secondary {
    background: var(--preset-bg);
    color: var(--text-primary);
}

.control-btn.secondary:hover {
    background: #dcdfe3;
    transform: translateY(-2px);
}

.shortcuts-hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.shortcuts-hint span:not(.hint-label):not(.hint-divider) {
    font-family: 'JetBrains Mono', monospace;
    background: var(--preset-bg);
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.hint-label {
    opacity: 0.7;
}

.hint-divider {
    opacity: 0.4;
    margin: 0 4px;
}

.footer {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
}

/* Fullscreen Mode */
.fullscreen-mode {
    position: fixed;
    inset: 0;
    background: #0d0d0f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
}

.fullscreen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 90%;
    max-width: 800px;
}

.fullscreen-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(6rem, 20vw, 15rem);
    font-weight: 800;
    color: #f0f0f0;
    letter-spacing: -0.05em;
    line-height: 1;
    text-shadow: 0 0 60px rgba(46, 204, 113, 0.3);
}

.fullscreen-time.completed {
    color: var(--accent-green);
    animation: fullscreen-pulse 1.5s ease-in-out infinite;
}

@keyframes fullscreen-pulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 60px rgba(46, 204, 113, 0.3);
    }
    50% { 
        transform: scale(1.03);
        text-shadow: 0 0 100px rgba(46, 204, 113, 0.5);
    }
}

.fullscreen-progress-container {
    width: 100%;
    height: 14px;
    background: #2a2a2f;
    border-radius: 14px;
    overflow: hidden;
}

.fullscreen-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #58d68d);
    border-radius: 14px;
    transition: width 1s linear;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

.fullscreen-hint {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .timer-card {
        padding: 32px 20px;
        gap: 24px;
    }
    
    .preset-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    
    .control-btn {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .control-btn.primary {
        min-width: 110px;
    }
    
    .shortcuts-hint {
        display: none;
    }
}