/* ============================================
   GLOBAL.CSS - Le Coffre-Fort du Savoir
   Design: Gaming + Académique
   ============================================ */

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

/* ===== VARIABLES CSS ===== */
:root {
    /* Couleurs de fond */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);

    /* Couleurs d'accent */
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-green-light: #4ade80;
    --accent-gold: #fbbf24;
    --accent-red: #ef4444;

    /* Textes */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Bordures */
    --border-subtle: rgba(59, 130, 246, 0.2);
    --border-active: rgba(59, 130, 246, 0.5);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== FOND AVEC FORMULES MATH ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Ctext x='50' y='100' font-family='serif' font-size='24' fill='%231e3a5f' opacity='0.15'%3E∫ f(x)dx%3C/text%3E%3Ctext x='200' y='200' font-family='serif' font-size='20' fill='%231e3a5f' opacity='0.12'%3Eπr²%3C/text%3E%3Ctext x='400' y='150' font-family='serif' font-size='22' fill='%231e3a5f' opacity='0.14'%3E∑ aₙ%3C/text%3E%3Ctext x='100' y='350' font-family='serif' font-size='18' fill='%231e3a5f' opacity='0.1'%3Elim x→∞%3C/text%3E%3Ctext x='500' y='300' font-family='serif' font-size='26' fill='%231e3a5f' opacity='0.13'%3E∂y/∂x%3C/text%3E%3Ctext x='300' y='450' font-family='serif' font-size='20' fill='%231e3a5f' opacity='0.11'%3Ecos θ%3C/text%3E%3Ctext x='600' y='500' font-family='serif' font-size='24' fill='%231e3a5f' opacity='0.14'%3E√x%3C/text%3E%3Ctext x='150' y='550' font-family='serif' font-size='22' fill='%231e3a5f' opacity='0.12'%3Eeˣ%3C/text%3E%3Ctext x='450' y='650' font-family='serif' font-size='20' fill='%231e3a5f' opacity='0.13'%3Eln(x)%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ===== TYPOGRAPHIE ===== */
h1,
h2,
h3 {
    font-weight: 700;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== CARTES GLASSMORPHISM ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--border-active);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

/* ===== BOUTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-purple), #6366f1);
    color: white;
}

.btn-ghost {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn:disabled {
    background: rgba(100, 116, 139, 0.3);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green-light);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-gold {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ===== FORMULAIRES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ===== ALERTES ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left: 4px solid var(--accent-red);
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green-light);
    border-left: 4px solid var(--accent-green);
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-subtle);
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.3s;
    position: relative;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-blue-light);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-blue);
}

/* ===== GRILLE PRODUITS ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .logo-section {
        justify-content: center;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}