/* ==========================================================================
   STYLES SPÉCIFIQUES AU TABLEAU DE BORD - ACADÉMIE ACHIM
   ========================================================================== */

:root {
    --sidebar-width: 280px;
    --header-height: 70px;
    --primary-blue: #1e3a8a;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --gold: #fbbf24;
    --dark-gold: #d97706;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

/* ==========================================================================
   LAYOUT PRINCIPAL ENFANTIN
   ========================================================================== */

.main-wrapper {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 5px 0 25px rgba(30, 58, 138, 0.2);
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    background: transparent;
}

/* ==========================================================================
   HEADER DU TABLEAU DE BORD ENFANTIN
   ========================================================================== */

.dashboard-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 3px solid var(--light-blue);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.1);
    border-radius: 0 0 25px 25px;
    margin: 0 1rem 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, var(--gold), var(--secondary-blue));
}

.dashboard-header h1 {
    color: var(--primary-blue);
    font-size: 2.25rem;
    font-weight: 700;
    font-family: 'Fredoka One', cursive;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-blue);
    font-size: 1.2rem;
}

.breadcrumb-item a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: var(--gold);
    font-weight: 700;
}

/* ==========================================================================
   CARTES DE STATISTIQUES ENFANTINES
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    border-left: 6px solid;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: inherit;
    opacity: 0.3;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.2);
}

.stat-card.primary { 
    border-left-color: var(--primary-blue);
    background: linear-gradient(135deg, #ffffff 0%, #e8f4fd 100%);
}

.stat-card.success { 
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.stat-card.info { 
    border-left-color: var(--secondary-blue);
    background: linear-gradient(135deg, #ffffff 0%, var(--light-blue) 100%);
}

.stat-card.warning { 
    border-left-color: var(--gold);
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.stat-card-body {
    padding: 2rem;
    position: relative;
}

.stat-card-title {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    font-family: 'Fredoka One', cursive;
    margin-bottom: 0.5rem;
}

.stat-card-change {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-card-change.positive {
    color: var(--success-color);
}

.stat-card-change.negative {
    color: var(--danger-color);
}

.stat-card-icon {
    position: absolute;
    right: 2rem;
    top: 2rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.stat-card.primary .stat-card-icon {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}

.stat-card.success .stat-card-icon {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.stat-card.info .stat-card-icon {
    background: linear-gradient(135deg, var(--secondary-blue), #60a5fa);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.stat-card.warning .stat-card-icon {
    background: linear-gradient(135deg, var(--gold), var(--dark-gold));
    color: white;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.3);
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.1) rotate(10deg);
}

/* ==========================================================================
   GRAPHIQUES ET DIAGRAMMES ENFANTINS
   ========================================================================== */

.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.1);
    margin-bottom: 2rem;
    padding: 2rem;
    border: 2px solid var(--light-blue);
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: 0 15px 40px rgba(30, 58, 138, 0.15);
    transform: translateY(-5px);
}

