/* Variables pour les thèmes */
:root {
    /* Thème clair (par défaut) */
    --bg-color: #f0f4f8;
    --text-color: #1e293b;
    --container-bg: rgba(255, 255, 255, 0.85);
    --container-border: rgba(0, 0, 0, 0.1);
    --heading-color: #1e293b;
    --paragraph-color: #334155;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --progress-bg: rgba(0, 0, 0, 0.1);
    --progress-bar: linear-gradient(90deg, #3b82f6, #60a5fa);
    --button-bg: rgba(255, 255, 255, 0.7);
    --button-color: #334155;
    --button-hover: rgba(255, 255, 255, 0.9);
    --button-active-bg: #3b82f6;
    --button-active-color: white;
    --link-color: #3b82f6;
    --link-hover: #2563eb;
    --particle-color: rgba(30, 41, 59, 0.7);
    --line-color: rgba(30, 41, 59, 0.15);
    --time-bg: rgba(0, 0, 0, 0.05);
    --task-completed: #10b981;
    --task-in-progress: #f59e0b;
    --task-pending: #6b7280;
    --task-progress-bg: rgba(0, 0, 0, 0.05);
    --task-time-color: #64748b;
    --details-button-bg: rgba(0, 0, 0, 0.05);
    --details-button-color: #334155;
    --details-button-hover: rgba(0, 0, 0, 0.1);
    --noscript-bg: rgba(239, 68, 68, 0.9);
    --noscript-color: #ffffff;
}

/* Thème sombre */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --container-bg: rgba(30, 41, 59, 0.8);
    --container-border: rgba(255, 255, 255, 0.1);
    --heading-color: #f8fafc;
    --paragraph-color: #cbd5e1;
    --accent-color: #60a5fa;
    --accent-hover: #93c5fd;
    --progress-bg: rgba(255, 255, 255, 0.1);
    --progress-bar: linear-gradient(90deg, #3b82f6, #60a5fa);
    --button-bg: rgba(30, 41, 59, 0.6);
    --button-color: #cbd5e1;
    --button-hover: rgba(60, 82, 118, 0.8);
    --button-active-bg: #3b82f6;
    --button-active-color: white;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --particle-color: rgba(148, 163, 184, 0.7);
    --line-color: rgba(148, 163, 184, 0.15);
    --time-bg: rgba(255, 255, 255, 0.1);
    --task-completed: #34d399;
    --task-in-progress: #fbbf24;
    --task-pending: #9ca3af;
    --task-progress-bg: rgba(255, 255, 255, 0.1);
    --task-time-color: #94a3b8;
    --details-button-bg: rgba(255, 255, 255, 0.1);
    --details-button-color: #cbd5e1;
    --details-button-hover: rgba(255, 255, 255, 0.15);
    --noscript-bg: rgba(239, 68, 68, 0.9);
    --noscript-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.maintenance-container {
    background-color: var(--container-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 550px;
    z-index: 1;
    border: 1px solid var(--container-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
    letter-spacing: -0.025em;
    transition: color 0.3s ease;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--paragraph-color);
    font-weight: 400;
    transition: color 0.3s ease;
}

.progress {
    height: 8px;
    background-color: var(--progress-bg);
    border-radius: 4px;
    margin: 2.5rem 0 1rem 0;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.progress-bar {
    height: 100%;
    width: 75%;
    background: var(--progress-bar);
    border-radius: 4px;
    animation: progress 2.5s ease-in-out;
    transition: background 0.3s ease;
}

.contact {
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--task-time-color);
    transition: color 0.3s ease;
}

.contact a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contact a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.contact a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

@keyframes progress {
    from { width: 0; }
    to { width: 75%; }
}

.logo {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--heading-color);
    transition: color 0.3s ease;
}

.logo-accent {
    color: #60a5fa;
}

.estimated-time {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--time-bg);
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--paragraph-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Styles pour le sélecteur de langue */
.language-selector {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.language-selector button {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background-color: var(--button-bg);
    color: var(--button-color);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-selector button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

.language-selector button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.language-selector button.active {
    background-color: var(--button-active-bg);
    color: var(--button-active-color);
}

/* Styles pour le bouton de changement de thème */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background-color: var(--button-bg);
    color: var(--button-color);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.theme-toggle:hover {
    background-color: var(--button-hover);
    transform: rotate(30deg);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Styles pour les détails de progression */
.progress-details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem auto;
    padding: 0.5rem 1rem;
    background-color: var(--details-button-bg);
    color: var(--details-button-color);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.progress-details-toggle:hover {
    background-color: var(--details-button-hover);
}

.progress-details-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.progress-details-toggle svg {
    transition: transform 0.3s ease;
}

.progress-details-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.progress-details-container.expanded {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

.progress-details {
    background-color: var(--time-bg);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
}

.progress-task {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--container-border);
}

.progress-task:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.task-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-icon {
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
}

.task-name {
    flex: 1;
    font-weight: 500;
}

.task-percentage {
    font-weight: 600;
    min-width: 3rem;
    text-align: right;
}

.task-progress {
    height: 6px;
    background-color: var(--task-progress-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.task-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

.task-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--task-time-color);
}

.completed .task-progress-bar {
    background-color: var(--task-completed);
}

.in-progress .task-progress-bar {
    background-color: var(--task-in-progress);
}

.pending .task-progress-bar {
    background-color: var(--task-pending);
}

/* Support RTL pour l'arabe */
[dir="rtl"] .progress-details {
    text-align: right;
}

[dir="rtl"] .status-icon {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .task-percentage {
    text-align: left;
}

/* Styles pour le message noscript */
.noscript-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--noscript-bg);
    color: var(--noscript-color);
    padding: 1rem;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.noscript-message p {
    color: var(--noscript-color);
    margin: 0.5rem 0;
}

/* Media queries pour la responsivité */
@media (max-width: 768px) {
    .maintenance-container {
        padding: 2rem;
        margin: 1rem;
        max-width: 100%;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    p {
        font-size: 1rem;
    }
    
    .language-selector {
        top: 1rem;
        right: 1rem;
    }
    
    .theme-toggle {
        top: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .maintenance-container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .language-selector button {
        width: 1.8rem;
        height: 1.8rem;
    }
    
    .theme-toggle {
        width: 2.2rem;
        height: 2.2rem;
    }
    
    .task-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Styles pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .theme-toggle:hover {
        transform: none;
    }
    
    .language-selector button:hover {
        transform: none;
    }
}

/* Focus visible amélioré */
:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}
