/* ============================================
   FOCUSFLOW - POMODORO & OBJECTIFS
   Design System & Variables
   ============================================ */

:root {
    /* Couleurs principales */
    --color-primary: #ff6b35;
    --color-primary-dark: #e55a2b;
    --color-primary-light: #ff8c5a;
    --color-secondary: #4ecdc4;
    --color-accent: #ffe66d;
    
    /* Couleurs de fond */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --bg-hover: #2d2d4a;
    
    /* Couleurs de texte */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    
    /* États */
    --color-success: #4ecdc4;
    --color-warning: #ffe66d;
    --color-danger: #ff6b6b;
    
    /* Mode travail/pause */
    --mode-work: #ff6b35;
    --mode-short-break: #4ecdc4;
    --mode-long-break: #9b59b6;
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.3);
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordures */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Typography */
    --font-primary: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    position: relative;
}

.main-content {
    display: flex;
    flex-direction: column;
}

/* Background Particles */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-10px) translateX(-10px); }
    75% { transform: translateY(-30px) translateX(5px); }
}

/* ============================================
   Header
   ============================================ */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 1.8rem;
    animation: pulse 2s infinite ease-in-out;
}

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

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-settings {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.btn-settings:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(45deg);
}

/* ============================================
   Timer Section
   ============================================ */

.timer-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 5;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.timer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
}

/* Mode Buttons */
.timer-modes {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    background: var(--bg-card);
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
}

.mode-btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.mode-btn.active[data-mode="shortBreak"] {
    background: var(--mode-short-break);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.3);
}

.mode-btn.active[data-mode="longBreak"] {
    background: var(--mode-long-break);
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.3);
}

/* Timer Ring */
.timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.timer-ring {
    position: relative;
    width: 260px;
    height: 260px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 10px var(--color-primary));
}

.timer-progress.short-break {
    stroke: var(--mode-short-break);
    filter: drop-shadow(0 0 10px var(--mode-short-break));
}

.timer-progress.long-break {
    stroke: var(--mode-long-break);
    filter: drop-shadow(0 0 10px var(--mode-long-break));
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-time {
    display: block;
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.timer-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Timer Controls */
.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.btn-control {
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.btn-reset,
.btn-skip {
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    color: var(--text-secondary);
}

.btn-reset:hover,
.btn-skip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-play {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.5);
}

.btn-play:active {
    transform: scale(0.95);
}

.btn-play .icon-pause {
    display: none;
}

.btn-play.playing .icon-play {
    display: none;
}

.btn-play.playing .icon-pause {
    display: block;
}

.hidden {
    display: none !important;
}

/* Session Counter */
.session-counter {
    text-align: center;
}

.session-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.session-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    transition: var(--transition-base);
}

.dot.completed {
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    animation: dotPop 0.3s ease;
}

@keyframes dotPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ============================================
   Goals Section
   ============================================ */

.goals-section {
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 5;
}

.goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.goals-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-new-goal {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-new-goal:hover {
    background: var(--color-primary);
    color: white;
}

/* Goal Card */
.goal-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.goal-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.goal-card.has-goal::after {
    transform: scaleX(1);
}

/* Empty State */
.goal-empty {
    text-align: center;
    padding: var(--spacing-xl);
}

.goal-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.goal-empty p {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.goal-empty span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Active Goal */
.goal-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.goal-info {
    text-align: center;
}

.goal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.goal-interval {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.goal-interval span {
    color: var(--color-secondary);
    font-weight: 600;
}

/* Goal Progress Ring */
.goal-progress-container {
    position: relative;
}

.goal-progress-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.goal-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 10;
}

.progress-fill {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 339.29;
    stroke-dashoffset: 339.29;
    transition: stroke-dashoffset 0.5s ease;
    filter: drop-shadow(0 0 8px var(--color-secondary));
}

.goal-progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.goal-current {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
}

.goal-separator {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.goal-target {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Complete Task Button */
.btn-complete-task {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 280px;
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--color-secondary), #3db8b0);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
}

.btn-complete-task:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(78, 205, 196, 0.4);
}

.btn-complete-task:active {
    transform: scale(0.98);
}

.btn-complete-icon {
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.btn-complete-task:hover .btn-complete-icon {
    transform: scale(1.2);
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: none;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Goal Stats */
.goal-stats {
    display: flex;
    gap: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--bg-card);
    width: 100%;
    justify-content: center;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Delete Goal Button */
.btn-delete-goal {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-delete-goal:hover {
    color: var(--color-danger);
}

/* ============================================
   History Section
   ============================================ */

.history-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 5;
}

.history-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 200px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--spacing-md);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-icon {
    font-size: 1.25rem;
}

.history-text {
    flex: 1;
    font-size: 0.875rem;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--bg-card);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close-modal {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:hover {
    background: var(--color-danger);
    color: white;
}

.modal-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.setting-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.setting-group input[type="number"],
.setting-group input[type="text"],
.setting-group select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition-base);
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 28px;
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-base);
}

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

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--bg-card);
}

