/* OSS Calculator - Composants modernes unifiés */
/* Palette bleue professionnelle pour TOUTE l'interface */

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

/* ================================================
   VARIABLES GLOBALES - PALETTE BLEUE PROFESSIONNELLE
   ================================================ */
:root {
    /* Bleus principaux - confiance/professionnalisme */
    --primary-blue: #1e40af;        /* Boutons, liens principaux */
    --secondary-blue: #3b82f6;      /* Accents, hover */
    --light-blue: #eff6ff;          /* Arrière-plans cards */
    --dark-blue: #1e3a8a;          /* Headers, navigation */
    --accent-blue: #60a5fa;         /* Highlights, badges */
    
    /* Support UI */
    --success: #10b981;             /* Actions réussies */
    --warning: #f59e0b;             /* Alertes */
    --error: #ef4444;               /* Erreurs */
    --disabled: #9ca3af;            /* Éléments désactivés */
    --text-primary: #1e293b;        /* Texte principal */
    --text-secondary: #64748b;      /* Texte secondaire */
    --border: #cbd5e1;              /* Bordures */
    --surface: #ffffff;             /* Arrière-plan cards */
    --background: #f8fafc;          /* Arrière-plan page */
    
    /* Système de couleurs étendues */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Ombres modernes */
    --shadow-sm: 0 1px 2px 0 rgba(30, 64, 175, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(30, 64, 175, 0.1), 0 2px 4px -1px rgba(30, 64, 175, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(30, 64, 175, 0.1), 0 4px 6px -2px rgba(30, 64, 175, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(30, 64, 175, 0.1), 0 10px 10px -5px rgba(30, 64, 175, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50px;
}

/* ================================================
   RESET ET BASE
   ================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   HEADER MODERNE UNIFIÉ
   ================================================ */
.main-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-header nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.main-header nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.875rem;
}

.main-header nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-header nav a.active {
    background: var(--accent-blue);
    color: white;
}

/* ================================================
   CARDS MODERNES
   ================================================ */
.modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    /* Inherit width from content-wrapper to match page-header */
    max-width: inherit;
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.modern-card .card-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modern-card .card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-card .card-body {
    padding: 1.5rem;
}

.modern-card .card-footer {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ================================================
   BOUTONS COHÉRENTS
   ================================================ */
.btn-modern {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern-secondary {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    color: var(--text-primary);
}

.btn-modern-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.btn-modern-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.btn-modern-error {
    background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
}

.btn-modern-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-modern-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-modern-full {
    width: 100%;
    justify-content: center;
}

/* ================================================
   FORMULAIRES MODERNES
   ================================================ */
.form-modern {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: var(--surface);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

/* Styles pour les options de trimestre désactivées */
.form-select option.quarter-disabled {
    color: var(--disabled);
    font-style: italic;
    background-color: #f8f9fa;
}

.form-select option.quarter-available {
    color: var(--text-primary);
    font-weight: 500;
}

/* Amélioration visuelle des options désactivées */
.form-select option:disabled {
    color: var(--disabled) !important;
    background-color: #f8f9fa !important;
    font-style: italic;
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
    background: var(--surface);
    color: var(--text-primary);
}

/* ================================================
   TABLES MODERNES
   ================================================ */
.table-modern-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-modern thead {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
}

.table-modern th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-modern td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.table-modern tbody tr:hover {
    background: var(--gray-50);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ================================================
   BADGES ET STATUTS
   ================================================ */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-modern-primary {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary-blue);
}

.badge-modern-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-modern-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-modern-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-modern-info {
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent-blue);
}

/* ================================================
   ALERTES MODERNES
   ================================================ */
.alert-modern {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-modern-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-modern-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-modern-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-modern-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ================================================
   STATS CARDS
   ================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--gray-50) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ================================================
   LAYOUTS MODERNES
   ================================================ */
.modern-layout {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--background) 100%);
    min-height: 100vh;
}

.modern-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.modern-grid {
    display: grid;
    gap: 1.5rem;
}

.modern-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.modern-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.modern-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ================================================
   UPLOAD ZONE MODERNE
   ================================================ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--surface);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-blue);
    background: var(--light-blue);
}

.upload-zone .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.upload-zone .upload-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ================================================
   PROGRESS BAR MODERNE
   ================================================ */
.progress-modern {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem 0;
}

.progress-modern-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    transition: width var(--transition-normal);
}

.progress-modern-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */
@media (max-width: 768px) {
    .modern-container {
        padding: 1rem;
    }
    
    .main-header .container {
        padding: 0 1rem;
    }
    
    .main-header nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modern-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modern-card .card-body {
        padding: 1rem;
    }
    
    .btn-modern-full {
        width: 100%;
    }
}

@media (min-width: 1200px) {
    .modern-container {
        padding: 2rem;
    }
}

/* ================================================
   UTILITAIRES
   ================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }