:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --secondary: #64748b;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --radius-l: 24px;
    --radius-m: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(12px);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    min-height: 100vh;
    padding-bottom: 40px;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: #60a5fa;
    text-decoration: none;
}

/* Utils */
.btn-cp5-bleu, .btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-cp5-bleu:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    color: white;
}

.btn-cp5-jaune, .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-cp5-jaune:hover, .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.4);
    color: white;
}

/* Cards / Bento Boxes */
.card, .title-bloc {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    font-weight: 700;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-m);
    color: #0f172a;
    padding: 12px 16px;
    font-weight: 500;
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
    color: #0f172a;
}

/* Autocomplete List */
#search-box {
    position: relative;
    width: 100%;
}

#search-box ul {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-m);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    list-style-type: none;
    padding: 0;
    margin-top: 5px;
    overflow: hidden;
    position: absolute;
    width: 100%; /* Match parent width */
    z-index: 9999; /* Ensure high z-index */
    top: 100%;
    left: 0;
}

#search-box ul li {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a; /* Dark text */
    cursor: pointer;
    transition: background 0.2s;
}

#search-box ul li:last-child {
    border-bottom: none;
}

#search-box ul li:hover {
    background: #f1f5f9;
}

/* Header */
.header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    height: 50px;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

/* Typography Overrides */
h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.2rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Tables */
.table {
    color: var(--text-color);
}
.table thead th {
    border-bottom: 2px solid var(--card-border);
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.table td {
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}
.table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
}
.table-hover > tbody > tr:hover {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

/* Utilities */
.text-muted { color: var(--secondary) !important; }

/* Design Toggle Button */
#design-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 999px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
#design-toggle:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Mobile specific */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .card {
        padding: 1rem;
    }
}
