/* =========================================
   2. VARIABLES & RESET GLOBALE
   ========================================= */
   :root {
    /* --- NOUVELLES VARIABLES (Navigation) --- */
    --nav-bg: rgba(46, 64, 83, 0.95);
    --nav-color: #fff;
    --active-color: #f3c56c;
    --nav-radius: 16px;
    --nav-padding: 0.5rem;
    --transition-speed: 0.3s;

    /* --- ANCIENNES VARIABLES (Thème global) --- */
    --sidebar-bg: #2e4053;
    --text-color: #fff;
    --item-color: #dfe0e2;
    --item-hover-bg: #f3c56c;
    --item-hover-color: #2e4053;
    --header-color: #ffffff;
    --accent-color: #ff875f; 
    
    --accent-900: #49a87d;
    --accent-800: #1b945b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #dfe0e2;
    font-family: OpenSansRegular, 'sans-serif';
    overflow-x: hidden;
    
    /* Padding pour ne pas cacher le contenu sous la navbar desktop */
    padding-top: 100px; 
    padding-bottom: 0;
}

/* =========================================
   3. NOUVEAU SYSTÈME DE NAVIGATION (Sidebar)
   ========================================= */
.sidebar {
    position: fixed;
    width: auto;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    
    /* Design "Glassmorphism" */
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--nav-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    
    /* Layout Flexbox Horizontal */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--nav-padding);
    
    transition: all var(--transition-speed) ease;
}

/* On cache les anciens boutons toggle/hamburger */
.toggle-menu, .hamburger {
    display: none !important;
}

.sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--nav-color);
    padding: 10px 16px;
    border-radius: 12px;
    transition: background var(--transition-speed), transform 0.2s;
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-icon svg, .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 24px;
    display: block;
    text-align: center;
}

.nav-label {
    font-family: 'OpenSansRegular', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    position: static;
    transform: none;
    margin-left: 0;
}

/* Badge de notification */
.badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    position: absolute;
    top: 5px;
    right: 5px;
}

/* Désactivation des tooltips de l'ancien code */
.nav-link::after {
    display: none; 
}

/* =========================================
   4. LAYOUT DU CONTENU (Conservé de l'ancien)
   ========================================= */

.app-layout {
    background: var(--item-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: 0 !important;
    transition: margin-left 0.35s ease;
}

.main-content {
    flex: 1;
    background: var(--item-color);
    padding: 32px;
    width: 100%;
}

/* Styles des Titres */
h1 {
    text-align: center;
    font-size: 32px;
    color: var(--accent-color);
    font-weight: 700;
    font-family: BodoniBold, 'sans-serif';
    margin-bottom: 24px;
    position: relative;
}

h1::after {
    content: "";
    display: inline-block;
    width: 40px; 
    height: 40px;
    background-image: url('/public/resources/images/flash_icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 10px;
    vertical-align: middle;
}

/* Header & Footer */
.main-header {
    background-color: var(--header-color);
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky; 
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.main-header-logo {
    height: 60px; 
    width: auto;
}

.main-footer {
    background: var(--header-color);
    padding: 20px;
    text-align: center;
}
.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}
.footer-column h4 { font-size: 18px; margin-bottom: 10px; }
.footer-column ul li a { text-decoration: none; color: #555; font-size: 14px; }

/* Helpers Fonts */
.bodoni { font-family: 'BodoniRegular', serif !important; }
.bodoni-bold { font-family: 'BodoniBold', serif !important; }
.button { appearance: none; background: no-repeat; border: none; font: inherit; margin: 0; color: currentColor; padding: 0; }

/* ===============================
   LOADER
   =============================== */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
    grid-column: 1 / -1;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--q-border);
    border-top-color: var(--q-salmon);
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    color: #94A3B8;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   5. MEDIA QUERIES (DESKTOP vs MOBILE)
   ========================================= */

/* --- DESKTOP (> 900px) --- */
@media (min-width: 900px) {
    .sidebar {
        top: 20px;
        bottom: auto;
        min-width: 600px;
        max-width: 90%; 
    }

    .secondary-nav {
        border-left: 1px solid rgba(255,255,255,0.2);
        padding-left: 1rem;
        margin-left: 1rem;
    }
}

/* --- MOBILE (< 899px) --- */
@media (max-width: 899px) {
    body {
        padding-top: 20px;
        padding-bottom: 100px; /* Espace pour le dock en bas */
    }

    .sidebar {
        top: auto;
        bottom: 20px; /* Flotte au-dessus du bas de l'écran */
        width: 90%; 
        max-width: 400px;
        justify-content: center;
        padding: 10px 15px;
        margin-bottom: env(safe-area-inset-bottom);
        transform: translateX(-50%);
    }

    .sidebar-nav {
        width: 100%;
        justify-content: space-between;
        margin-top: 0;
        padding-top: 0;
    }

    .nav-list {
        gap: 0;
        width: auto;
    }
    
    .primary-nav, .secondary-nav {
        display: contents; 
    }

    .nav-link {
        flex-direction: column;
        padding: 8px;
        gap: 4px;
        border-radius: 50%; 
        width: 38px;
        height: 48px;
        justify-content: center;
    }

    .nav-link:hover {
        background: transparent;
        transform: translateY(-5px);
    }
    
    .nav-link:active {
        transform: scale(0.95);
    }

    .nav-label {
        display: none; 
    }

    .nav-icon { margin: 0; }
    
    .badge {
        top: 0;
        right: 0;
    }

    /* Ajustements Layout Contenu Mobile */
    .main-content {
        padding: 20px 15px;
    }

    .main-header {
        justify-content: center;
        height: 70px;
    }
    
    .footer-container {
        flex-direction: column;
    }
}

/* Switch (radios stylisées) */
.switch {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--q-bg-light);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.switch:hover {
    border-color: #cbd5e0;
}

.switch input[type="radio"] {
    display: none;
}

.slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #cbd5e0;
    border-radius: 34px;
    transition: .4s;
    flex-shrink: 0;
}

.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--q-salmon);
}

