/**
 * Feuille de style principale de GEPAFO
 * Charte graphique : Orange (#f38601) et Bleu foncé (#2d2c80)
 */

:root {
    --primary-color: #f38601;
    --primary-light: #ffb44b;
    --primary-dark: #c15800;
    --secondary-color: #2d2c80;
    --secondary-light: #5756b0;
    --secondary-dark: #010153;
    --light-gray: #f4f4f8;
    --medium-gray: #e9e9ef;
    --dark-gray: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

/* ======= Styles généraux ======= */
body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container-fluid {
    max-width: 1600px;
}

/* ======= Navigation ======= */
.navbar {
    background-color: #2d2c80;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.navbar-brand {
    color: white;
    font-weight: bold;
}

.navbar-brand span {
    margin-left: 10px;
}

.navbar-brand img {
    max-height: 40px;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.3s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    color: white;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 8px 16px;
    transition: background-color 0.3s ease-in-out;
}

.dropdown-item i {
    margin-right: 8px;
    color: #f38601;
}

.academic-year-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
}

/* ======= Footer ======= */
.footer {
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ======= Cards et conteneurs ======= */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    margin-bottom: 25px;
    overflow: hidden;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    color: var(--secondary-color);
}

.card-body {
    padding: 20px;
}

/* ======= Boutons ======= */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2e59d9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    color: white;
}

/* ======= Tableaux ======= */
.table {
    color: #333;
}

.table thead th {
    background-color: #f8f9fc;
    color: #4e73df;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #e3e6f0;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(78, 115, 223, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.08);
}

/* ======= DataTables Customization ======= */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
}

/* ======= Page de login ======= */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(145deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
}

.login-card {
    width: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.login-header {
    background-color: white;
    padding: 25px;
    text-align: center;
}

.login-header img {
    max-width: 180px;
    margin-bottom: 10px;
}

.login-body {
    background-color: white;
    padding: 30px;
}

.login-footer {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--dark-gray);
}

/* ======= Badges et statuts ======= */
.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* ======= Dashboard Cards ======= */
.dashboard-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card .card-icon {
    font-size: 48px;
    opacity: 0.2;
    position: absolute;
    top: 15px;
    right: 15px;
    transition: all 0.3s ease;
}

.dashboard-card:hover .card-icon {
    font-size: 52px;
    opacity: 0.3;
}

.dashboard-card .card-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.dashboard-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-primary .card-icon { color: #4e73df; }
.card-secondary .card-icon { color: #6c757d; }
.card-success .card-icon { color: #1cc88a; }
.card-danger .card-icon { color: #e74a3b; }
.card-warning .card-icon { color: #f6c23e; }
.card-info .card-icon { color: #36b9cc; }

.text-primary { color: #4e73df !important; }
.text-secondary { color: #6c757d !important; }
.text-success { color: #1cc88a !important; }
.text-danger { color: #e74a3b !important; }
.text-warning { color: #f6c23e !important; }
.text-info { color: #36b9cc !important; }

/* ======= Formulaires ======= */
.form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #d1d3e2;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger);
}

.form-label {
    font-weight: 500;
    color: var(--secondary-color);
}

/* Désactiver le redimensionnement des textareas */
textarea {
    resize: none !important;
}

/* ======= Utilitaires ======= */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-light-gray {
    background-color: var(--light-gray) !important;
}

/* ======= Media Queries ======= */
@media (max-width: 768px) {
    .balance-container {
        height: 300px;
    }

    .balance-plate {
        width: 100px;
        height: 100px;
    }

    .dashboard-card .card-icon {
        font-size: 36px;
    }

    .dashboard-card h2 {
        font-size: 24px;
    }
}

/* Balance financière améliorée */
.balance-container {
    perspective: 1000px;
}

.balance-beam {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 1s ease-in-out, box-shadow 0.3s;
}

.balance-beam:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.balance-plate {
    border: 5px solid rgba(255,255,255,0.1);
    transition: all 0.5s ease-in-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.balance-plate:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.balance-plate.right:hover {
    transform: translateX(50%) scale(1.05);
}

.balance-status {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

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

/* Dashboard sections */
.dashboard-section {
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dashboard-section:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.dashboard-section h4 {
    position: relative;
}

.dashboard-section h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #f38601;
    transition: width 0.3s ease;
}

.dashboard-section:hover h4::after {
    width: 100px;
}

/* Animations pour le tableau de bord */
.dashboard-card, .card, .balance-container {
    animation: fadeInUp 0.5s ease-out;
}

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