/* ÉTAPE 1: VARIABLES ET RESET CSS
-------------------------------------------------- */

/* Variables pour les couleurs et le design
-------------------------------------------------- */
:root {
    /* Couleurs principales - Mode clair (défaut) */
    --primary: #40E378;
    /* Vert clair */
    --primary-gradient: linear-gradient(135deg, #40E378 0%, #25CC5F 100%);
    --primary-two: #1b6435;
    --pulsing: #A1E5B3;
    --hashtag: #25CC5F;
    --white: #FFFFFF;
    --black: #0E0E0E;
    --black-sheet-bg: #1F1F1F;
    --main-text: #2d2d2d;
    --light-text: #979797;
    --light-icon: #AEAEAE;
    --dark-text: #585858;
    --light-bg: #F1F1F1;
    --dark-bg: #212121;
    --bg: #F2F2F2;
    --green: #2CA757;
    --dark-green: #183321;
    --blue-tick: #1D9BF0;
    --red: #FF3939;
    --orange: #F39C12;
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.05);

    /* Variables de design */
    --corner-radius: 12px;
    --corner-radius-sm: 8px;
    --corner-radius-lg: 16px;
    --corner-radius-xl: 24px;
    --corner-radius-pill: 50px;

    /* Ombres */
    --box-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* Animations et transitions */
    --transition-fast: all 0.2s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.4s ease;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Typographie */
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Tailles de polices */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.875rem;
    --text-3xl: 2.25rem;
    --text-4xl: 3rem;
}

/* Mode sombre automatique basé sur les préférences système */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1E1E1E;
        --black: #FFFFFF;
        --main-text: #E0E0E0;
        --light-text: #B0B0B0;
        --light-icon: #8A8A8A;
        --dark-text: #C0C0C0;
        --light-bg: #2C2C2C;
        --dark-bg: #0A0A0A;
        --bg: #121212;
        --black-sheet-bg: #252525;
        --card-bg: #252525;
        --card-border: rgba(255, 255, 255, 0.05);

        /* Ombres pour le mode sombre */
        --box-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        --box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
        --box-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
}

/* Chrome, Edge, et Safari */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;          /* Pour les scrollbars horizontales */
}

::-webkit-scrollbar-track {
    background-color: var(--light-bg);
    border-radius: var(--corner-radius-pill);
}

::-webkit-scrollbar-thumb {
    background-color: var(--light-icon);
    border-radius: var(--corner-radius-pill);
    border: 2px solid var(--light-bg);  /* Crée un effet de marge/padding */
    background-clip: padding-box;            /* Empêche le débordement de la couleur de fond sur la bordure */
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--dark-text);
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--main-text);
}

/* Coins de la scrollbar (intersection entre deux scrollbars) */
::-webkit-scrollbar-corner {
    background-color: var(--light-bg);
}

/* Boutons de défilement (présents sur certains navigateurs) */
::-webkit-scrollbar-button {
    display: none;  /* Masque les boutons pour un design plus épuré */
}

/* Reset & base styles
-------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--main-text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s ease, color 0.5s ease;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(64, 227, 120, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(64, 227, 120, 0.07) 0%, transparent 25%);
    background-attachment: fixed;
}

/* Conteneur principal */
.container {
    max-width: 110vh;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Styles typographiques de base
-------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    margin-bottom: 0.5em;
    line-height: var(--line-height-tight);
    color: var(--main-text);
    font-weight: 700;
    transition: color 0.5s ease;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
}

h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
}

h3 {
    font-size: var(--text-xl);
    font-weight: 700;
}

h4 {
    font-size: var(--text-lg);
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-md);
    transition: color 0.5s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--green);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.logo-dark {
    display: none;
}

.logo-light {
    display: block;
}

/* En mode sombre, inverser l'affichage des logos */
html.dark-theme .logo-dark {
    display: block;
}

html.dark-theme .logo-light {
    display: none;
}

/* ÉTAPE 2: STYLES D'EN-TÊTE ET VUE D'ENSEMBLE
-------------------------------------------------- */

