/* css/style.css - Version complète et corrigée */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;  /* Corrigé: bleu au lieu de rouge */
    --success-color: #27ae60;
    --danger-color: #3498db;     /* Corrigé: rouge pour danger */
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --gray-text: #7f8c8d;
    --border-color: #e0e0e0;
    --sidebar-width: 280px;
    --header-height: 70px;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
    --hover-shadow: 0 15px 40px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: var(--dark-text);
    line-height: 1.6;
}

/* Import de la police Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../uploads/Conf_Afri_Munyonyo_549.jpg'); /*Corrigé: chemin uploads*/
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2c3e50;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.562);
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95); /* Plus opaque */
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--secondary-color);
    padding: 5px;
    object-fit: cover;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray-text);
    font-size: 14px;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--light-bg);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #1a2634 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
}

/* Profile Container - Version Luxe avec Effet Verre */
.profile-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 35px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Effet de lumière dynamique */
.profile-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 30%,
        transparent 70%
    );
    animation: lightMove 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lightMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(5%, 5%) rotate(120deg);
    }
    66% {
        transform: translate(-5%, -5%) rotate(240deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Cercles décoratifs */
.profile-container::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 150px;
    height: 150px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

/* Image de profil */
.profile-image-large {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    position: relative;
    z-index: 3;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-image-large:hover {
    transform: scale(1.05) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Nom de l'utilisateur */
.profile-name {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 3;
    line-height: 1.4;
}

/* Ligne décorative sous le nom */
.profile-name::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Rôle de l'utilisateur */
.profile-role {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}

.profile-role:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Icône de couronne */
.profile-role i {
    color: #ffd700;
    font-size: 14px;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    animation: crownGlow 2s ease-in-out infinite;
}

@keyframes crownGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
        transform: scale(1.1);
    }
}

/* Menu sidebar */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
    padding: 0 15px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
    gap: 12px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu a i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
}

/* Top Bar */
.top-bar {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.date-display {
    background: var(--light-bg);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--primary-color);
}

/* ==================== STATISTIQUES CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), #2980b9);
}

.stat-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    opacity: 0.1;
    color: var(--primary-color);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--gray-text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-trend {
    margin-top: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

/* ==================== BADGES ==================== */
.badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(243, 156, 18, 0.2);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.badge-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* ==================== BOUTONS ==================== */
.btn {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--light-bg);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #219a52);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 13px;
}

/* ==================== FORMULAIRES ==================== */
.form-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.form-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--light-bg);
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

/* ==================== UPLOAD D'IMAGES ==================== */
.image-upload-container {
    border: 3px dashed var(--secondary-color);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    background: rgba(52, 152, 219, 0.05);
}

.image-upload-container:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #2980b9;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    padding-top: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.image-preview-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== TABLES ==================== */
.table-container {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-bg);
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    text-transform: uppercase;
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* ==================== FILTERS SECTION ==================== */
.filters-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.filters-section input,
.filters-section select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    min-width: 200px;
    flex: 1;
    font-size: 14px;
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid;
}

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

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 24px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .profile-image-large {
        width: 90px;
        height: 90px;
    }
    
    .profile-name {
        font-size: 18px;
    }
    
    .profile-role {
        font-size: 12px;
        padding: 6px 15px;
    }
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.w-100 { width: 100%; }