/* ============================================
   WIDGETS TIMERS v5.0.0 — 3 LAYOUTS DISTINCTS
   Chrono (indigo), Timer (ambre), Pomodoro (rouge)
   ============================================ */

/* Header center wrapper */
.header-center {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    flex: 1;
    justify-content: center;
}

/* Container principal */
.timers-widgets-container {
    display: flex;
    gap: var(--spacing-sm, 6px);
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: var(--spacing-xs, 4px) var(--spacing-sm, 6px);
    background: linear-gradient(135deg, var(--glass-bg, rgba(255,255,255,0.7)) 0%, rgba(255,255,255,0.05) 100%);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
    border-radius: var(--radius-xl, 16px);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    max-width: fit-content;
}

.timers-widgets-container:hover {
    border-color: var(--glass-border-hover, rgba(99,102,241,0.3));
    box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}

/* ============================================
   SÉLECTEUR DE MODE
   ============================================ */

.timer-mode-selector {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.timer-mode-btn {
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    opacity: 0.5;
}

.timer-mode-btn:hover {
    background: var(--glass-layer-3, rgba(0,0,0,0.05));
    opacity: 0.8;
}

.timer-mode-btn.active {
    color: white;
    opacity: 1;
}

/* ============================================
   SÉPARATEUR
   ============================================ */

.timer-separator {
    width: 1px;
    height: 20px;
    background: var(--glass-border, rgba(255,255,255,0.2));
    flex-shrink: 0;
}

/* ============================================
   ZONE DES WIDGETS
   ============================================ */

.timer-widget-zone {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 4px);
    position: relative;
    min-height: 32px;
}

.timer-panel {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 4px);
    animation: timerPanelIn 0.2s ease-out;
    position: relative;
}

.timer-panel.hidden {
    display: none !important;
}

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

.timer-panel.starting {
    animation: timerPanelIn 0.2s ease-out;
}

/* ============================================
   BOUTONS (base)
   ============================================ */

.timer-controls {
    display: flex;
    gap: 2px;
    align-items: center;
}

