/* styles/components/timer.css */
/* Style incroyable pour le composant de minuteur */

.timer-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.timer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color, #6a11cb));
    z-index: 1;
}

.timer-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Affichage du temps élégant */
.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.time-remaining {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, var(--primary-color), var(--accent-color, #6a11cb));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    position: relative;
    perspective: 400px;
    transition: all 0.3s ease;
}

.time-remaining span {
    display: inline-block;
    position: relative;
    transition: transform 0.3s ease;
}

.time-remaining span:hover {
    transform: translateY(-2px) scale(1.1);
}

/* Barre de progression améliorée */
.progress-container {
    width: 301px;
    background: #cecece;
    padding: 2px;
    border: 1px solid rgba(131, 125, 217, 1);
    border-radius: 6px;
    box-shadow: 0 0 20px 0 rgba(131, 125, 217, 0.5);
    margin: auto;
    margin-bottom: 2rem;
    position: relative;
    height: 30px;
}

.progress-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    align-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.progress-bar span {
    margin: auto;
    background: rgba(131, 125, 217, 1);
    border-radius: 4px;
    flex-basis: 11%;
    flex-grow: 1;
    flex-shrink: 1;
    height: 20px;
    animation: FadeIn 0.5s ease;
    transition: all 1s cubic-bezier(0.17, 0.67, 0.88, 0.17);
}

.progress-bar span:first-of-type {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.progress-bar span:last-of-type {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.progress-bar .first {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

.progress-bar .last {
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

@keyframes FadeIn {
    0% {
        opacity: 0;
        transform: scale(0.1);
        background: rgba(131, 125, 217, 1);
        border-radius: 4px;
    }

    85% {
        opacity: 1;
        background: rgb(131, 125, 217);
        background: linear-gradient(
            180deg,
            rgba(131, 125, 217, 1) 0%,
            rgba(57, 55, 131, 1) 56%,
            rgba(9, 9, 121, 1) 100%
        );
        border-radius: 0;
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    100% {
        transform: scale(1);
        background: rgb(131, 125, 217);
        background: linear-gradient(
            180deg,
            rgba(131, 125, 217, 1) 0%,
            rgba(57, 55, 131, 1) 56%,
            rgba(9, 9, 121, 1) 100%
        );
        border-radius: 0;
    }
}

/* Contrôles du minuteur */
.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

#startTimer {
    background: var(--primary-color);
    color: white;
}

#startTimer:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 15px rgba(var(--primary-rgb), 0.4);
}

#pauseTimer, #resetTimer, #cancelTimer {
    opacity: 0.8;
}

#pauseTimer:hover, #resetTimer:hover, #cancelTimer:hover {
    opacity: 1;
}

#pauseTimer:disabled, #resetTimer:disabled, #cancelTimer:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Entrées de temps stylisées */
.timer-input {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.time-input-group label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.time-input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.time-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    outline: none;
}

.input-arrows {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.arrow-up, .arrow-down {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.arrow-up:hover, .arrow-down:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* Préréglages stylisés */
.timer-presets {
    margin-bottom: 2.5rem;
}

.timer-presets h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.9;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.preset-btn {
    padding: 0.7rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

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

.preset-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3);
}

/* Options de minuteur améliorées */
.timer-options {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.option-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.option-group label {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
}

.form-select {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    outline: none;
}

.volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--input-bg);
    outline: none;
    flex: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 5px rgba(var(--primary-rgb), 0.2);
}

/* Écran fin de minuteur */
.timer-complete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.timer-complete.show {
    opacity: 1;
    visibility: visible;
}

.complete-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: pulseIcon 2s infinite;
}

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

.timer-complete h3 {
    font-size: 2rem;
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.complete-actions {
    display: flex;
    gap: 1rem;
}

/* Animation pour la pulsation en fin de compte à rebours */
@keyframes timerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.timer-ending .time-remaining {
    animation: timerPulse 0.5s infinite;
    color: var(--danger-color);
}

/* Animation des chiffres qui changent */
@keyframes flipNumber {
    0% { transform: rotateX(0deg); opacity: 1; }
    50% { transform: rotateX(90deg); opacity: 0.5; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

.digit-changing {
    animation: flipNumber 0.3s ease;
}

/* Adaptations pour différentes tailles d'écran */
@media (max-width: 640px) {
    .timer-container {
        margin: 1rem;
        padding: 1.5rem;
    }

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

    .timer-input {
        grid-template-columns: 1fr;
    }

    .timer-controls {
        flex-wrap: wrap;
    }
}

/* Mode plein écran amélioré */
.timer-fullscreen-active .timer-container.timer-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 4rem 2rem;
    z-index: 99999;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
}

.timer-tool-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 99990;
}

/* Cacher le header principal en mode plein écran */
.timer-fullscreen-active header {
    display: none !important;
}

/* Ajuster l'espacement en plein écran */
.timer-fullscreen-active .timer-container.timer-fullscreen .timer-display {
    margin-top: 2rem;
}

.timer-fullscreen .time-remaining {
    font-size: 8rem;
    margin-bottom: 2rem;
}

.timer-fullscreen .progress-container {
    width: 50%;
    height: 20px;
    margin-bottom: 3rem;
}

.timer-fullscreen .timer-controls {
    margin: 2rem 0;
}

.timer-fullscreen .timer-input,
.timer-fullscreen .timer-presets,
.timer-fullscreen .timer-options {
    max-width: 800px;
    width: 100%;
    margin-bottom: 2rem;
}

/* Animation de transition pour le mode plein écran */
.fullscreen-transition {
    animation: expand-fullscreen 0.4s ease-out forwards;
}

.fullscreen-exit-transition {
    animation: shrink-fullscreen 0.4s ease-in forwards;
}

@keyframes expand-fullscreen {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shrink-fullscreen {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

/* Adaptation mobile en mode plein écran */
@media (max-width: 768px) {
    .timer-fullscreen-active .timer-container.timer-fullscreen {
        padding: 2rem 1rem;
    }
    
    .timer-fullscreen .time-remaining {
        font-size: 5rem;
    }
    
    .timer-fullscreen .progress-container {
        width: 80%;
    }
}

/* Effets de particules lorsque le minuteur tourne */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.5;
    animation: floatParticle 4s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Animation pour le mode alarme activé */
.timer-alarm-active {
    animation: alarmPulse 0.5s infinite alternate;
}

@keyframes alarmPulse {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 10px 30px rgba(var(--danger-rgb, 255, 0, 0), 0.5);
    }
}

/* Désactiver les flèches des inputs number */
.time-input::-webkit-outer-spin-button,
.time-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input[type=number] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Bouton de fermeture explicite pour le mode plein écran */
.fullscreen-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 100001;
}

.fullscreen-close-btn::before,
.fullscreen-close-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--text-color);
    transform: rotate(45deg);
}