.btn-save {
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Celebration Effects
   ============================================ */

.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

.celebration-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-accent);
    text-shadow: 0 0 30px var(--color-accent);
    animation: celebrationPop 0.6s ease-out;
    pointer-events: none;
    z-index: 10000;
}

@keyframes celebrationPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.milestone-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 4px solid var(--color-accent);
    border-radius: 50%;
    animation: ringExpand 0.8s ease-out forwards;
}

@keyframes ringExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .app-container {
        padding: var(--spacing-sm);
    }
    
    .timer-section {
        padding: var(--spacing-lg);
    }
    
    .timer-modes {
        flex-wrap: wrap;
    }
    
    .mode-btn {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .timer-ring {
        width: 220px;
        height: 220px;
    }
    
    .timer-time {
        font-size: 2.8rem;
    }
    
    .btn-play {
        width: 70px;
        height: 70px;
    }
    
    .btn-reset,
    .btn-skip {
        width: 44px;
        height: 44px;
    }
    
    .goals-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
    
    .btn-new-goal {
        width: 100%;
        justify-content: center;
    }
    
    .goal-stats {
        gap: var(--spacing-lg);
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .celebration-text {
        font-size: 2rem;
    }
}

@media (max-width: 360px) {
    .timer-ring {
        width: 180px;
        height: 180px;
    }
    
    .timer-time {
        font-size: 2.2rem;
    }
    
    .timer-controls {
        gap: var(--spacing-md);
    }
}

/* Tablet screens */
@media (min-width: 768px) {
    .app-container {
        padding: var(--spacing-xl);
        max-width: 700px;
    }
    
    .timer-ring {
        width: 280px;
        height: 280px;
    }
    
    .timer-time {
        font-size: 3.5rem;
    }
}

/* Small desktop / Tablet landscape - 2 columns */
@media (min-width: 900px) {
    body {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        min-height: 100vh;
        padding: var(--spacing-md);
    }

    .app-container {
        max-width: 1000px;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "header header"
            "timer goals"
            "timer estimation"
            "history estimation";
        gap: var(--spacing-md);
        padding: var(--spacing-md);
        align-items: start;
    }

    .app-header {
        grid-area: header;
        margin-bottom: 0;
    }

    .main-content {
        display: contents;
    }

    .timer-section {
        grid-area: timer;
        margin-bottom: 0;
        position: sticky;
        top: var(--spacing-md);
    }

    .goals-section {
        grid-area: goals;
        margin-bottom: 0;
    }

    .estimation-section {
        grid-area: estimation;
        margin-bottom: 0;
        max-height: calc(100vh - 100px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .estimation-content {
        overflow-y: auto;
        flex: 1;
        padding-right: var(--spacing-xs);
    }

    .history-section {
        grid-area: history;
        margin-bottom: 0;
    }

    .timer-ring {
        width: 220px;
        height: 220px;
    }

    .timer-time {
        font-size: 2.8rem;
    }
}

/* Desktop screens - Full layout */
@media (min-width: 1200px) {
    body {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        min-height: 100vh;
        padding: var(--spacing-lg);
    }

    .app-container {
        max-width: 1400px;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "header header header"
            "timer goals estimation"
            "timer history estimation";
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
        align-items: start;
    }

    .app-header {
        grid-area: header;
        margin-bottom: 0;
    }

    .main-content {
        display: contents;
    }

    .timer-section {
        grid-area: timer;
        margin-bottom: 0;
        height: fit-content;
        position: sticky;
        top: var(--spacing-lg);
    }

    .timer-ring {
        width: 240px;
        height: 240px;
    }

    .timer-time {
        font-size: 3rem;
    }

    .goals-section {
        grid-area: goals;
        margin-bottom: 0;
    }

    .goal-card {
        min-height: 300px;
        display: flex;
        flex-direction: column;
    }

    .goal-active {
        flex: 1;
        justify-content: space-between;
    }

    .estimation-section {
        grid-area: estimation;
        margin-bottom: 0;
        max-height: calc(100vh - 100px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .estimation-content {
        gap: var(--spacing-md);
        overflow-y: auto;
        flex: 1;
        padding-right: var(--spacing-sm);
    }

    .history-section {
        grid-area: history;
        margin-bottom: 0;
    }

    .history-list {
        max-height: 250px;
    }

    /* Ajustements pour le timer */
    .timer-modes {
        margin-bottom: var(--spacing-lg);
    }

    .timer-container {
        margin-bottom: var(--spacing-lg);
    }

    .timer-controls {
        margin-bottom: var(--spacing-lg);
    }

    .btn-play {
        width: 70px;
        height: 70px;
    }

    .btn-reset,
    .btn-skip {
        width: 46px;
        height: 46px;
    }

    /* Ajustements estimation */
    .result-main {
        padding: var(--spacing-lg);
    }

    .result-main .result-value {
        font-size: 2.5rem;
    }

    .result-main .result-icon {
        font-size: 2.5rem;
    }

    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .result-small .result-value {
        font-size: 1.25rem;
    }

    /* Goals ajustements */
    .goal-progress-ring {
        width: 120px;
        height: 120px;
    }

    .goal-current {
        font-size: 1.75rem;
    }

    .btn-complete-task {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
}

/* Extra large screens */
@media (min-width: 1600px) {
    .app-container {
        max-width: 1600px;
        gap: var(--spacing-xl);
    }

    .timer-ring {
        width: 280px;
        height: 280px;
    }

    .timer-time {
        font-size: 3.5rem;
    }

    .result-main .result-value {
        font-size: 3rem;
    }

    .results-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }

    .goal-progress-ring {
        width: 140px;
        height: 140px;
    }

    .history-list {
        max-height: 300px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .app-container {
        max-width: 1800px;
    }

    .timer-section {
        padding: var(--spacing-2xl);
    }

    .timer-ring {
        width: 300px;
        height: 300px;
    }

    .timer-time {
        font-size: 4rem;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #f5f5f7;
        --bg-secondary: #ffffff;
        --bg-card: #e8e8ed;
        --bg-hover: #d8d8e0;
        --text-primary: #1a1a2e;
        --text-secondary: #5a5a70;
        --text-muted: #8a8a9a;
    }
    
    .timer-progress {
        filter: drop-shadow(0 0 5px var(--color-primary));
    }
    
    .progress-fill {
        filter: drop-shadow(0 0 4px var(--color-secondary));
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Estimation section specific scrollbar */
.estimation-content::-webkit-scrollbar {
    width: 8px;
}

.estimation-content::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
    margin: 4px 0;
}

.estimation-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 4px;
}

.estimation-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-primary-light), var(--color-secondary));
}

/* Firefox scrollbar */
.estimation-content {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--bg-card);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   Estimation Section
   ============================================ */

.estimation-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 5;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.estimation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary), var(--color-secondary));
}

