:root {
    --bg-dark: #0f1014;
    --card-bg: #18191e;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: white;
}

/* Design Moderne (Glassmorphism & Cards) */
.glass-header {
    padding: 2rem 0;
}

.app-title {
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #1e1f25 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;

    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px -10px var(--primary-soft), 0 2px 8px 0 rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(.4, 2, .3, 1), border-color 0.2s, box-shadow 0.25s;
}

.kpi-card:hover i {
    color: var(--primary) !important;
    transition: color 0.2s;
}

.btn-save {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.5rem 1.5rem;
    font-weight: 400;
    width: 100%;
    margin-top: 0.5rem;
    transition: filter 0.2s, color 0.2s;
}

.btn-save:hover {
    filter: brightness(110%);
    color: white;
}

.kpi-card i {
    color: var(--primary-soft);
    font-size: 3rem;
    transition: color 0.2s;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: var(--primary);
    filter: blur(60px);
    opacity: 0.2;
    border-radius: 50%;
}

.ue-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    height: 100%;
    transition: transform 0.2s;
}

.ue-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.1);
}

.ue-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ue-avg {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.matiere-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.matiere-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px var(--primary-soft);
    transition: transform 0.2s;
    z-index: 50;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    color: white;
}

.form-control,
.form-select {
    background-color: #0f1014;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    padding: 0.7rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background-color: #0f1014;
    color: white;
}

.modal-content {
    background-color: #0f1014;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 18px;
    box-shadow: 0 12px 40px -8px var(--primary-soft), 0 2px 8px 0 rgba(0, 0, 0, 0.25);
}

.modal-header {
    background: linear-gradient(90deg, var(--primary-soft) 0%, transparent 100%);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 1.5rem 2rem 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px -8px var(--primary-soft);
}

.form-label {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.nav-pills .nav-link {
    color: #a0a0a0;
}

.period-select {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    max-width: 130px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.period-select:hover,
.period-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.settings-button {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.settings-button:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    color: white;
}

.settings-button i {
    transition: transform 0.3s;
}

.settings-button:hover i {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

.loadingScreen {
    background-color: #1e1f25;
    position: fixed;
    /* CHANGEMENT ICI : fixed au lieu de absolute */
    top: 0;
    /* IMPORTANT : force le coin haut */
    left: 0;
    /* IMPORTANT : force le coin gauche */
    z-index: 1000;
    /* Augmenté pour être sûr de passer au-dessus de tout */
    width: 100%;
    height: 100vh;
    /* Prend toute la hauteur de la fenêtre */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s;
    /* Ajout de visibility pour la transition */
}

/* Classe pour cacher le loader proprement */
.loadingScreen.hidden {
    opacity: 0;
    visibility: hidden;
    /* Empêche de cliquer dessus une fois invisible */
    pointer-events: none;
    /* Sécurité supplémentaire */
}

code {
    background-color: var(--primary-soft);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
}


.back-link {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-5px);
}


.text-muted {
    color: #a0a0a0 !important;
}


.alert {
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-danger {
    background-color: #b02a37;
    color: white;
    box-shadow: 0 2px 12px -4px #e6394655;
    border: 1px solid #e63946;
}

.alert-success {
    background-color: #189441;
    color: white;
    box-shadow: 0 2px 12px -4px #1bb72555;
    border: 1px solid #1bb76e;
}

.bg-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: -1;
}

.badge.bg-dark {
    background-color: #1e1f25;
    color: white;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 400;
}

#actionModal .modal-header {
    padding-bottom: 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.badge.obtained {
    background-color: green !important;
    border-color: darkgreen !important;
    color: white;
}

.badge.not-obtained {
    background-color: red !important;
    border-color: darkred !important;
    color: white;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: background 0.2s;
}

.list-group-item:last-child {
    margin-bottom: 0;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.action-button-eval {
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px 10px;
}
.action-button-eval i {
    
    transition: transform 0.2s;
}

.action-button-eval:hover i {
    transform: scale(1.2);
}
.action-button-eval:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    transition: all 0.2s;
}

.detail-matiere {
    font-size: 0.7rem;
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1px 5px;
    display: inline-block;
}