/* Header de la page d'état
-------------------------------------------------- */
.status-header {
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    border-radius: var(--corner-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

.status-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.status-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 50px;
    border-radius: var(--corner-radius-sm);
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
}

.logo h1 {
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.last-updated {
    background-color: var(--light-bg);
    padding: 8px 16px;
    border-radius: var(--corner-radius-pill);
    font-size: var(--text-sm);
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.last-updated::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    color: var(--primary);
}

/* Vue d'ensemble du statut
-------------------------------------------------- */
.status-overview {
    border-radius: var(--corner-radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--white);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    background: var(--primary-gradient);
    transition: box-shadow 0.5s ease;
}

.status-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.2;
}

.status-overview h2 {
    margin: 0;
    font-weight: 700;
    color: var(--white);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-overview h2::before {
    content: '\f058';
    /* Icône check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2em;
}

/* Quand le statut est "Incident en cours" */
.status-overview[style*="--red"] h2::before {
    content: '\f06a';
    /* Icône exclamation-circle */
}

/* Quand le statut est "Performance réduite" */
.status-overview[style*="#F39C12"] h2::before {
    content: '\f071';
    /* Icône exclamation-triangle */
}

/* Styles des headers de section
-------------------------------------------------- */
.section-header {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-header h3 {
    font-weight: 700;
    color: var(--main-text);
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.section-header h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 1.5px;
}

/* ÉTAPE 3: STYLES DES CARTES DE SERVICE
-------------------------------------------------- */

/* Section et grille des services 
-------------------------------------------------- */
.services-section {
    margin-bottom: var(--spacing-2xl);
}

.services-grid {
    display: block;
}

/* Statistiques des services
-------------------------------------------------- */
.service-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-bg);
    border-radius: var(--corner-radius);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    transition: background-color 0.3s ease;
}

.service-stats:hover {
    background-color: rgba(64, 227, 120, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
    color: var(--dark-text);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--corner-radius-sm);
    transition: var(--transition-fast);
}

.stat-item i {
    color: var(--primary);
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.stat-item span {
    font-weight: 500;
}

/* Version responsive */
@media (max-width: 576px) {
    .service-stats {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: flex-start;
    }
    
    .stat-item {
        width: 100%;
    }
}

/* Carte de service individuelle 
-------------------------------------------------- */
.service-card {
    background-color: var(--card-bg);
    border-radius: var(--corner-radius-lg);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-lg);
    transition: background-color 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

/* En-tête de la carte de service 
-------------------------------------------------- */
.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--light-bg);
}

.service-card-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: var(--text-md);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media only screen and (max-width: 767px) {
    .service-card-header h4 {
        max-width: 21ch; /* Limite à environ 21 caractères sur mobile */
    }
}

.service-status {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
}

/* Description du service 
-------------------------------------------------- */
.service-description {
    color: var(--dark-text);
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-lg);
    min-height: 40px;
    line-height: var(--line-height-relaxed);
    transition: color 0.5s ease;
}

/* Uptime et détails du service 
-------------------------------------------------- */
.service-details {
    margin-top: var(--spacing-sm);
}

.service-uptime {
    margin-bottom: var(--spacing-md);
}

.uptime-label {
    font-size: var(--text-sm);
    color: var(--dark-text);
    margin-bottom: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.5s ease;
}

.uptime-bar {
    height: 8px;
    background-color: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
    transition: background-color 0.5s ease;
}

.uptime-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.uptime-percentage {
    text-align: right;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--dark-text);
    transition: color 0.5s ease;
}

.service-last-check {
    font-size: var(--text-xs);
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--spacing-sm);
    transition: color 0.5s ease;
}

/* Message quand aucun service n'est disponible 
-------------------------------------------------- */
.service-empty {
    background-color: var(--card-bg);
    border-radius: var(--corner-radius-lg);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--light-text);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    transition: background-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease;
}

.service-empty::before {
    content: '\f05e';
    /* Icône ban */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: var(--light-icon);
    transition: color 0.5s ease;
}

/* ÉTAPE 4: STYLES DE LA TIMELINE DES INCIDENTS
-------------------------------------------------- */

/* Section des incidents
-------------------------------------------------- */
.incidents-section {
    margin-bottom: var(--spacing-2xl);
}

/* Timeline des incidents
-------------------------------------------------- */
.incidents-timeline {
    position: relative;
    padding-left: 28px;
}

/* Ligne verticale de la timeline */
.incidents-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--light-bg);
    transition: background-color 0.5s ease;
}

/* Élément individuel d'incident
-------------------------------------------------- */
.incident-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

