/**
 * Styles pour l'interface SITADEL - Version Modernisée
 */

/* ========================================
   CSS Variables - Design System
   ======================================== */
:root {
    /* Couleurs principales */
    --primary-color: #3498db;
    --primary-dark: #2c81ba;
    --primary-light: #5dade2;
    --secondary-color: #2ecc71;
    --accent-color: #9b59b6;

    /* Couleurs neutres */
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ecf0f1;

    /* Couleurs d'état */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;

    /* Bordures */
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;

    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--bg-primary);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Typography
   ======================================== */
header h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1em;
    font-weight: 400;
}

/* ========================================
   Header
   ======================================== */
header {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 2px solid transparent;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%) left bottom/100% 2px no-repeat;
}

/* ========================================
   Navigation Menu
   ======================================== */
nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: all var(--transition-base);
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid transparent;
}

nav a:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

nav a.logout-link {
    background: rgba(231, 76, 60, 0.08);
    color: var(--danger-color);
    margin-left: auto;
}

nav a.logout-link:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: var(--danger-color);
}

/* ========================================
   Cards & Boxes
   ======================================== */
.info-box {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-form {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.help-box {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(230, 126, 34, 0.1));
    padding: 25px;
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--warning-color);
    box-shadow: var(--shadow-sm);
}

.help-box h3 {
    margin-bottom: 15px;
    color: #d68910;
}

.help-box ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-box li {
    margin-bottom: 10px;
}

.search-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(93, 173, 226, 0.08));
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 25px;
    border-left: 4px solid var(--info-color);
    box-shadow: var(--shadow-sm);
}

.search-info p {
    margin-bottom: 8px;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    transition: all var(--transition-base);
    background: var(--bg-primary);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.form-group button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

.form-group button:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1f5f8b);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-group button:active {
    transform: translateY(0);
}

/* ========================================
   Navigation & Links
   ======================================== */
.back-link {
    margin-bottom: 25px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   Tables
   ======================================== */
.results {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

table thead {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: none;
}

table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}

table tbody tr {
    transition: all var(--transition-fast);
}

table tbody tr:nth-child(even) {
    background-color: rgba(52, 152, 219, 0.02);
}

table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.08);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ========================================
   Status & Messages
   ======================================== */
.no-results {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    margin: 20px 0;
}

/* ========================================
   Footer
   ======================================== */
footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--bg-tertiary);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(44, 62, 80, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius-lg);
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.close {
    color: var(--text-light);
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
}

.detail-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--primary-color);
}

.detail-section h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    width: 40%;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.detail-value {
    width: 60%;
    color: var(--text-primary);
}

/* ========================================
   Loader
   ======================================== */
.loader {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.7);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.loader.active {
    display: flex;
}

.loader-spinner {
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    table {
        font-size: 0.9em;
    }

    table th,
    table td {
        padding: 10px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label,
    .detail-value {
        width: 100%;
    }

    .detail-label {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .search-form,
    .info-box {
        padding: 20px 15px;
    }
}