﻿/* ============================================
   DESIGN SYSTEM - SMA Rapatriement
   Version unifiée - 2026
   ============================================ */

/* Variables CSS */
:root {
    /* Couleurs principales */
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary-light: #3b82f6;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #0dcaf0;
    --info-dark: #0aa5c2;
    /* Dégradés */
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-gradient: linear-gradient(135deg, #0dcaf0 0%, #0aa5c2 100%);
    /* Neutres */
    --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;
    /* Espacements */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   BOUTONS - UNIFIÉS
   ============================================ */

/* Base commune pour tous les boutons modernes */
.btn-modern {
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
}

    .btn-modern:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

/* Bouton principal (valider, créer, appliquer) */
.btn-primary-modern {
    background: linear-gradient(135deg, #27CCF5, #272AF5);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

    .btn-primary-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
        color: white;
    }

/* Bouton outline jaune*/
.btn-outline-modern {
    background: transparent;
    border: 2px solid #F5BE27;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #F5BE27;
    gap: 0.5rem;
}

    .btn-outline-modern:hover {
        background: linear-gradient(135deg, #F5BE27, #F5A623);
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(245, 190, 39, 0.3);
        color: white;
    }

/* Bouton secondaire - gris */
.btn-secondary-modern {
    background: linear-gradient(135deg, #C0C5C8, #5a6268);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

    .btn-secondary-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
        color: white;
    }

/* Bouton succès - vert */
.btn-success-modern {
    background: linear-gradient(135deg, #E9FBF6, #06CB93);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

    .btn-success-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
        color: white;
    }

/* Bouton danger - rouge */
.btn-danger-modern {
    background: linear-gradient(135deg, #FBE9EC, #F60925);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

    .btn-danger-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
        color: white;
    }

/* Taille small */
.btn-sm-modern {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

/* Taille large */
.btn-lg-modern {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: 14px;
}



/* Bouton warning (attention) */
.btn-warning-modern {
    background: var(--warning-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

    .btn-warning-modern:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
        color: white;
    }

/* Bouton outline (filtres, actions secondaires) */
.btn-outline-modern {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    box-shadow: var(--shadow-sm);
}

    .btn-outline-modern:hover:not(:disabled) {
        background: var(--gray-50);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

/* Bouton outline danger (réinitialiser, supprimer) */
.btn-outline-modern-danger {
    background: white;
    border: 1px solid #f8d7da;
    color: var(--danger);
}

    .btn-outline-modern-danger:hover:not(:disabled) {
        background: var(--danger-gradient);
        border-color: var(--danger);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    }

/* Bouton outline succès (appliquer, rechercher) */
.btn-outline-modern-success {
    background: white;
    border: 1px solid #d4edda;
    color: var(--success);
}

    .btn-outline-modern-success:hover:not(:disabled) {
        background: var(--success-gradient);
        border-color: var(--success);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    }

/* Bouton icône seul */
.btn-icon-modern {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    transition: all 0.2s ease;
    cursor: pointer;
}

    .btn-icon-modern:hover {
        background: var(--gray-50);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-2px);
    }

    .btn-icon-modern.btn-view:hover {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

    .btn-icon-modern.btn-edit:hover {
        background: var(--success);
        border-color: var(--success);
        color: white;
    }

    .btn-icon-modern.btn-delete:hover {
        background: var(--danger);
        border-color: var(--danger);
        color: white;
    }

/* Taille small */
.btn-sm-modern {
    padding: var(--space-2) var(--space-4);
    font-size: 0.75rem;
}

/* Taille large */
.btn-lg-modern {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

/* ============================================
   HEADERS ET PAGES
   ============================================ */

.page-header-modern {
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

    .page-header-modern .header-content {
        display: flex;
        align-items: center;
        gap: var(--space-4);
    }

    .page-header-modern .header-icon {
        width: 60px;
        height: 60px;
        border-radius: var(--radius-lg);
        background: rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.75rem;
    }

    .page-header-modern .page-title {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0;
        color: white;
    }

    .page-header-modern .page-subtitle {
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
    }

    .page-header-modern .header-actions {
        display: flex;
        gap: var(--space-3);
        align-items: center;
    }

/* ============================================
   CARTES
   ============================================ */

.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.card-body-modern {
    padding: var(--space-6);
}

.card-header-modern {
    padding: var(--space-4) var(--space-6);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-footer-modern {
    padding: var(--space-4) var(--space-6);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Cartes statistiques */
.stat-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    border: 1px solid var(--gray-200);
}

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

    .stat-card-modern .stat-icon {
        width: 56px;
        height: 56px;
        border-radius: var(--radius-lg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: white;
    }

    .stat-card-modern.primary .stat-icon {
        background: var(--primary-gradient);
    }

    .stat-card-modern.success .stat-icon {
        background: var(--success-gradient);
    }

    .stat-card-modern.warning .stat-icon {
        background: var(--warning-gradient);
    }

    .stat-card-modern.danger .stat-icon {
        background: var(--danger-gradient);
    }

    .stat-card-modern.info .stat-icon {
        background: var(--info-gradient);
    }

    .stat-card-modern .stat-value {
        font-size: 2rem;
        font-weight: 700;
        margin: 0;
        color: var(--gray-800);
    }

    .stat-card-modern .stat-label {
        margin: 0;
        color: var(--gray-500);
        font-size: 0.875rem;
    }

/* Cartes info */
.info-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

    .info-card-modern .info-header {
        background: var(--info-gradient);
        color: white;
        padding: var(--space-4) var(--space-5);
        display: flex;
        align-items: center;
        gap: var(--space-2);
        font-weight: 600;
    }

    .info-card-modern .info-list {
        list-style: none;
        padding: var(--space-5);
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

        .info-card-modern .info-list li {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: 0.875rem;
            color: var(--gray-600);
        }

            .info-card-modern .info-list li i {
                font-size: 1rem;
                flex-shrink: 0;
            }

/* ============================================
   FORMULAIRES
   ============================================ */

.form-label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

    .form-label-modern.required::after {
        content: " *";
        color: var(--danger);
    }

.form-control-modern,
.form-select-modern {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

    .form-control-modern:focus,
    .form-select-modern:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    }

.form-text-modern {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--gray-500);
}

.validation-message-modern {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--danger);
}

.validation-summary-modern {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.875rem;
}

.input-icon-wrapper {
    position: relative;
}

    .input-icon-wrapper i {
        position: absolute;
        left: var(--space-3);
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
        pointer-events: none;
    }

    .input-icon-wrapper input,
    .input-icon-wrapper select {
        padding-left: 2.5rem;
    }

    .input-icon-wrapper .btn-clear {
        position: absolute;
        right: var(--space-3);
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--gray-400);
        cursor: pointer;
    }

        .input-icon-wrapper .btn-clear:hover {
            color: var(--gray-600);
        }

.form-actions-modern {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   TABLEAUX
   ============================================ */

.table-responsive-modern {
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

    .table-modern th {
        padding: var(--space-4) var(--space-4);
        text-align: left;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--gray-500);
        background: var(--gray-50);
        border-bottom: 2px solid var(--gray-200);
    }

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

    .table-modern tbody tr {
        transition: background-color 0.2s ease;
    }

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

        .table-modern tbody tr.table-secondary {
            background-color: var(--gray-100);
            opacity: 0.7;
        }

/* ============================================
   BADGES
   ============================================ */

.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 500;
}

    .badge-modern.badge-primary {
        background: var(--primary-gradient);
        color: white;
    }

    .badge-modern.badge-success {
        background: var(--success-gradient);
        color: white;
    }

    .badge-modern.badge-warning {
        background: var(--warning-gradient);
        color: white;
    }

    .badge-modern.badge-danger {
        background: var(--danger-gradient);
        color: white;
    }

    .badge-modern.badge-info {
        background: var(--info-gradient);
        color: white;
    }

    .badge-modern.badge-secondary {
        background: var(--gray-500);
        color: white;
    }

    .badge-modern.badge-light {
        background: var(--gray-100);
        color: var(--gray-700);
    }

/* ============================================
   STATUTS
   ============================================ */

.statut-badge {
    padding: var(--space-2) var(--space-4);
    border-radius: 50rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
}

.statut-nouveau,
.statut-ouverture {
    background-color: #e7f1ff;
    color: #0d6efd;
    border: 1px solid #b6d4fe;
}

.statut-en-cours,
.statut-documents {
    background-color: #d1ecf1;
    color: #0dcaf0;
    border: 1px solid #bee5eb;
}

.statut-attente {
    background-color: #fff3cd;
    color: #ffc107;
    border: 1px solid #ffeaa7;
}

.statut-termine,
.statut-cloture {
    background-color: #d1e7dd;
    color: #198754;
    border: 1px solid #badbcc;
}

.statut-archive {
    background-color: #e9ecef;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* ============================================
   AVATARS
   ============================================ */

.avatar-modern {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

    .avatar-modern.avatar-sm {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        font-size: 0.75rem;
    }

    .avatar-modern.avatar-lg {
        width: 56px;
        height: 56px;
        border-radius: var(--radius-lg);
        font-size: 1.25rem;
    }

    .avatar-modern.bg-primary {
        background: var(--primary-gradient);
    }

    .avatar-modern.bg-secondary {
        background: var(--gray-500);
    }

/* ============================================
   PAGINATION
   ============================================ */

.pagination-modern {
    display: flex;
    gap: var(--space-1);
    list-style: none;
    padding: 0;
    margin: 0;
}

    .pagination-modern .page-item .page-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-200);
        background: white;
        color: var(--gray-600);
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .pagination-modern .page-item .page-link:hover {
            background: var(--gray-50);
            border-color: var(--primary);
            color: var(--primary);
        }

    .pagination-modern .page-item.active .page-link {
        background: var(--primary-gradient);
        border-color: transparent;
        color: white;
    }

    .pagination-modern .page-item.disabled .page-link {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown-menu-modern {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: var(--space-2) 0;
    margin-top: var(--space-1);
}

.dropdown-item-modern {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-4);
    text-align: left;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .dropdown-item-modern:hover {
        background-color: var(--gray-50);
    }

    .dropdown-item-modern.active {
        background: var(--primary-gradient);
        color: white;
    }

/* ============================================
   MODALS
   ============================================ */

.modal-backdrop-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
}

.modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-dialog-modern {
    max-width: 800px;
    width: 90%;
    margin: var(--space-4);
}

.modal-content-modern {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header-modern {
    padding: var(--space-5) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

    .modal-header-modern.bg-primary {
        background: var(--primary-gradient);
        color: white;
        border-bottom: none;
    }

    .modal-header-modern.bg-danger {
        background: var(--danger-gradient);
        color: white;
        border-bottom: none;
    }

.modal-body-modern {
    padding: var(--space-6);
}

.modal-footer-modern {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

.btn-close-modern {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-close-modern:hover {
        background: rgba(0, 0, 0, 0.2);
        transform: rotate(90deg);
    }

/* ============================================
   ÉTATS VIDES ET CHARGEMENT
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    color: var(--gray-500);
}

.spinner-modern {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    text-align: center;
}

    .empty-state i {
        font-size: 4rem;
        color: var(--gray-300);
        margin-bottom: var(--space-4);
    }

    .empty-state h5 {
        color: var(--gray-600);
        margin-bottom: var(--space-2);
    }

    .empty-state p {
        color: var(--gray-400);
        margin-bottom: var(--space-4);
    }

/* ============================================
   UTILITAIRES
   ============================================ */

.cursor-pointer {
    cursor: pointer;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .page-header-modern {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

        .page-header-modern .header-content {
            flex-direction: column;
            text-align: center;
        }

    .form-actions-modern {
        flex-direction: column;
    }

        .form-actions-modern button {
            width: 100%;
        }
}

@media (max-width: 768px) {
    .stat-card-modern {
        padding: var(--space-4);
    }

        .stat-card-modern .stat-value {
            font-size: 1.5rem;
        }

    .table-responsive-modern {
        font-size: 0.875rem;
    }
}


/* ============================================
   VISIO STYLES - PATIENT & CALL
   ============================================ */

/* Variables communes */
.visio-container,
.patient-call-container,
.call-page {
    --primary: #0d6efd;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0dcaf0;
    --dark-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ============================================
   PATIENT CALL - Plein écran
   ============================================ */

.patient-call-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* ============================================
   CALL PAGE - Intégré dans Blazor
   ============================================ */

.call-page {
    padding: 1rem;
}

.call-container {
    background: var(--dark-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   BARRE D'ÉTAT (commune)
   ============================================ */

.call-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

    .call-status-bar .brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
    }

        .call-status-bar .brand i {
            font-size: 1.1rem;
            color: var(--info);
        }

.call-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

    .call-info i {
        color: var(--info);
    }

/* ============================================
   STATUT & TIMER (communs)
   ============================================ */

.call-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .status-indicator.connected {
        background: rgba(16, 185, 129, 0.2);
        color: var(--success);
    }

    .status-indicator.connecting {
        background: rgba(245, 158, 11, 0.2);
        color: var(--warning);
    }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.call-timer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    font-size: 0.9rem;
    font-family: monospace;
}

/* ============================================
   QUALITÉ (commune)
   ============================================ */

.quality-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.quality-excellent {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.quality-good {
    background: rgba(13, 202, 240, 0.2);
    color: var(--info);
}

.quality-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.quality-poor {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ============================================
   GRILLE VIDÉO
   ============================================ */

/* Patient (plein écran) */
.patient-call-container .video-grid {
    flex: 1;
    position: relative;
    padding: 1rem;
    min-height: 0;
}

/* Call (intégré) */
.call-container .video-grid {
    display: grid;
    grid-template-columns: 1fr 0.5fr;
    gap: 1rem;
    padding: 1rem;
    min-height: 500px;
}

.video-container {
    position: relative;
    background: #0f0f1a;
    border-radius: 16px;
    overflow: hidden;
}

    .video-container video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Patient : vidéo distante pleine */
.patient-call-container .remote-video {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: calc(100vh - 140px);
}

/* Patient : vidéo locale en incrustation */
.patient-call-container .local-video {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 180px;
    height: 135px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
}

    .patient-call-container .local-video:hover {
        transform: scale(1.02);
        border-color: var(--primary);
    }

/* Call : vidéos côte à côte */
.call-container .remote-video,
.call-container .local-video {
    aspect-ratio: 16/9;
}

.call-container .local-video {
    border: 2px solid rgba(13, 110, 253, 0.5);
}

/* ============================================
   OVERLAYS VIDÉO (communs)
   ============================================ */

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
}

.video-controls-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.4rem;
}

.control-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .control-icon:hover {
        background: rgba(0, 0, 0, 0.8);
        transform: scale(1.1);
    }

    .control-icon.active {
        background: var(--danger);
    }

.participant-label {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    color: white;
}

/* ============================================
   CONTROLS (communs)
   ============================================ */

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 40px;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .control-btn i {
        font-size: 1.1rem;
    }

    .control-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .control-btn.active {
        background: var(--danger);
    }

    .control-btn.end-call {
        background: var(--danger);
    }

        .control-btn.end-call:hover {
            background: #c82333;
            transform: scale(1.02);
        }

/* ============================================
  CONTROLS (Page Call) Boutons WhatsApp, mail...
   ============================================ */
.control-btn.whatsapp-btn {
    background: rgba(37, 211, 102, 0.2);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

    .control-btn.whatsapp-btn:hover {
        background: #25d366;
        border-color: #25d366;
    }

    .control-btn.whatsapp-btn i {
        color: #25d366;
    }

    .control-btn.whatsapp-btn:hover i {
        color: white;
    }

.control-btn.email-btn {
    background: rgba(13, 110, 253, 0.2);
    border: 1px solid rgba(13, 110, 253, 0.3);
}

    .control-btn.email-btn:hover {
        background: #0d6efd;
        border-color: #0d6efd;
    }

    .control-btn.email-btn i {
        color: #0d6efd;
    }

    .control-btn.email-btn:hover i {
        color: white;
    }


/* ============================================
   ÉTATS DE CHARGEMENT (communs)
   ============================================ */

.patient-loading,
.patient-error,
.patient-ended,
.call-loading,
.call-error,
.call-ended {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.loading-spinner {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
}

.spinner-ring {
    width: 70px;
    height: 70px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.call-loading .spinner-ring {
    border-color: rgba(13, 110, 253, 0.3);
    border-top-color: var(--primary);
}

.loading-spinner i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: white;
}

.call-loading .loading-spinner i {
    color: var(--primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-card,
.end-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
}

.error-icon,
.end-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.error-icon {
    background: #fef2f2;
    color: var(--danger);
}

.end-icon {
    background: #d1e7dd;
    color: var(--success);
}

.call-duration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 0.8rem 0;
    font-size: 0.8rem;
    color: #6c757d;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .call-status-bar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

        .call-status-bar .brand span,
        .quality-badge span,
        .call-info span:not(.badge) {
            display: none;
        }

    .call-container .video-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .patient-call-container .local-video {
        width: 120px;
        height: 90px;
        bottom: 70px;
        right: 0.5rem;
    }

    .call-controls {
        padding: 0.75rem;
        gap: 0.8rem;
    }

    .control-btn {
        padding: 0.4rem 0.8rem;
    }

        .control-btn span {
            font-size: 0.65rem;
        }

    .remote-video {
        min-height: 250px;
    }
}


/* ============================================
   WHATSAPP CONVERSATION - STYLE MODERNE
   ============================================ */

.whatsapp-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 2rem);
    background: #f0f2f5;
    border-radius: 16px;
    overflow: hidden;
    margin: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* En-tête */
.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #075e54;
    color: white;
}

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

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

    .back-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.patient-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #128c7e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.patient-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.patient-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #25d366;
    animation: pulse 1.5s infinite;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

    .header-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

/* Zone des messages */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.05"><path d="M10,10 L90,10 L90,90 L10,90 Z" fill="none" stroke="%23333" stroke-width="1"/><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="none" stroke="%23333" stroke-width="1"/></svg>');
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    display: flex;
    margin: 0.25rem 0;
}

    .message-item.outgoing {
        justify-content: flex-end;
    }

    .message-item.incoming {
        justify-content: flex-start;
    }

.message-bubble {
    max-width: 70%;
    padding: 0.5rem 0.75rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.outgoing .message-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.incoming .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    color: #999;
}

    .message-info .status {
        margin-left: 0.25rem;
    }

/* Localisation */
.location-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.map-btn {
    background: #075e54;
    border: none;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    cursor: pointer;
}

/* Image */
.image-content {
    max-width: 200px;
}

    .image-content img {
        width: 100%;
        border-radius: 12px;
        cursor: pointer;
    }

.image-caption {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #666;
}

/* Zone de saisie */
.input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f2f5;
    border-top: 1px solid #e0e0e0;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #075e54;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

    .action-btn:hover {
        background: rgba(7, 94, 84, 0.1);
    }

.input-wrapper {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 24px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e0e0e0;
}

    .input-wrapper textarea {
        flex: 1;
        border: none;
        padding: 0.5rem;
        resize: none;
        font-family: inherit;
        font-size: 0.9rem;
        max-height: 100px;
        background: transparent;
    }

        .input-wrapper textarea:focus {
            outline: none;
        }

.send-btn {
    background: #075e54;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

    .send-btn:hover:not(:disabled) {
        background: #128c7e;
    }

    .send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* États vides */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

/* Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }

    .message-bubble {
        max-width: 85%;
    }

    .header-left .patient-details h4 {
        font-size: 0.9rem;
    }
}