.fullscreen-close-btn::after {
    transform: rotate(-45deg);
}

.fullscreen-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Style pour la section d'aide intégrée */
.timer-help-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timer-help-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.timer-help-section h4 {
    margin: 1.5rem 0 0.8rem;
    font-size: 1rem;
    color: var(--text-color);
}

.timer-help-section ol,
.timer-help-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.timer-help-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.timer-help-section .help-note {
    margin-top: 1.5rem;
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Timer Layout */
.timer-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) {
    .timer-horizontal-layout {
        grid-template-columns: 1fr 350px;
        grid-template-areas: "main sidebar";
    }
    
    .timer-main-panel {
        grid-area: main;
    }
    
    .timer-sidebar {
        grid-area: sidebar;
    }
}

.timer-main-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.timer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--bg-sidebar);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

/* Timer Display */
.timer-display {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.time-remaining {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
}

.progress-container {
    width: 90%;
    height: 10px;
    background-color: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: width 1s linear;
}

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

.btn-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-circle:hover {
    background-color: var(--primary-color-dark);
    transform: scale(1.05);
}

.btn-circle:disabled {
    background-color: var(--bg-light);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-circle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

/* Timer Input */
.timer-input {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-input-group label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.time-input {
    width: 80px;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    font-variant-numeric: tabular-nums;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-light);
}

/* Timer Presets */
.timer-presets {
    text-align: center;
    margin: 1rem 0;
}

.timer-presets h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.75rem 1.25rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
    color: var(--primary-color-dark);
}

/* Timer Options */
.timer-options {
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.timer-options h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.option-group {
    margin-bottom: 1.25rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.sound-selector {
    display: flex;
    gap: 0.5rem;
}

.form-select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-light);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.volume-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.9rem;
}

/* Timer Help Section */
.timer-help-section {
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.timer-help-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.help-content {
    font-size: 0.9rem;
}

.help-content h4 {
    margin: 1rem 0 0.5rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.help-content ol, 
.help-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-content li {
    margin-bottom: 0.5rem;
}

/* Timer Complete Modal */
.timer-complete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.timer-complete.active {
    display: flex;
}

.timer-complete > div {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    min-width: 300px;
    max-width: 500px;
    animation: fadeIn 0.3s ease-out;
}

.complete-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timer-complete h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.complete-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .timer-input {
        flex-direction: column;
        align-items: center;
    }
    
    .time-input {
        width: 120px;
    }
    
    .time-remaining {
        font-size: 3rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
} 