/* ============================================
   DASHBOARD AMÉLIORE CSS
   Styles complémentaires pour le nouveau design
   Date : 5 Novembre 2025
   ============================================ */

/* ===== NOUVELLES CARTES STATISTIQUES (MODÈLE IMAGE 2) ===== */
.card-stat {
    background: linear-gradient(135deg, #FF6B35 0%, #E85A2B 100%);
    border-radius: 16px !important;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* En-tête de carte (Icône + Titre sur même ligne) */
.card-stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.card-stat-header i {
    font-size: 2rem;
    color: rgba(255,255,255,0.95);
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    animation: float-icon 3s ease-in-out infinite;
}

.card-stat-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Corps de carte (Nombre + Bouton Gérer) */
.card-stat-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.card-stat-body h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.btn-manage {
    background: rgba(255,255,255,0.2);
    color: #FFFFFF !important;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.btn-manage:hover {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
    text-decoration: none;
}

.btn-manage i {
    font-size: 0.9rem;
    animation: pulse-icon 2s ease-in-out infinite;
}

/* ===== COULEURS DES CARTES STAT ===== */
.card-stat-red {
    background: linear-gradient(135deg, #FF6B35 0%, #E85A2B 100%);
}

.card-stat-info {
    background: linear-gradient(135deg, #17A2B8 0%, #138496 100%);
}

.card-stat-success {
    background: linear-gradient(135deg, #28A745 0%, #1E7E34 100%);
}

.card-stat-warning {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
}

.card-stat-green {
    background: linear-gradient(135deg, #28A745 0%, #1E7E34 100%);
}

.card-stat-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.card-stat-dark {
    background: linear-gradient(135deg, #343A40 0%, #23272b 100%);
}

.card-stat-cyan {
    background: linear-gradient(135deg, #17A2B8 0%, #138496 100%);
}

/* ===== CARTES COMPACTES (STATS CONDENSÉES) ===== */
.card-compact {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-compact .card-header {
    padding: 12px 18px !important;
    border-bottom: none;
}

.card-compact .card-header h3 {
    font-size: 1rem !important;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-compact .card-header h3 i {
    font-size: 1.1rem;
    animation: rotate-slow 8s linear infinite;
}

.card-body-compact {
    padding: 12px 18px;
    background: #FFFFFF;
}

/* Ligne de statistique */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #F8F9FA;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.stat-row:hover {
    background: #E9ECEF;
    transform: translateX(3px);
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-row span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-row span i {
    font-size: 0.9rem;
}

.stat-row strong {
    font-size: 1.3rem;
    font-weight: 700;
    color: #212529;
}

/* ===== GRAPHIQUES AMÉLIORÉS ===== */
.chart-container {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #FF6B35;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title i {
    color: #FF6B35;
    font-size: 1.2rem;
}

/* Canvas graphiques */
canvas {
    border-radius: 10px !important;
    background: #FAFBFC;
    padding: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .card-stat-body h2 {
        font-size: 2.2rem;
    }
    
    .card-stat-header i {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .card-stat {
        min-height: 120px;
        padding: 15px;
    }
    
    .card-stat-header {
        gap: 10px;
    }
    
    .card-stat-header i {
        font-size: 1.6rem;
    }
    
    .card-stat-header h3 {
        font-size: 0.95rem;
    }
    
    .card-stat-body h2 {
        font-size: 1.8rem;
    }
    
    .btn-manage {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .stat-row span {
        font-size: 0.8rem;
    }
    
    .stat-row strong {
        font-size: 1.1rem;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    .chart-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .card-stat {
        min-height: 110px;
        padding: 12px;
    }
    
    .card-stat-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stat-row {
        padding: 6px 10px;
    }
    
    .card-body-compact {
        padding: 10px 15px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-stat {
    animation: slideIn 0.4s ease;
}

.stat-row {
    animation: slideIn 0.3s ease;
}

/* Délai d'animation pour effet en cascade */
.card-stat:nth-child(1) { animation-delay: 0.05s; }
.card-stat:nth-child(2) { animation-delay: 0.10s; }
.card-stat:nth-child(3) { animation-delay: 0.15s; }
.card-stat:nth-child(4) { animation-delay: 0.20s; }
.card-stat:nth-child(5) { animation-delay: 0.25s; }
.card-stat:nth-child(6) { animation-delay: 0.30s; }
.card-stat:nth-child(7) { animation-delay: 0.35s; }
.card-stat:nth-child(8) { animation-delay: 0.40s; }

/* ===== ANIMATIONS ICÔNES INFINIES ===== */
@keyframes float-icon {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(5deg);
    }
    50% {
        transform: translateY(0px) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) rotate(-5deg);
    }
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== ANIMATIONS AU SCROLL ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== BADGES DANS LES TABLEAUX ===== */
.badge-modern {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-success {
    background: #28A745 !important;
    color: #FFFFFF !important;
}

.badge-info {
    background: #17A2B8 !important;
    color: #FFFFFF !important;
}

/* ===== AMÉLIORATIONS TABLEAUX ===== */
.table-modern {
    font-size: 0.85rem;
}

.table-modern thead th {
    font-size: 0.8rem;
    padding: 10px 12px !important;
}

.table-modern tbody td {
    padding: 8px 12px !important;
    vertical-align: middle;
}

.table-modern .card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FF6B35;
    margin: 0;
}

/* ===== SUPPRESSION DES MARGES INUTILES ===== */
.card-header-right {
    margin-left: auto;
}

.card-option {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

.card-option li {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card-option li:hover {
    transform: scale(1.15);
}

/* ===== ONGLETS MODERNES ===== */
.nav-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-tabs-title {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.modern-tabs {
    display: flex;
    gap: 5px;
    border: none;
}

.modern-tabs .nav-item {
    margin: 0;
}

.modern-tabs .nav-link {
    border-radius: 8px;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8) !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modern-tabs .nav-link:hover {
    background: rgba(255,255,255,0.2);
    color: #FFFFFF !important;
}

.modern-tabs .nav-link.active {
    background: rgba(255,255,255,0.3);
    color: #FFFFFF !important;
    font-weight: 700;
}

.modern-tabs .nav-link i {
    font-size: 0.85rem;
}

/* ===== RÉDUCTION DU HEADER (BANDE ORANGE) ===== */
.header-top {
    height: 50px !important;
    min-height: 50px !important;
    padding: 8px 20px !important;
}

.header-top .container-fluid {
    padding: 0 !important;
}

.header-top .top-menu {
    height: 34px !important;
}

.header-top .btn-icon,
.header-top .nav-link {
    height: 34px !important;
    width: 34px !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.header-top .avatar {
    width: 34px !important;
    height: 34px !important;
}

.header-top i {
    font-size: 1.1rem !important;
}

/* ===== ONGLETS MODERNES ET VISIBLES ===== */
.nav-tabs-navigation {
    background: transparent !important;
    padding: 0 !important;
}

.nav-tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 15px;
}

.nav-tabs-title {
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: #FFFFFF !important;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav-tabs.modern-tabs {
    display: flex;
    gap: 8px;
    border: none !important;
    background: rgba(0,0,0,0.1);
    padding: 4px;
    border-radius: 10px;
}

.modern-tabs .nav-item {
    margin: 0 !important;
}

.modern-tabs .nav-link {
    border-radius: 8px !important;
    padding: 10px 18px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border: 2px solid transparent !important;
    background: transparent !important;
    color: rgba(255,255,255,0.75) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative;
    overflow: visible !important;
}

.modern-tabs .nav-link i {
    font-size: 1rem !important;
    color: rgba(255,255,255,0.85) !important;
    transition: all 0.3s ease;
}

.modern-tabs .nav-link:hover {
    background: rgba(255,255,255,0.15) !important;
    color: #FFFFFF !important;
    border-color: rgba(255,255,255,0.3) !important;
    transform: translateY(-2px);
}

.modern-tabs .nav-link:hover i {
    color: #FFFFFF !important;
    transform: scale(1.1);
}

.modern-tabs .nav-link.active,
.modern-tabs .nav-link.show {
    background: rgba(255,255,255,0.95) !important;
    color: #212529 !important;
    border-color: rgba(255,255,255,0.95) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.modern-tabs .nav-link.active i,
.modern-tabs .nav-link.show i {
    color: #FF6B35 !important;
}

/* Indicateur actif sous l'onglet */
.modern-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(255,255,255,0.95);
}

/* ===== AMÉLIORATION DES EN-TÊTES DE CARTES ===== */
.card-header {
    padding: 14px 20px !important;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    font-size: 1.15rem !important;
}

/* En-têtes colorés avec meilleur contraste */
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-primary,
.card-header.bg-dark,
.card-header.bg-warning {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ===== RESPONSIVE POUR LES ONGLETS ===== */
@media (max-width: 992px) {
    .nav-tabs-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .nav-tabs.modern-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .modern-tabs .nav-link {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
    }
    
    .nav-tabs-title {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 768px) {
    .header-top {
        height: 45px !important;
        padding: 6px 15px !important;
    }
    
    .header-top .btn-icon,
    .header-top .nav-link {
        height: 32px !important;
        width: 32px !important;
    }
    
    .modern-tabs .nav-link {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 576px) {
    .header-top {
        height: 42px !important;
        padding: 5px 10px !important;
    }
    
    .nav-tabs-title {
        font-size: 0.85rem !important;
    }
    
    .modern-tabs .nav-link {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
        gap: 5px !important;
    }
    
    .modern-tabs .nav-link i {
        font-size: 0.85rem !important;
    }
}

/* ===== FIN DU FICHIER CSS ===== */