/* Marqueur de point sur la timeline */
.incident-marker {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 1;
}

/* Styles spécifiques selon le statut de l'incident */
.incident-marker.resolved {
    background-color: var(--primary);
}

.incident-marker.ongoing {
    background-color: var(--red);
    animation: pulse 2s infinite;
}

/* Animation de pulsation pour les incidents en cours */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 57, 57, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 57, 57, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 57, 57, 0);
    }
}

/* Contenu de l'incident */
.incident-content {
    background-color: var(--card-bg);
    border-radius: var(--corner-radius-lg);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-lg);
    transition: background-color 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.incident-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

/* En-tête de l'incident */
.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--light-bg);
    transition: border-color 0.5s ease;
}

.incident-header h4 {
    margin: 0;
    font-weight: 600;
    color: var(--main-text);
}

/* Date de l'incident */
.incident-date {
    font-size: var(--text-sm);
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.5s ease;
}

.incident-date::before {
    content: '\f133';
    /* Icône calendar */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    color: var(--primary);
}

/* Description de l'incident */
.incident-description {
    color: var(--dark-text);
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-relaxed);
    transition: color 0.5s ease;
}

/* Statut de l'incident */
.incident-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--corner-radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Styles spécifiques selon le statut */
.incident-status.resolved {
    background-color: rgba(64, 227, 120, 0.1);
    color: var(--primary);
}

.incident-status.ongoing {
    background-color: rgba(255, 57, 57, 0.1);
    color: var(--red);
}

/* Icônes pour les statuts */
.incident-status.resolved::before {
    content: '\f058';
    /* Icône check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
}

.incident-status.ongoing::before {
    content: '\f254';
    /* Icône hourglass */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
}

/* ÉTAPE 5: FOOTER ET BOUTON "RETOUR EN HAUT"
-------------------------------------------------- */

/* Footer
-------------------------------------------------- */
.status-footer {
    margin-top: auto;
    background-color: var(--card-bg);
    padding: var(--spacing-xl) 0 0;
    border-radius: var(--corner-radius-lg);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

/* Contenu principal du footer */
.footer-content {
    display: flex;
    position: relative;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding: 0 20px 0 20px;
    justify-content: space-between;
}

/* Logo dans le footer */
.footer-logo img {
    height: 35px;
    border-radius: var(--corner-radius-sm);
}

/* Liens dans le footer */
.footer-links {
    padding: 10px 0px 0px 0px;
    display: inline-flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* Liens sociaux */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--light-bg);
    color: var(--primary);
    border-radius: 50%;
    transition: background-color 0.5s ease, color 0.3s ease, transform 0.3s ease;
    font-size: var(--text-sm);
}

.social-link:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* Lien vers le site web */
.website-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background-color: var(--light-bg);
    color: var(--primary);
    border-radius: var(--corner-radius-pill);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background-color 0.5s ease, color 0.3s ease, transform 0.3s ease;
}

.website-link:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* Bas du footer (copyright) */
.footer-bottom {
    display: flex;
    justify-content: center;
    text-align: center;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-top: 1px solid var(--light-bg);
    transition: border-color 0.5s ease;
}

.footer-bottom p {
    font-size: var(--text-xs);
    color: var(--light-text);
    margin-bottom: 0;
}

/* Bouton retour en haut
-------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 99;
    border: none;
    box-shadow: 0 4px 12px rgba(64, 227, 120, 0.25);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(64, 227, 120, 0.35);
}

/* ÉTAPE 6: ANIMATIONS ET RESPONSIVE DESIGN
-------------------------------------------------- */

