/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

/* Header */
header h1 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Timer section */
.timer-section {
    margin-bottom: 2rem;
}

.current-section h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 400;
}

.countdown-display {
    margin: 2rem 0;
}

#timer-display {
    font-size: 6rem;
    font-weight: 700;
    color: #667eea;
    font-family: 'Monaco', 'Consolas', monospace;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    display: block;
    line-height: 1;
}

.next-section {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: #718096;
}

.next-section span {
    font-weight: 600;
    color: #4a5568;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: #48bb78;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: #38a169;
}

.btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn.secondary:hover:not(:disabled) {
    background: #cbd5e0;
}

.btn.pause {
    background: #ed8936;
    color: white;
}

.btn.pause:hover:not(:disabled) {
    background: #dd6b20;
}

/* Progress info */
.progress-info {
    margin: 1rem 0;
    font-size: 1rem;
    color: #718096;
}

.progress-info span {
    font-weight: 600;
    color: #4a5568;
}

/* Routine setup */
.routine-setup {
    border-top: 2px solid #e2e8f0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.routine-setup h3 {
    color: #4a5568;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Routine editor */
.routine-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.add-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.add-section input {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.add-section input:focus {
    outline: none;
    border-color: #667eea;
}

#section-title-input {
    flex: 1;
    min-width: 120px;
}

#section-duration-input {
    width: 80px;
}

#add-section-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
}

#load-default-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #4299e1;
    color: white;
}

#load-default-btn:hover:not(:disabled) {
    background: #3182ce;
}

.routine-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.routine-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.2s ease;
    position: relative;
}

.routine-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.delete-section-btn {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: background-color 0.2s ease;
}

.delete-section-btn:hover {
    background: #c53030;
}

.routine-item.active {
    background: #ebf8ff;
    border-left-color: #667eea;
}

.routine-item.completed {
    background: #f0fff4;
    border-left-color: #48bb78;
    opacity: 0.7;
}

.section-name {
    font-weight: 500;
    color: #2d3748;
}

.section-duration {
    color: #718096;
    font-size: 0.9rem;
}

/* Finished state */
.finished {
    color: #48bb78;
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    #timer-display {
        font-size: 4rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}