.timer-btn {
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.timer-btn:hover {
    background: var(--glass-layer-3, rgba(0,0,0,0.05));
}

.timer-btn.active {
    color: white;
}

/* ============================================
   CHRONO — Layout minimaliste, palette INDIGO
   ============================================ */

.mode-stopwatch .timer-mode-btn.active {
    background: var(--primary-color, #6366f1);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.mode-stopwatch .timer-mode-btn:hover {
    color: var(--primary-color, #6366f1);
}
.timers-widgets-container.mode-stopwatch {
    border-color: rgba(99,102,241,0.2);
}
.timers-widgets-container.mode-stopwatch:hover {
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}

/* Chrono : pas d'inputs, layout épuré */
#panel-stopwatch {
    align-items: center;
}

#panel-stopwatch .timer-display {
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 65px;
    text-align: center;
    letter-spacing: 0.03em;
    color: var(--text-primary, #111827);
}

/* Chrono colors */
.mode-stopwatch .stopwatch-btn-start { color: var(--primary-color, #6366f1); }
.mode-stopwatch .stopwatch-btn-start:hover { background: rgba(99,102,241,0.1); }
.mode-stopwatch .stopwatch-btn-lap { color: var(--primary-color, #6366f1); }
.mode-stopwatch .stopwatch-btn-lap:hover { background: rgba(99,102,241,0.1); }

#panel-stopwatch .timer-display.running {
    color: var(--primary-color, #6366f1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 10px rgba(99,102,241,0.3);
}

#panel-stopwatch .progress-ring-circle {
    stroke: var(--primary-color, #6366f1);
}

#panel-stopwatch .timer-btn.active {
    background: var(--primary-color, #6366f1);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* ============================================
   TIMER — Layout structuré, palette AMBRE
   ============================================ */

.timer-settings-btn {
    color: var(--text-muted, #9ca3af);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.timer-settings-btn:hover {
    opacity: 1;
    transform: rotate(30deg);
}

.mode-timer .timer-mode-btn.active {
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.mode-timer .timer-mode-btn:hover {
    color: #f59e0b;
}
.timers-widgets-container.mode-timer {
    border-color: rgba(245,158,11,0.2);
}
.timers-widgets-container.mode-timer:hover {
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 4px 20px rgba(245,158,11,0.15);
}

/* Timer : inputs visibles quand arrêté */
.timer-input-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 4px);
}

.timer-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.timer-input-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
    letter-spacing: 0.05em;
    line-height: 1;
}

.timer-input {
    width: 40px;
    padding: 3px 4px;
    border: 1.5px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-primary, white);
    color: var(--text-primary, #111827);
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease;
}

.timer-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.1);
}

.timer-input-separator {
    color: var(--text-muted, #9ca3af);
    font-weight: 600;
    font-size: 0.85rem;
}

.timer-presets {
    display: flex;
    gap: 2px;
}

.timer-preset {
    padding: 2px 6px;
    border: 1px solid var(--border-color, #d1d5db);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timer-preset:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

/* Timer display */
#panel-timer .timer-display {
    font-family: var(--font-mono, monospace);
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    color: #f59e0b;
}

#panel-timer .timer-display.running {
    color: #f59e0b;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 10px rgba(245,158,11,0.3);
}

#panel-timer .timer-display.paused {
    color: #d97706;
}

#panel-timer .timer-display.ended {
    color: #ef4444;
    animation: pulse-danger 1s ease-in-out infinite;
}

/* Timer buttons */
.mode-timer .timer-btn-start { color: #f59e0b; }
.mode-timer .timer-btn-start:hover { background: rgba(245,158,11,0.1); }
.mode-timer .timer-btn-pause { color: #d97706; }
.mode-timer .timer-btn-pause:hover { background: rgba(217,119,6,0.1); }
.mode-timer .timer-btn-stop { color: #ef4444; }
.mode-timer .timer-btn-stop:hover { background: rgba(239,68,68,0.1); }

/* Timer progress ring */
#panel-timer .progress-ring-circle {
    stroke: #f59e0b;
}

/* Timer settings gear */
.mode-timer .timer-settings-btn {
    color: var(--text-muted, #9ca3af);
    opacity: 0.6;
}

.mode-timer .timer-settings-btn:hover {
    opacity: 1;
    color: #f59e0b;
    transform: rotate(30deg);
}

/* Timer settings dropdown */
.timer-settings-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    padding: 8px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
}

.timer-settings-dropdown.hidden {
    display: none !important;
}

.timer-settings-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 6px;
    padding: 0 2px;
}

.timer-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.timer-settings-option {
    padding: 4px 2px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.timer-settings-option:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.timer-settings-option.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

/* ============================================
   POMODORO — Layout productif, palette ROUGE
   ============================================ */

.mode-pomodoro .timer-mode-btn.active {
    background: var(--danger-color, #ef4444);
    box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.mode-pomodoro .timer-mode-btn:hover {
    color: var(--danger-color, #ef4444);
}
.timers-widgets-container.mode-pomodoro {
    border-color: rgba(239,68,68,0.2);
}
.timers-widgets-container.mode-pomodoro:hover {
    border-color: rgba(239,68,68,0.4);
    box-shadow: 0 4px 20px rgba(239,68,68,0.15);
}

/* Pomodoro : phase badge prominent */
.pomodoro-phase {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--danger-color, #ef4444);
    min-width: 44px;
    text-align: center;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(239,68,68,0.08);
    line-height: 1.3;
}

.pomodoro-phase--focus {
    color: var(--danger-color, #ef4444);
    background: rgba(239,68,68,0.08);
}

.pomodoro-phase--shortBreak {
    color: var(--success-color, #10b981);
    background: rgba(16,185,129,0.08);
}

.pomodoro-phase--longBreak {
    color: var(--primary-color, #6366f1);
    background: rgba(99,102,241,0.08);
}

.pomodoro-phase.running {
    animation: pomodoroPhasePulse 2s ease-in-out infinite;
}

@keyframes pomodoroPhasePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Pomodoro display */
.pomodoro-display {
    font-family: var(--font-mono, monospace);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--danger-color, #ef4444);
    min-width: 50px;
    text-align: center;
}

.pomodoro-display.break-phase {
    color: var(--success-color, #10b981);
}

.pomodoro-display.running {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 10px rgba(239,68,68,0.3);
}

.pomodoro-display.ended {
    color: var(--danger-color, #ef4444);
    animation: pulse-danger 1s ease-in-out infinite;
}

/* Pomodoro sessions dots */
.pomodoro-sessions {
    display: flex;
    gap: 3px;
    align-items: center;
}

.pomodoro-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color, #d1d5db);
    transition: all 0.3s ease;
}

.pomodoro-dot.completed {
    background: var(--danger-color, #ef4444);
}

.pomodoro-dot.active {
    background: var(--danger-color, #ef4444);
    box-shadow: 0 0 6px rgba(239,68,68,0.5);
    animation: dotPulse 1.5s ease-in-out infinite;
}

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

/* Pomodoro buttons */
.mode-pomodoro .pomodoro-controls .timer-btn {
    color: var(--danger-color, #ef4444);
}

.mode-pomodoro .pomodoro-btn-start {
    color: var(--danger-color, #ef4444);
}

.mode-pomodoro .pomodoro-btn-start:hover {
    background: rgba(239,68,68,0.1);
}

.mode-pomodoro .pomodoro-controls .timer-btn-pause {
    color: #dc2626;
}
.mode-pomodoro .pomodoro-controls .timer-btn-pause:hover {
    background: rgba(220,38,38,0.1);
}
.mode-pomodoro .pomodoro-controls .timer-btn-stop {
    color: var(--text-secondary, #6b7280);
}
.mode-pomodoro .pomodoro-controls .timer-btn-stop:hover {
    background: rgba(0,0,0,0.05);
}

/* Pomodoro progress ring */
#panel-pomodoro .progress-ring-circle {
    stroke: var(--danger-color, #ef4444);
    transition: stroke 0.3s ease;
}
/* FIX issue #57 : Couleur dynamique selon le temps restant
   Vert (>50%) → Jaune (20-50%) → Rouge (<20%) */
#panel-pomodoro.pomodoro-phase-focus .progress-ring-circle { stroke: #10b981; }
#panel-pomodoro.pomodoro-phase-warn .progress-ring-circle { stroke: #f59e0b; }
#panel-pomodoro.pomodoro-phase-critical .progress-ring-circle { stroke: #ef4444; }
#panel-pomodoro.pomodoro-phase-break .progress-ring-circle { stroke: #06b6d4; }

/* Pomodoro settings gear */
.mode-pomodoro .timer-settings-btn {
    color: var(--text-muted, #9ca3af);
    opacity: 0.6;
}

.mode-pomodoro .timer-settings-btn:hover {
    opacity: 1;
    color: var(--danger-color, #ef4444);
    transform: rotate(30deg);
}

/* Pomodoro settings dropdown */
.pomodoro-settings-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    padding: 8px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
}

.pomodoro-settings-dropdown.hidden {
    display: none !important;
}

.timer-settings-row {
    margin-bottom: 6px;
}

.timer-settings-row:last-child {
    margin-bottom: 0;
}

.timer-settings-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 3px;
    padding: 0 2px;
}

.timer-settings-chips {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.timer-settings-chip {
    padding: 3px 7px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timer-settings-chip:hover {
    background: var(--danger-color, #ef4444);
    border-color: var(--danger-color, #ef4444);
    color: white;
}

.timer-settings-chip.active {
    background: var(--danger-color, #ef4444);
    border-color: var(--danger-color, #ef4444);
    color: white;
    box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

/* ============================================
   PROGRESSION RING (à côté du temps)
   ============================================ */

.timer-time-area {
    display: flex;
    align-items: center;
    gap: 3px;
}

.progress-ring {
    pointer-events: none;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.progress-ring-bg {
    stroke: var(--border-color, #e5e7eb);
    opacity: 0.15;
}

.progress-ring-circle {
    stroke-dasharray: 56.549;
    stroke-dashoffset: 56.549;
    transition: opacity 0.3s ease;
    opacity: 0;
    filter: drop-shadow(0 0 0 transparent);
}

.progress-ring-circle.active {
    opacity: 1;
    filter: drop-shadow(0 0 3px currentColor);
}

.mode-stopwatch .progress-ring-circle.active { color: var(--primary-color, #6366f1); }
.mode-timer .progress-ring-circle.active { color: #f59e0b; }
.mode-pomodoro .progress-ring-circle.active { color: var(--danger-color, #ef4444); }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes timerStart {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.timer-panel.starting {
    animation: timerStart 0.3s ease-out;
}

@keyframes pulse-danger {
    0%, 100% { text-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 5px rgba(239,68,68,0.3); }
    50% { text-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 15px rgba(239,68,68,0.6); }
}

/* ============================================
   MODE SOMBRE
   ============================================ */

body.dark-mode .timers-widgets-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .timer-display { color: var(--text-white, #f9fafb); }

body.dark-mode .timer-input {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #374151);
    color: var(--text-white, #f9fafb);
}

body.dark-mode .timer-preset {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #374151);
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .timer-preset:hover {
    color: white;
}

body.dark-mode .timer-mode-btn { color: var(--text-secondary, #9ca3af); }
body.dark-mode .timer-mode-btn.active { color: white; }

/* Dark mode chrono */
body.dark-mode .timers-widgets-container.mode-stopwatch {
    border-color: rgba(99,102,241,0.2);
}
body.dark-mode .timers-widgets-container.mode-stopwatch:hover {
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}
body.dark-mode #panel-stopwatch .timer-display.running {
    color: #818cf8;
    text-shadow: 0 0 10px rgba(99,102,241,0.4);
}

/* Dark mode timer */
body.dark-mode .timers-widgets-container.mode-timer {
    border-color: rgba(245,158,11,0.2);
}
body.dark-mode .timers-widgets-container.mode-timer:hover {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 4px 20px rgba(245,158,11,0.1);
}
body.dark-mode #panel-timer .timer-display {
    color: #fbbf24;
}
body.dark-mode #panel-timer .timer-display.running {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245,158,11,0.4);
}
body.dark-mode #panel-timer .timer-display.paused {
    color: #d97706;
}
body.dark-mode #panel-timer .timer-display.ended {
    color: #ef4444;
    animation: pulse-danger 1s ease-in-out infinite;
}

/* Dark mode pomodoro */
body.dark-mode .timers-widgets-container.mode-pomodoro {
    border-color: rgba(239,68,68,0.2);
}
body.dark-mode .timers-widgets-container.mode-pomodoro:hover {
    border-color: rgba(239,68,68,0.35);
    box-shadow: 0 4px 20px rgba(239,68,68,0.1);
}
body.dark-mode .pomodoro-display { color: var(--danger-color, #ef4444); }
body.dark-mode .pomodoro-display.break-phase { color: var(--success-color, #10b981); }
body.dark-mode .pomodoro-display.running {
    text-shadow: 0 0 10px rgba(239,68,68,0.4);
}
body.dark-mode .pomodoro-dot { background: var(--border-color, #374151); }
body.dark-mode .pomodoro-dot.completed { background: var(--danger-color, #ef4444); }
body.dark-mode .pomodoro-dot.active {
    box-shadow: 0 0 8px rgba(239,68,68,0.6);
}
body.dark-mode .pomodoro-phase { background: rgba(239,68,68,0.12); }
body.dark-mode .pomodoro-phase--shortBreak { background: rgba(16,185,129,0.12); }
body.dark-mode .pomodoro-phase--longBreak { background: rgba(99,102,241,0.12); }

/* Dark mode progress ring */
body.dark-mode .progress-ring-bg {
    display: none;
}

/* ============================================
   SETTINGS DROPDOWN (dark mode)
   ============================================ */

body.dark-mode .timer-settings-dropdown,
body.dark-mode .pomodoro-settings-dropdown {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #374151);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

body.dark-mode .timer-settings-option,
body.dark-mode .timer-settings-chip {
    background: var(--bg-secondary, #111827);
    border-color: var(--border-color, #374151);
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .timer-settings-option:hover,
body.dark-mode .timer-settings-chip:hover,
body.dark-mode .timer-settings-option.active,
body.dark-mode .timer-settings-chip.active {
    color: white;
}

/* Dark mode timer settings */
body.dark-mode .mode-timer .timer-settings-option:hover,
body.dark-mode .mode-timer .timer-settings-option.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

/* ============================================
    COMPTE À REBOURS JUSQU'À UNE HEURE
    ============================================ */

.timer-countdown-to-time {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.timer-countdown-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.timer-countdown-input {
    flex: 1;
    padding: 4px 6px;
    border: 1.5px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-primary, white);
    color: var(--text-primary, #111827);
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease;
}

.timer-countdown-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.1);
}

.timer-countdown-go {
    padding: 4px 6px;
    border: none;
    background: #f59e0b;
    color: white;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.timer-countdown-go:hover {
    background: #d97706;
    box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

.timer-countdown-hint {
    margin-top: 4px;
    font-size: 0.6rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
    min-height: 14px;
}

.timer-countdown-hint.error {
    color: #ef4444;
}

body.dark-mode .timer-countdown-to-time {
    border-top-color: var(--border-color, #374151);
}

body.dark-mode .timer-countdown-input {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #374151);
    color: var(--text-white, #f9fafb);
}

/* Dark mode pomodoro settings */
body.dark-mode .mode-pomodoro .timer-settings-chip:hover,
body.dark-mode .mode-pomodoro .timer-settings-chip.active {
    background: var(--danger-color, #ef4444);
    border-color: var(--danger-color, #ef4444);
}

@media (prefers-reduced-motion: reduce) {
    .timer-panel.starting,
    .timer-display.running,
    .timer-display.ended,
    .pomodoro-display.running,
    .pomodoro-display.ended,
    .pomodoro-phase.running,
    .pomodoro-dot.active {
        animation: none !important;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .timers-widgets-container {
        gap: var(--spacing-xs, 4px);
        padding: var(--spacing-xs, 4px);
        margin-left: var(--spacing-sm, 8px);
    }

    .timer-display { font-size: 0.8rem; min-width: 55px; }
    .timer-input { width: 36px; font-size: 0.7rem; }
}

@media (max-width: 768px) {
    .timers-widgets-container {
        flex-wrap: wrap;
        justify-content: center;
        margin-left: 0;
        margin-top: var(--spacing-sm, 8px);
        width: 100%;
        max-width: 320px;
        gap: var(--spacing-xs, 4px);
    }

    .timer-separator { display: none; }

    .timer-mode-selector {
        width: 100%;
        justify-content: center;
        margin-bottom: 2px;
    }

    .timer-widget-zone {
        width: 100%;
        justify-content: center;
    }

    .timer-display { font-size: 0.8rem; min-width: 50px; }
    .timer-input { width: 34px; font-size: 0.65rem; }
}

@media (max-width: 480px) {
    .timers-widgets-container { max-width: 280px; }
    .timer-display { font-size: 0.75rem; min-width: 45px; }
    .timer-input { width: 30px; font-size: 0.6rem; }
    .pomodoro-phase { font-size: 0.5rem; }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

.timer-btn:focus-visible,
.timer-input:focus-visible,
.timer-preset:focus-visible,
.timer-mode-btn:focus-visible {
    outline: 2px solid var(--primary-color, #6366f1);
    outline-offset: 1px;
}

/* ============================================
   OBJECTIF JOURNALIER
   ============================================ */

.daily-goal {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-lg, 12px);
    background: var(--glass-layer-2, rgba(0,0,0,0.03));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.15));
    font-size: 0.6rem;
    color: var(--text-secondary, #6b7280);
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.daily-goal:hover {
    background: var(--glass-layer-3, rgba(0,0,0,0.06));
    border-color: var(--primary-light, rgba(99,102,241,0.3));
}

.daily-goal-ring {
    flex-shrink: 0;
}

.daily-goal-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 40px;
}

.daily-goal-bar-container {
    width: 100%;
    height: 3px;
    background: var(--border-color, #e5e7eb);
    border-radius: 2px;
    overflow: hidden;
}

.daily-goal-bar {
    height: 100%;
    background: var(--primary-color, #6366f1);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.daily-goal-bar.complete {
    background: var(--success-color, #10b981);
}

body.dark-mode .daily-goal {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .daily-goal-bar-container {
    background: rgba(255,255,255,0.1);
}

.daily-goal-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    padding: 8px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 9999;
}

.daily-goal-dropdown.hidden {
    display: none;
}

.daily-goal-options {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.daily-goal-options .timer-settings-chip {
    flex: 1 0 auto;
    text-align: center;
    min-width: 40px;
}

.daily-goal-custom {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.daily-goal-custom-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.daily-goal-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.daily-goal-input {
    width: 38px;
    padding: 3px 4px;
    border: 1.5px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-primary, white);
    color: var(--text-primary, #111827);
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease;
}

.daily-goal-input:focus {
    outline: none;
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

.daily-goal-custom-btn {
    padding: 4px;
    border: none;
    background: var(--primary-color, #6366f1);
    color: white;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.daily-goal-custom-btn:hover {
    background: #4f46e5;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

body.dark-mode .daily-goal-custom {
    border-top-color: var(--border-color, #374151);
}

body.dark-mode .daily-goal-input {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #374151);
    color: var(--text-white, #f9fafb);
}

body.dark-mode .daily-goal-custom-btn {
    background: var(--primary-color, #6366f1);
}

body.dark-mode .daily-goal-custom-btn:hover {
    background: #818cf8;
}