.estimation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.estimation-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-toggle-estimation {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.btn-toggle-estimation:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-toggle-estimation.collapsed svg {
    transform: rotate(-90deg);
}

.estimation-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: var(--spacing-xs);
}

.estimation-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Config inputs */
.estimation-config {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.config-row label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.config-input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.config-input-group input {
    width: 70px;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    text-align: center;
    transition: var(--transition-base);
}

.config-input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.config-input-group span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-calculate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-accent), #e6c200);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 230, 109, 0.3);
}

/* Results */
.estimation-results {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    transition: var(--transition-base);
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.result-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
    border: 2px solid var(--color-accent);
}

.result-main .result-icon {
    font-size: 3rem;
}

.result-main .result-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.result-main .result-value {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.result-main .result-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.result-small .result-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.result-small .result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Timeline */
.estimation-timeline {
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.estimation-timeline h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.timeline-bar {
    display: flex;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
}

.timeline-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: var(--transition-base);
}

.timeline-segment:hover {
    filter: brightness(1.1);
}

.timeline-segment.work {
    background: var(--mode-work);
}

.timeline-segment.short-break {
    background: var(--mode-short-break);
}

.timeline-segment.long-break {
    background: var(--mode-long-break);
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.work {
    background: var(--mode-work);
}

.legend-color.short-break {
    background: var(--mode-short-break);
}

.legend-color.long-break {
    background: var(--mode-long-break);
}

/* Progress Tracker */
.estimation-progress-tracker {
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.estimation-progress-tracker h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* Time Summary */
.time-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
}

.time-block .time-icon {
    font-size: 1.5rem;
}

.time-block .time-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.time-block.start .time-value {
    color: var(--color-secondary);
}

.time-block.end .time-value {
    color: var(--color-primary);
}

.time-block .time-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Detailed Schedule */
.detailed-schedule {
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.detailed-schedule h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 200px;
    overflow-y: auto;
}

.schedule-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--spacing-md);
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.schedule-item:hover {
    background: var(--bg-hover);
}

.schedule-item.work {
    border-left: 3px solid var(--mode-work);
}

.schedule-item.short-break {
    border-left: 3px solid var(--mode-short-break);
}

.schedule-item.long-break {
    border-left: 3px solid var(--mode-long-break);
}

.schedule-time {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 110px;
}

.schedule-time .time-separator {
    color: var(--text-muted);
    margin: 0 var(--spacing-xs);
}

.schedule-type {
    flex: 1;
    color: var(--text-secondary);
}

.schedule-item.work .schedule-type {
    color: var(--mode-work);
}

.schedule-item.short-break .schedule-type {
    color: var(--mode-short-break);
}

.schedule-item.long-break .schedule-type {
    color: var(--mode-long-break);
}

.schedule-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.schedule-copies {
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
}

/* Current schedule item highlight */
.schedule-item.current {
    background: rgba(255, 107, 53, 0.1);
    border-left-width: 4px;
}

.schedule-item.current::after {
    content: '◀ maintenant';
    font-size: 0.625rem;
    color: var(--color-primary);
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-item.completed {
    opacity: 0.5;
}

.schedule-item.completed .schedule-type::after {
    content: ' ✓';
    color: var(--color-success);
}

/* Responsive adjustments for schedule */
@media (max-width: 480px) {
    .time-summary {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .time-block .time-value {
        font-size: 1.25rem;
    }
    
    .time-arrow {
        font-size: 1.25rem;
    }
    
    .schedule-time {
        min-width: 90px;
        font-size: 0.75rem;
    }
    
    .schedule-item {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .schedule-copies {
        display: none;
    }
}

.progress-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-bar {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-bar-fill.real {
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
}

.progress-bar-fill.theoretical {
    background: var(--text-muted);
    opacity: 0.5;
}

.progress-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.progress-status.ahead {
    color: var(--color-success);
    background: rgba(78, 205, 196, 0.1);
}

.progress-status.behind {
    color: var(--color-danger);
    background: rgba(255, 107, 107, 0.1);
}

.progress-status.on-track {
    color: var(--color-accent);
    background: rgba(255, 230, 109, 0.1);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .config-input-group {
        width: 100%;
    }
    
    .config-input-group input {
        flex: 1;
    }
    
    .result-main {
        flex-direction: column;
        text-align: center;
    }
    
    .result-main .result-info {
        align-items: center;
    }
    
    .result-main .result-value {
        font-size: 2.5rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-legend {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
}