input:checked + .slider::before {
    transform: translateX(24px);
}

.slider .on, .slider .off { display: none; }

.switch-label {
    flex: 1;
    text-align: left;
    font-size: 0.95rem;
    color: var(--q-text-main);
}

input:checked ~ .switch-label {
    font-weight: 700;
    color: var(--q-indigo);
}

input[type="radio"]:disabled + .slider {
    background-color: #ccc;
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="radio"]:disabled ~ .switch-label {
    color: #999;
    cursor: not-allowed;
}


.main-footer {
    background-color: var(--header-color); 
    border-top: 1px solid rgba(0,0,0,0.05); 
    padding: 60px 20px;
    color: var(--sidebar-bg); 
    margin-top: auto; 
}

.footer-container {
    display: flex;
    flex-direction: row; 
    justify-content: space-evenly; 
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}


.footer-column {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}


.footer-column h4 {
    font-family: 'BodoniBold', serif;
    font-size: 18px;
    color: var(--accent-color); 
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}


.footer-column h4::after {
    content: '';
    display: block;
    width: 200px;
    height: 2px;
    background: var(--item-hover-bg); 
    margin-top: 8px;
}


.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    text-decoration: none;
    color: #555; 
    font-family: 'OpenSansRegular', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}


.footer-column ul li a:hover {
    color: var(--accent-color);
    transform: translateX(5px); 
}


.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--item-color);
    color: var(--sidebar-bg);
    border-radius: 50%; 
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 135, 95, 0.3);
}

@media (max-width: 899px) {
    .main-footer {
        padding: 40px 20px;
         padding-bottom: 110px; 
    }

    .footer-container {
        flex-direction: column; 
        align-items: center; 
        text-align: center;
        gap: 50px;
    }

    .footer-column {
        width: 100%;
        align-items: center;
    }

    /* On centre la petite ligne sous le titre */
    .footer-column h4::after {
        margin-left: auto;
        margin-right: auto;
    }

 
    .footer-column ul li {
        margin-bottom: 15px;
    }
    
    .footer-column ul li a {
        font-size: 16px;
        padding: 5px; 
    }
}


@media (min-width: 900px) {
    .badge {
        top: 2px;
        right: 111px;
    }
}

#toast-host {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 22, 30, .92);
  color: #f5f5f7;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .2);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .25s ease;
  position: relative;
  overflow: hidden;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }

.toast-icon { font-size: 28px; }
.toast-success .toast-icon { color: #34d399; }
.toast-error   .toast-icon { color: #f87171; }

.toast-body { display: flex; flex-direction: column; line-height: 1.25; }
.toast-body strong { font-size: 14px; font-weight: 600; }
.toast-body span   { font-size: 13px; opacity: .75; }

.toast-close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: .5;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: opacity .2s, background .2s;
}
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, .08); }

.toast-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transform-origin: left;
  animation: toast-bar 4s linear forwards;
}
.toast-success .toast-progress { background: linear-gradient(90deg, #10b981, #34d399); }
.toast-error   .toast-progress { background: linear-gradient(90deg, #ef4444, #f87171); }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* =========================================
   EMPTY STATE (état vide réutilisable)
   ========================================= */
.empty-state {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px 80px;
    animation: fadeInUp 0.5s ease-out;
}

.empty-state img {
    width: 180px;
    height: auto;
    opacity: 0.7;
    margin-bottom: 24px;
    filter: grayscale(20%);
}

.empty-state p {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #94A3B8;
    margin: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 899px) {
    .empty-state {
        padding: 40px 16px 60px;
    }

    .empty-state img {
        width: 140px;
    }

    .empty-state p {
        font-size: 1rem;
    }
}

