/* ============================================= */
/* MIB Explorer - Style Moderne et Épuré       */
/* ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================= */
/* Variables CSS pour une cohérence parfaite    */
/* ============================================= */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: #ffffff;
    
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================= */
/* Reset et base                                 */
/* ============================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================= */
/* Typographie moderne                           */
/* ============================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

h2, h4.alert-heading {
    font-size: 1.875rem;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.7;
}

.text-muted {
    color: var(--text-muted) !important;
}

.font-monospace {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace !important;
    font-weight: 500;
}

/* ============================================= */
/* Liens avec animations subtiles               */
/* ============================================= */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

a:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

a:not(.btn):not(.navbar-brand):hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
    animation: linkUnderline 0.3s ease;
}

@keyframes linkUnderline {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ============================================= */
/* Header moderne avec effet glassmorphism       */
/* ============================================= */
header .navbar {
    background: var(--bg-dark) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
}

header .navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-white) !important;
    transition: var(--transition);
}

header .navbar .navbar-brand:hover {
    transform: scale(1.05);
    color: var(--accent-color) !important;
}

header .navbar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

header .navbar .nav-link:hover {
    color: var(--text-white) !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

header .navbar .form-control {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-white);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

header .navbar .form-control:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.1);
}

header .navbar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
}

/* ============================================= */
/* Hero section avec effet parallax              */
/* ============================================= */
.bg-dark {
    background: var(--bg-dark) !important;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.bg-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/assets/images/bg-dark2.svg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

.bg-dark .container {
    position: relative;
    z-index: 2;
}

.bg-dark h1 {
    color: var(--text-white) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.bg-dark .lead {
    color: rgba(255, 255, 255, 0.8) !important;
    animation: fadeInUp 1s ease 0.2s both;
}

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

/* ============================================= */
/* Cards modernes avec glassmorphism             */
/* ============================================= */
.alert {
    border: none !important;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

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

.alert-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.alert-secondary, .bg-secondary {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.fs-1 {
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

/* ============================================= */
/* Boutons modernes                              */
/* ============================================= */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    text-transform: none;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

/* ============================================= */
/* Footer moderne                                */
/* ============================================= */
footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    padding: 2rem 0;
}

footer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================= */
/* Logos avec effet sophistiqué                  */
/* ============================================= */
.image-muted {
    filter: grayscale(100%) brightness(1.2);
    opacity: 0.4;
    transition: var(--transition);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.image-muted:hover {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
    box-shadow: var(--shadow-lg);
}


/* ============================================= */
/* Listes modernes                               */
/* ============================================= */
ul li {
    line-height: 1.8;
    transition: var(--transition);
}

ul li:hover {
    transform: translateX(5px);
}

dl dt {
    font-weight: 600;
    color: var(--text-primary);
}

dl dd {
    font-weight: 400;
    color: var(--text-secondary);
}

/* ============================================= */
/* Pages de documentation                        */
/* ============================================= */
.doc-page p {
    text-align: justify;
    line-height: 1.7;
    color: var(--text-secondary);
}

.doc-page h1, .doc-page h2, .doc-page h3, .doc-page h4, .doc-page h5, .doc-page h6 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.doc-page h2::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ============================================= */
/* Responsive design amélioré                    */
/* ============================================= */
@media (max-width: 768px) {
    :root {
        --border-radius: 8px;
        --border-radius-lg: 12px;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .alert {
        margin-bottom: 1rem;
    }
    
    .bg-dark {
        background-attachment: scroll;
    }
}

/* ============================================= */
/* Micro-animations pour l'interactivité         */
/* ============================================= */
.alert, .btn, .card {
    transition: var(--transition);
}

.alert:hover {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: var(--shadow-md); }
    50% { box-shadow: var(--shadow-lg); }
    100% { box-shadow: var(--shadow-md); }
}

/* ============================================= */
/* Scrollbar personnalisée                       */
/* ============================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}
