/* ==========================================================================
   TWILIGHT CSS - Thème professionnel GTIC
   Fichier : twilight.css
   --------------------------------------------------------------------------
   Objectif :
   - Style de base premium avec design system cohérent
   - Palette de couleurs élégante et professionnelle
   - Composants modernes avec micro-interactions
   ========================================================================== */

/* Reset & base - Amélioré
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
        'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typographie améliorée
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: -0.025em;
}

h1 { 
    font-size: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 { 
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 2px;
}

h3 { 
    font-size: 1.25rem;
    color: #334155;
}

p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: #475569;
}

small {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Liens élégants
   ========================================================================== */

a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

a:hover {
    color: #1d4ed8;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.3s ease;
    border-radius: 1px;
}

a:hover::after {
    width: 100%;
}

/* Layout premium
   ========================================================================== */

section {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.08),
        0 5px 10px -5px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

/* Formulaires premium
   ========================================================================== */

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    color: #0f172a;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    margin: 0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #f59e0b;
    box-shadow: 
        0 0 0 4px rgba(245, 158, 11, 0.1),
        0 0 0 1px rgba(245, 158, 11, 0.2);
    background: #ffffff;
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* Boutons premium
   ========================================================================== */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 12px;
    border: none;
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    font-family: inherit;
}

button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

button:hover::before,
.btn:hover::before {
    left: 100%;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569, #64748b);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Tableaux élégants
   ========================================================================== */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 1.5rem 0;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    min-width: 600px;
}

.table thead {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    color: #f8fafc;
    font-weight: 600;
    letter-spacing: 0.025em;
    border-bottom: 2px solid #334155;
}

.table th:first-child {
    border-top-left-radius: 12px;
}

.table th:last-child {
    border-top-right-radius: 12px;
}

.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.table tbody tr {
    background: white;
    transition: all 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, #fefce8, #fff7ed);
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Alertes / messages premium
   ========================================================================== */

.alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid transparent;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%231e40af' viewBox='0 0 24 24'%3E%3Cpath d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23065f46' viewBox='0 0 24 24'%3E%3Cpath d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-danger::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23991b1b' viewBox='0 0 24 24'%3E%3Cpath d='M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

/* Cartes premium
   ========================================================================== */

.card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 25px -5px rgba(0, 0, 0, 0.1),
        0 5px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    font-size: 0.95rem;
    color: #475569;
}

/* Utilitaires améliorés
   ========================================================================== */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-muted  { color: #64748b; }
.text-accent { color: #f59e0b; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-6 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }

/* Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-primary {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.badge-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* Responsive amélioré
   ========================================================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    section {
        padding: 1.5rem;
        margin: 0 -1rem 1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 1rem;
    }
    
    button,
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    section {
        padding: 1.25rem;
    }
    
    .card {
        padding: 1.25rem;
    }
}

/* Animations subtiles
   ========================================================================== */

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

.animate-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Scrollbar personnalisée
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

.specialites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.specialite-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15,23,42,0.04);
    border: 1px solid rgba(148,163,184,0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.specialite-item input[type="checkbox"] {
    accent-color: #f59e0b;
}

.specialite-item:hover {
    background: rgba(245,158,11,0.08);
    border-color: #f59e0b;
}

.specialite-label {
    font-size: 0.85rem;
    color: #0f172a;
}


.location-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.location-overlay-box {
    max-width: 420px;
    width: 90%;
    background: #020617;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 20px 50px rgba(0,0,0,0.75);
    color: #e5e7eb;
    text-align: center;
}

.location-overlay-box h2 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.location-warning {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #f97373;
    min-height: 1.2em;
}


