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

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease;
    cursor: none;
}

/* Show cursor over modal */
#controls {
    cursor: default;
}

#controls * {
    cursor: default;
}

#timer-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

#time-text {
    font-size: 8rem;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
}

#phase-indicator {
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#controls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#controls.controls-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#controls.controls-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.control-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.control-panel h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.control-panel h3 {
    margin: 1.5rem 0 1rem 0;
    color: #555;
    font-size: 1.1rem;
}

.config-section {
    margin-bottom: 1.5rem;
}

.config-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.config-section input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.config-section input[type="number"]:focus {
    outline: none;
    border-color: #4CAF50;
}

.phase-config {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.phase-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.phase-config label {
    flex: 1;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.phase-config input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    margin: 0;
}

.phase-config input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.control-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.primary-btn, .secondary-btn, .restart-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #4CAF50;
    color: white;
}

.primary-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.secondary-btn {
    background: #f44336;
    color: white;
}

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

.restart-btn {
    background: #ff9800;
    color: white;
}

.restart-btn:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Sound Controls */
.sound-controls {
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sound-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.sound-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.sound-controls input[type="file"] {
    font-size: 0.8rem;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.file-picker-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #007bff;
    border-radius: 4px;
    background: #f8f9fa;
    color: #007bff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker-btn:hover {
    background: #e9ecef;
    border-color: #0056b3;
}

.file-picker-btn:active {
    background: #dee2e6;
    transform: translateY(1px);
}

/* Timer running state */
body.timer-running {
    cursor: none;
}

body.timer-running #controls {
    cursor: default;
}

/* Responsive design */
@media (max-width: 768px) {
    #time-text {
        font-size: 4rem;
    }
    
    .control-panel {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .phase-config {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .phase-config input[type="number"] {
        width: 100%;
    }
    
    .control-buttons {
        flex-direction: column;
    }
}
