/* ============================================
   SYSTÈME DE GESTION HOSPITALIÈRE - DME
   Feuille de style principale
   ============================================ */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* ============================================
   LAYOUT GÉNÉRAL
   ============================================ */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

main {
    flex: 1;
}

/* ============================================
   PAGE DE CONNEXION
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
    font-size: 4rem;
    color: var(--primary-color);
}

/* ============================================
   CARTES ET TABLEAUX
   ============================================ */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success { border-left-color: var(--success-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.info { border-left-color: var(--info-color); }

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
}

/* ============================================
   DOSSIER PATIENT
   ============================================ */
.patient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.patient-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.patient-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 4px solid white;
}

/* ============================================
   TIMELINE MÉDICALE
   ============================================ */
.medical-timeline {
    position: relative;
    padding-left: 30px;
}

.medical-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item.completed::before { background: var(--success-color); box-shadow: 0 0 0 2px var(--success-color); }
.timeline-item.pending::before { background: var(--warning-color); box-shadow: 0 0 0 2px var(--warning-color); }
.timeline-item.cancelled::before { background: var(--danger-color); box-shadow: 0 0 0 2px var(--danger-color); }

.timeline-date {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* ============================================
   BADGES DE STATUT
   ============================================ */
.badge-status {
    padding: 0.5em 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* ============================================
   LISTE DES PATIENTS EN ATTENTE
   ============================================ */
.waiting-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.waiting-list-item:hover {
    background-color: #f8f9fa;
}

.waiting-list-item:last-child {
    border-bottom: none;
}

.waiting-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
}

.waiting-time {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.waiting-time.urgent {
    color: var(--danger-color);
    font-weight: 600;
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
}

.required-field::after {
    content: ' *';
    color: var(--danger-color);
}

/* ============================================
   CONSTANTES VITALES
   ============================================ */
.vital-signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.vital-sign-card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.vital-sign-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.vital-sign-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.vital-sign-card .label {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.vital-sign-card.abnormal {
    border: 2px solid var(--danger-color);
}

.vital-sign-card.abnormal .value {
    color: var(--danger-color);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    border-left: 3px solid transparent;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
    border-left-color: var(--primary-color);
}

/* ============================================
   TABLEAUX
   ============================================ */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ============================================
   RECHERCHE
   ============================================ */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
    border-radius: 2rem;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .patient-header {
        text-align: center;
    }
    
    .vital-signs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

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

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

/* ============================================
   IMPRESSION
   ============================================ */
@media print {
    .navbar, footer, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
