/* styles/components/stopwatch.css */
/* Styles pour le composant de chronomètre */
.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-content {
    padding: 1.5rem;
    background: var(--tool-container-bg);
}

.stopwatch-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stopwatch-display {
    padding: 3rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 16px 16px 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.time-counter {
    font-size: 5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 4px;
    transition: all 0.3s ease;
}

.stopwatch-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    transform: translateY(-25px);
    border-radius: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    margin: 0 1rem;
}

.lap-times {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.lap-times h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lap-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.lap-list::-webkit-scrollbar {
    width: 6px;
}

.lap-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.lap-list::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
}

.lap-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 0.85rem;
    border-radius: 10px;
    background: var(--input-bg);
    margin-bottom: 0.7rem;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.lap-item:hover {
    transform: translateX(5px);
}

.lap-item.best-lap {
    background: rgba(58, 134, 255, 0.15);
    border-left: 3px solid var(--primary-color);
}

.lap-item.worst-lap {
    background: rgba(255, 77, 77, 0.15);
    border-left: 3px solid var(--danger-color);
}

.lap-number {
    font-weight: 500;
    color: var(--text-color);
}

.lap-time {
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-color);
}

.total-time {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-color-secondary);
}

.lap-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.stopwatch-stats {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stopwatch-stats h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.2rem;
}

.stat-item {
    background: var(--input-bg);
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-bottom: 0.7rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    font-family: 'Roboto Mono', monospace;
}

@media (max-width: 640px) {
    .stopwatch-container {
        border-radius: 12px;
    }
    
    .stopwatch-display {
        padding: 2rem 1rem;
    }
    
    .time-counter {
        font-size: 3.5rem;
    }

    .stopwatch-controls {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Animation pour le bouton de tour */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.lap-item:first-child {
    animation: addLap 0.5s ease-out;
}

@keyframes addLap {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Animation pour le chronomètre en cours d'exécution */
.stopwatch-display.running {
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.5);
}

/* Ombre dynamique pour les contrôles lorsque le chronomètre est en marche */
.stopwatch-running .stopwatch-controls {
    box-shadow: 0 -4px 20px rgba(58, 134, 255, 0.2);
}

/* Ajout de l'animation pour les boutons quand ils sont cliqués */
.button-clicked {
    animation: buttonClick 0.3s ease-out;
}

@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Améliorations pour le mode plein écran */
body:fullscreen .stopwatch-container,
body:-webkit-full-screen .stopwatch-container,
body:-moz-full-screen .stopwatch-container {
    max-width: 800px;
}

body:fullscreen .time-counter,
body:-webkit-full-screen .time-counter,
body:-moz-full-screen .time-counter {
    font-size: 7rem;
}

/* Améliorations pour le contraste */
.dark-mode .stopwatch-display {
    background: linear-gradient(135deg, #1a56c7, #3a86ff);
}

.dark-mode .lap-item {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dark-mode .stat-item {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tool-header h2 {
    color: var(--tool-header-text);
}
[data-theme="dark"] .tool-content {
    background: var(--tool-container-bg);
}

/* Mise en page horizontale pour le chronomètre */
.stopwatch-horizontal-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "main"
        "sidebar";
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1200px) {
    .stopwatch-horizontal-layout {
        grid-template-columns: minmax(320px, 1fr) minmax(300px, 1fr);
        grid-template-areas: "main sidebar";
    }
    
    .stopwatch-main-panel {
        grid-area: main;
        background-color: var(--bg-light);
        border-radius: var(--border-radius);
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .stopwatch-sidebar {
        grid-area: sidebar;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .lap-times,
    .stopwatch-stats {
        background-color: var(--bg-light);
        border-radius: var(--border-radius);
        padding: 1.5rem;
    }
    
    .stopwatch-display {
        margin-bottom: 2rem;
    }
    
    .time-counter {
        font-size: 3.5rem;
    }
} 