/* Animations générales
-------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation des éléments principaux */
.status-header,
.status-overview,
.section-header {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Animation séquentielle des cartes de service */
.service-card {
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: calc(0.1s * var(--animation-order, 0));
}

/* Animation séquentielle des incidents */
.incident-item {
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: calc(0.1s * var(--animation-order, 0));
}

/* Ordre d'animation pour des éléments spécifiques */
.service-card:nth-child(1) {
    --animation-order: 1;
}

.service-card:nth-child(2) {
    --animation-order: 2;
}

.service-card:nth-child(3) {
    --animation-order: 3;
}

.service-card:nth-child(4) {
    --animation-order: 4;
}

.incident-item:nth-child(1) {
    --animation-order: 1;
}

.incident-item:nth-child(2) {
    --animation-order: 2;
}

/* Media Queries pour la responsivité
-------------------------------------------------- */

/* Grand écrans et desktop */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

/* Tablettes et petits écrans */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobiles en mode paysage */
@media (max-width: 768px) {
    :root {
        --spacing-3xl: 48px;
        --spacing-2xl: 36px;
        --spacing-xl: 24px;
    }

    .status-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .last-updated {
        align-self: flex-start;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .incident-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .footer-logo {
        margin-bottom: var(--spacing-md);
    }

    .footer-links {
        justify-content: center;
    }
}

/* Mobiles en mode portrait */
@media (max-width: 576px) {
    :root {
        --text-3xl: 1.75rem;
        --text-2xl: 1.5rem;
        --text-xl: 1.25rem;
        --text-lg: 1.125rem;
        --spacing-xl: 20px;
        --spacing-lg: 16px;
    }

    .container {
        padding: 10px;
    }

    .status-header,
    .service-card,
    .incident-content {
        padding: var(--spacing-md);
    }

    .status-overview {
        padding: var(--spacing-lg);
    }

    .status-overview h2 {
        font-size: var(--text-lg);
    }

    .incident-date,
    .service-last-check {
        font-size: 10px;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
}

/* Préférences pour réduire les animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .service-card,
    .incident-item,
    .status-header,
    .status-overview {
        animation: none !important;
    }

    .incident-marker.ongoing {
        animation: none !important;
    }
}

/* ÉTAPE 7: SCRIPT POUR LE MODE SOMBRE/CLAIR (OPTIONNEL)
-------------------------------------------------- */

/* Styles pour le bouton de bascule thème sombre/clair */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--primary);
    border: none;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

/* Force le mode clair */
html[data-theme="light"] {
    /* Les valeurs par défaut de :root sont déjà en mode clair */
}

/* Force le mode sombre */
html[data-theme="dark"] {
    --white: #1E1E1E;
    --black: #FFFFFF;
    --main-text: #E0E0E0;
    --light-text: #B0B0B0;
    --light-icon: #8A8A8A;
    --dark-text: #C0C0C0;
    --light-bg: #2C2C2C;
    --dark-bg: #0A0A0A;
    --bg: #121212;
    --black-sheet-bg: #252525;
    --card-bg: #252525;
    --card-border: rgba(255, 255, 255, 0.05);

    /* Ombres pour le mode sombre */
    --box-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
    --box-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.refresh-btn {
    margin-left: 8px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

.json-data-section {
    margin-bottom: var(--spacing-2xl);
}

.json-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.json-item {
    background-color: var(--card-bg);
    border-radius: var(--corner-radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.json-header {
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.json-header:hover {
    background-color: var(--light-bg);
}

.json-header h4 {
    margin: 0;
    font-weight: 600;
}

.json-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.json-content.active {
    max-height: 500px;
    overflow-y: auto;
}

.json-content pre {
    background-color: var(--json-bg);
    color: var(--json-text);
    padding: var(--spacing-md);
    border-radius: 0;
    margin: 0;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(64, 227, 120, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--corner-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: var(--text-base);
    gap: var(--spacing-sm);
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.error-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.error-page {
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    border-radius: var(--corner-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.error-code {
    font-size: 90px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--spacing-lg);
    text-shadow: 2px 2px 0 var(--pulsing);
    letter-spacing: -0.03em;
    position: relative;
    display: inline-block;
}

.error-code::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

.error-page h1 {
    font-size: var(--text-2xl);
    margin-top: var(--spacing-lg);
}

.error-message {
    color: var(--dark-text);
    max-width: 600px;
    margin: 0 auto var(--spacing-2xl);
    font-size: var(--text-md);
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.btn-primary, .cta-button {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(64, 227, 120, 0.15);
    padding: calc(var(--spacing-md) - 2px) calc(var(--spacing-xl) - 2px);
    border-radius: var(--corner-radius);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: calc(var(--spacing-md) - 2px) calc(var(--spacing-xl) - 2px);
    border-radius: var(--corner-radius);
}

.status-overview.status-operational {
    background-color: var(--primary);
}

.status-overview.status-incident {
    background-color: var(--red);
}

.status-overview.status-degraded {
    background-color: var(--orange);
}