/* Thème Dark Anthracite avec Titres Jaunes - Application Email */

:root {
    /* Couleurs dark theme */
    --bs-primary: #3a3a3a;
    --bs-primary-rgb: 58, 58, 58;
    --bs-primary-text-emphasis: #2a2a2a;
    --bs-primary-bg-subtle: #2a2a2a;
    --bs-primary-border-subtle: #4a4a4a;
    
    /* Couleurs anthracite */
    --anthracite: #2c2c2c;
    --anthracite-light: #3a3a3a;
    --anthracite-dark: #1e1e1e;
    
    /* Couleurs d'accent */
    --yellow-accent: #667eea;
    --yellow-accent-hover: #5568d3;
    --yellow-text: #667eea;
    
    /* Variations pour les états hover/active */
    --bs-primary-hover: #4a4a4a;
    --bs-primary-active: #2a2a2a;
    
    /* Couleurs complémentaires */
    --bs-dark: #1e1e1e;
    --bs-dark-rgb: 30, 30, 30;
    
    /* Couleurs spécifiques Email */
    --email-color: #007bff;
    --email-hover: #0056b3;
    --template-color: #28a745;
    --template-hover: #1e7e34;
    --campaign-color: #ffc107;
    --campaign-hover: #e0a800;
    
    /* Thème couleur pour PWA */
    --theme-color: #2c2c2c;
    
    /* Couleurs texte */
    --text-light: #e9ecef;
    --text-muted: #adb5bd;
}

/* Body et background - garder les fonds clairs */
body {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    padding-bottom: 60px !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

/* Cards et conteneurs - garder les fonds clairs */
.card {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.card-header {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

/* Container et sections */
.container, .container-fluid {
    color: #212529;
}

/* Titres en noir (sauf navbar-brand) */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    color: #212529 !important;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: bold;
}

.page-title, .section-title {
    color: #212529 !important;
}

/* Navbar anthracite */
.navbar {
    background-color: var(--anthracite) !important;
    border-bottom: 3px solid #667eea;
    min-height: 60px;
    max-height: 60px;
}

.navbar-brand {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Boutons primaires avec thème anthracite */
.btn-primary {
    background-color: var(--anthracite) !important;
    border-color: var(--anthracite) !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: var(--anthracite-light) !important;
    border-color: var(--anthracite-light) !important;
    color: white !important;
}

.btn-primary:focus {
    background-color: var(--anthracite-light) !important;
    border-color: var(--anthracite-light) !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(44, 44, 44, 0.25);
}

.btn-primary:active {
    background-color: var(--anthracite-dark) !important;
    border-color: var(--anthracite-dark) !important;
    color: white !important;
}

/* Boutons outline */
.btn-outline-primary {
    color: var(--anthracite) !important;
    border-color: var(--anthracite) !important;
}

.btn-outline-primary:hover {
    background-color: var(--anthracite) !important;
    border-color: var(--anthracite) !important;
    color: white !important;
}

/* Badges avec thème */
.badge-primary {
    background-color: var(--anthracite) !important;
}

.badge-email {
    background-color: var(--email-color);
}

.badge-template {
    background-color: var(--template-color);
}

.badge-campaign {
    background-color: var(--campaign-color);
}

/* Tableaux */
.table-email {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-email thead {
    background-color: var(--anthracite);
    color: white;
}

.table-email thead th {
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.table-email tbody tr:hover {
    background-color: #f8f9fa;
}

/* Alertes personnalisées */
.alert-email {
    background-color: #cce7ff;
    border-color: #b8daff;
    color: #004085;
}

.alert-template {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-campaign {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Formulaires */
.form-control:focus {
    border-color: var(--yellow-accent);
    box-shadow: 0 0 0 0.2rem rgba(131, 198, 253, 0.25);
}

.form-select:focus {
    border-color: var(--yellow-accent);
    box-shadow: 0 0 0 0.2rem rgba(131, 198, 253, 0.25);
}

/* Sidebar navigation - Menu dépliant */
.sidebar-com {
    background: #ffffff;
    min-height: calc(100vh - 56px);
    border-right: 1px solid var(--yellow-accent);
    width: 70px;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 1000; /* Z-index élevé pour passer devant le contenu */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3); /* Ombre même quand repliée */
}

/* HOVER DÉSACTIVÉ - Seule la classe .expanded fonctionne maintenant */
.sidebar-com.expanded {
    width: 280px;
    z-index: 1050; /* Z-index encore plus élevé quand déplié */
    position: relative;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3); /* Ombre pour bien marquer la superposition */
}

.sidebar-com .nav-link {
    color: #2c2c2c;
    padding: 15px 20px;
    margin: 5px 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-com .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--anthracite);
    transform: translateX(5px);
}

.sidebar-com .nav-link.active {
    background-color: var(--yellow-accent);
    color: white;
    font-weight: 600;
}

.sidebar-com .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 15px;
    font-size: 16px;
}

.sidebar-com .nav-text {
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-left: 10px;
}

.sidebar-com.expanded .nav-text {
    opacity: 1;
}

/* Bouton toggle sidebar */
.sidebar-toggle {
    position: absolute;
    top: 50%; /* Centré verticalement */
    transform: translateY(-50%); /* Ajustement parfait du centrage */
    right: -15px;
    background: var(--yellow-accent);
    color: #ffffff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.8em;
    display: block; /* Visible sur desktop aussi maintenant */
    z-index: 1060;
    box-shadow: 0 2px 10px rgba(131, 198, 253, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #5568d3;
    transform: translateY(-50%) scale(1.1); /* Préserver le centrage même au hover */
}

/* Logo Guilmault centré dans le header (comme COM) */
.header-center-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 46px; /* légèrement plus que la barre pour cropping naturel */
    display: flex;
    align-items: center;
    pointer-events: none; /* ne bloque pas les clics sur la navbar */
}

.header-center-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* Séparateur admin */
.admin-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--yellow-accent), transparent);
    margin: 20px 15px;
    border-radius: 1px;
}

/* Overlay mobile */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-com {
        width: 0;
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100vh - 56px);
        z-index: 1000;
    }
    
    .sidebar-com.expanded {
        width: 280px;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styles pour les indicateurs de swipe */
.swipe-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
}

.table-responsive.scrolled-left::after {
    content: '←';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 50%;
    font-size: 12px;
    z-index: 10;
}

.table-responsive.scrolled-right::before {
    content: '→';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 50%;
    font-size: 12px;
    z-index: 10;
}
