/*
 * File: /css/style.css
 * FINAL CONSOLIDATED CODE: Defines custom theme, ensures consistency, and fixes all layout regressions.
 */

/* ========================================================================= 
   1. GLOBAL & RESET 
   ========================================================================= */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: #003366;
    font-weight: bold;
}

/* FIX: Secondary Navigation/Content Link Styling */
.content-container a:not(.btn-primary):not(.logo a) {
    color: #003366; 
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}

.content-container a:not(.btn-primary):not(.logo a):hover {
    color: #0055AA;
    text-decoration: underline; 
}

/* ========================================================================= 
   2. HEADER & NAVIGATION 
   ========================================================================= */

.main-header {
    background-color: #003366 !important;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5em;
    font-weight: bold;
    color: white; 
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav li.active a {
    background-color: #004488;
}

.secondary-nav a {
    font-weight: bold;
    color: #003366; 
    text-decoration: none;
    margin: 0 5px;
}

.secondary-nav a:hover {
    text-decoration: underline;
}

/* ========================================================================= 
   3. BUTTONS & FORMS 
   ========================================================================= */

/* Primary Button Styling (Yellow/Gold Accent) */
.btn-primary {
    background-color: #ffc107 !important; 
    border-color: #ffc107 !important;
    color: #333 !important; 
    font-weight: bold;
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #e0a800 !important;
    border-color: #e0a800 !important;
    color: white !important;
    box-shadow: none;
}

/* Login Form Specific Styles */
.login-section {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #ddd;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    padding: 12px;
}

.login-info {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.95em;
}

/* ========================================================================= 
   4. CONTENT & DATA VISUALIZATION STYLES 
   ========================================================================= */

/* Titles and Separators */
h2.section-title {
    padding-bottom: 10px;
    border-bottom: 3px solid #ffc107; 
    margin-bottom: 20px;
}

/* General Card/Panel Styles (Used in index.php) */
.card {
    border: 1px solid #ddd; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Highlighted Result Text */
#resultat-net {
    color: #003366 !important; 
    font-size: 1.5em; 
    font-weight: 700;
    display: block; 
    margin-top: 5px;
}

/* Autocomplete Styling and Positioning */
.autocomplete {
    position: relative; 
    display: inline-block;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    width: 100%; 
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff; 
    border-bottom: 1px solid #d4d4d4; 
    font-size: 0.9em;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9; 
}

.autocomplete-items strong {
    color: #003366;
}


/* --- FIX: Table Styling (for Démystificateur) --- */
#percentile-table {
    margin-top: 20px;
    font-size: 0.95em;
    border-collapse: separate; 
    border-spacing: 0;
    width: 100%;
}

/* CRITICAL FIX: Ensure Dark Blue Header and Yellow Underline are APPLIED */
#percentile-table thead tr th {
    /* Absolute Overrides for Header Styling */
    background-color: #003366 !important; /* Force Dark Blue Background */
    color: white !important; /* Force White text */
    border-bottom: 3px solid #ffc107 !important; /* Force Yellow underline */
    border-top: none !important;
    font-weight: bold !important;
    padding: 12px !important;
    cursor: pointer;
    text-align: left;
    vertical-align: middle;
}

/* Ensure the first and last column have rounded corners */
#percentile-table thead tr th:first-child {
    border-top-left-radius: 6px;
}
#percentile-table thead tr th:last-child {
    border-top-right-radius: 6px;
}

/* Table Body Styling */
#percentile-table tbody tr td {
    border-top: 1px solid #e9ecef; /* Light divider line */
    padding: 12px;
}

/* Sort Indicators */
#percentile-table th.sort-asc,
#percentile-table th.sort-desc {
    background-color: #004488 !important; /* Slightly lighter blue when sorted */
}


/* Footer Styling */
.main-footer {
    padding: 15px 20px;
    background-color: #e9ecef; 
    text-align: center;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: auto; 
}
/* Masquer la scrollbar tout en gardant le défilement */
.tag-scroll-container::-webkit-scrollbar {
    height: 4px;
}
.tag-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.tag-scroll-container::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

/* Effet au survol des tags */
.tag-scroll-container .btn:hover {
    background: #0d6efd !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Empêcher le texte de se casser sur mobile */
.text-nowrap {
    white-space: nowrap;
}