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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f9fa;
    height: 100vh;
    display: flex;
    color: #2d3748;
    transition: background-color 0.4s ease;
}

.taskbar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 80px 24px 24px 24px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.task-input {
    display: flex;
    margin-bottom: 32px;
    gap: 0;
}

.task-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    outline: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.task-input input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.task-input button {
    width: 50px;
    background: #2d3748;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.task-input button:hover {
    background: #1a202c;
}

.task-input button:active {
    transform: scale(0.98);
}

.tasks h4 {
    margin: 24px 0 12px 0;
    color: #718096;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tasks ul {
    list-style: none;
    margin-bottom: 24px;
}

.tasks li {
    padding: 12px 16px;
    background: #f7fafc;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    font-size: 14px;
}

.tasks li:hover {
    background: #edf2f7;
    border-color: #e2e8f0;
    transform: translateX(2px);
}

.tasks li.completed {
    text-decoration: line-through;
    opacity: 0.6;
    background: #f0fff4;
    color: #38a169;
}

.delete-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.delete-btn:hover {
    background: #c53030;
    opacity: 1;
    transform: scale(1.05);
}

.session-stats {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 14px;
    margin-bottom: 24px;
}

.settings-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}

.settings-section h4 {
    margin-bottom: 16px;
    color: #718096;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.setting-item label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.setting-item input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.setting-item input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

#applySettings {
    width: 100%;
    padding: 10px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    transition: all 0.2s ease;
}

#applySettings:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

#applySettings:active {
    transform: translateY(0) scale(0.98);
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.4s ease;
}

.timer-container {
    text-align: center;
}

.timer-circle {
    position: relative;
    margin-bottom: 40px;
    width: 280px;
    height: 280px;
    margin-left: auto;
    margin-right: auto;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 280px;
    height: 280px;
}

.progress-ring-circle {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 3;
    fill: transparent;
    stroke-dasharray: 829.38;
    stroke-dashoffset: 829.38;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-linecap: square;
}

.timer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.time-display {
    font-size: 56px;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: -2px;
    font-feature-settings: 'tnum';
}

.timer-mode {
    font-size: 16px;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.controls button {
    padding: 14px 24px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
    border-radius: 4px;
}

#startBtn {
    background: #48bb78;
    color: white;
}

#startBtn:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

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

#startBtn.pause:hover {
    background: #dd6b20;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

#resetBtn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#resetBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

#newCycleBtn {
    background: #9f7aea;
    color: white;
}

#newCycleBtn:hover {
    background: #805ad5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(159, 122, 234, 0.3);
}

.controls button:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

.study-mode .progress-ring-circle {
    stroke: #48bb78;
}

.study-mode .main-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.break-mode .progress-ring-circle {
    stroke: #ed8936;
}

.break-mode .main-content {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-button button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #4a5568;
}

.back-button button:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .taskbar {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .timer-circle {
        transform: scale(0.85);
        margin-bottom: 20px;
    }
    
    .time-display {
        font-size: 48px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .controls button {
        padding: 12px 20px;
        min-width: 80px;
        font-size: 12px;
    }
}

/* Animazioni di ingresso */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tasks li {
    animation: fadeInUp 0.3s ease;
}

/* Transizioni smooth per il cambio modalità */
body.study-mode .main-content,
body.break-mode .main-content {
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