.chart-header {
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.chart-title {
    color: var(--primary-blue);
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Fredoka One', cursive;
    margin: 0;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-body {
    position: relative;
    height: 350px;
}

/* ==========================================================================
   TABLEAUX DU TABLEAU DE BORD ENFANTINS
   ========================================================================== */

.dashboard-table {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 2px solid var(--light-blue);
}

.dashboard-table .table {
    margin-bottom: 0;
    border-radius: 20px;
}

.dashboard-table .table th {
    border-top: none;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1.25rem 1.5rem;
    font-family: 'Fredoka One', cursive;
    border-bottom: 3px solid var(--light-blue);
}

.dashboard-table .table td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    border-top: 2px solid var(--light-blue);
    transition: all 0.3s ease;
}

.dashboard-table .table tbody tr:hover td {
    background: var(--light-blue);
    transform: scale(1.01);
}

/* ==========================================================================
   WIDGETS ET COMPOSANTS ENFANTINS
   ========================================================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.quick-action-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid var(--light-blue);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--primary-blue);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.quick-action-btn:hover::before {
    left: 100%;
}

.quick-action-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.2);
    border-color: var(--secondary-blue);
    color: var(--primary-blue);
    text-decoration: none;
}

.quick-action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-action-btn:hover .quick-action-icon {
    transform: scale(1.2) rotate(10deg);
}

.quick-action-text {
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Fredoka One', cursive;
}

/* Liste d'activités récentes */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--light-blue);
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--light-blue);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 0 -1rem;
    transform: translateX(10px);
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    flex-shrink: 0;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.activity-icon.primary { 
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.activity-icon.success { 
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.activity-icon.warning { 
    background: linear-gradient(135deg, var(--gold), var(--dark-gold));
    color: white;
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.3);
}

.activity-icon.danger { 
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: white;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.activity-item:hover .activity-icon {
    transform: scale(1.1) rotate(10deg);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.activity-description {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.activity-time {
    color: var(--secondary-blue);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.activity-time i {
    margin-right: 0.5rem;
    color: var(--gold);
}

/* ==========================================================================
   BADGES ET INDICATEURS ENFANTINS
   ========================================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.status-badge.success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
}

.status-badge.warning {
    background: linear-gradient(135deg, var(--gold), var(--dark-gold));
    color: white;
}

.status-badge.danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: white;
}

.status-badge.info {
    background: linear-gradient(135deg, var(--secondary-blue), #60a5fa);
    color: white;
}

/* Indicateur de progression */
.progress-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    background: var(--light-blue);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.progress-indicator:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
}

.progress-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.progress-value {
    margin-left: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
}

/* ==========================================================================
   PAGINATION PERSONNALISÉE ENFANTINE
   ========================================================================== */

.dashboard-pagination .page-link {
    color: var(--primary-blue);
    border: 2px solid var(--light-blue);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    margin: 0 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dashboard-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-color: var(--primary-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.dashboard-pagination .page-link:hover {
    color: var(--secondary-blue);
    background-color: var(--light-blue);
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dashboard-header {
        padding: 1.25rem;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .stat-card-body {
        padding: 1.5rem;
    }
    
    .stat-card-value {
        font-size: 2rem;
    }
    
    .stat-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .chart-body {
        height: 300px;
    }
    
    .stat-card-value {
        font-size: 1.75rem;
    }
    
    .activity-item {
        flex-direction: column;
        text-align: center;
    }
    
    .activity-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .dashboard-header {
        border-radius: 0 0 20px 20px;
        margin: 0 0 1rem 0;
    }
}

/* ==========================================================================
   ANIMATIONS SPÉCIFIQUES ENFANTINES
   ========================================================================== */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.bounce-in {
    animation: bounceIn 0.6s ease;
}

/* ==========================================================================
   UTILITAIRES SPÉCIFIQUES ENFANTINS
   ========================================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-left-primary { border-left: 6px solid var(--primary-blue) !important; }
.border-left-success { border-left: 6px solid var(--success-color) !important; }
.border-left-info { border-left: 6px solid var(--secondary-blue) !important; }
.border-left-warning { border-left: 6px solid var(--gold) !important; }

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #34d399) !important;
}

.bg-gradient-gold {
    background: linear-gradient(135deg, var(--gold), var(--dark-gold)) !important;
}

.shadow-custom {
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.15) !important;
}

/* Loading states enfantins */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    border: 0.3em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    margin-left: -1.5rem;
    margin-top: -1.5rem;
    background: conic-gradient(from 0deg, var(--gold), var(--secondary-blue), var(--primary-blue), var(--gold));
}

/* Éléments décoratifs */
.floating-elements {
    position: relative;
}

.floating-elements::before {
    content: '✦';
    position: absolute;
    top: -10px;
    right: -10px;
    color: var(--gold);
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

/* Cartes spéciales pour enfants */
.kids-card {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border: 3px dashed var(--secondary-blue);
    border-radius: 25px;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.kids-card::before {
    content: '🎨';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}