/* Enhanced Hospital Website Styles - Shared CSS Framework */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --secondary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.15);
    --shadow-medium: 0 12px 40px rgba(31, 38, 135, 0.2);
    --shadow-heavy: 0 20px 60px rgba(31, 38, 135, 0.3);
    --border-radius: 16px;
    --border-radius-large: 20px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 226, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #2d3748;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(0,0,0,0.02)"/><circle cx="75" cy="75" r="1" fill="rgba(0,0,0,0.02)"/><circle cx="50" cy="10" r="0.5" fill="rgba(0,0,0,0.01)"/><circle cx="90" cy="40" r="0.5" fill="rgba(0,0,0,0.01)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: -1;
}

/* Navigation Styles */
.navbar {
    background: var(--primary-gradient);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.navbar h1 {
    font-size: 26px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 2;
}

/* Badge Styles */
.badge {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.badge::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;
}

.badge:hover::before {
    left: 100%;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.badge-sapeur_pompier {
    background: var(--danger-gradient);
    color: white;
}

.badge-sapeur_pompier::before {
    content: "🚒";
}

.badge-ambulancier {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.badge-ambulancier::before {
    content: "🚑";
    margin-right: 6px;
}

.badge-auxiliaire_ambulancier {
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    color: white;
}

.badge-auxiliaire_ambulancier::before {
    content: "🚑";
    margin-right: 6px;
}

.badge-infirmier {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.badge-infirmier::before {
    content: "💉";
    margin-right: 6px;
}

.badge-cadre_sante {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.badge-cadre_sante::before {
    content: "👔";
    margin-right: 6px;
}

.badge-rh {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
}

.badge-rh::before {
    content: "📋";
    margin-right: 6px;
}

.badge-responsable {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.badge-responsable::before {
    content: "👨‍💼";
    margin-right: 6px;
}

.badge-conseiller {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.badge-conseiller::before {
    content: "💼";
    margin-right: 6px;
}

.badge-medecin {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.badge-medecin::before {
    content: "👨‍⚕️";
    margin-right: 6px;
}

.badge-directeur_adjoint {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-directeur_adjoint::before {
    content: "🎯";
    margin-right: 6px;
}

.badge-directeur_general {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.badge-directeur_general::before {
    content: "⭐";
    margin-right: 6px;
}

.badge-receptionniste {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
}

.badge-receptionniste::before {
    content: "📞";
    margin-right: 6px;
}

.badge-patient {
    background: var(--secondary-gradient);
    color: white;
}

/* Button Styles */
.btn, .logout-btn, .register-link {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-primary, .logout-btn {
    background: var(--glass-bg);
    color: white;
    backdrop-filter: blur(20px);
}

.btn-primary::before, .logout-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;
}

.btn-primary:hover::before, .logout-btn:hover::before {
    left: 100%;
}

.btn-primary:hover, .logout-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Card Styles */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 40px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: rgba(255, 255, 255, 0.3);
}

.card h2 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.code-input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.code-input-group input {
    flex: 1;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: transparent;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

th {
    background: rgba(255, 255, 255, 0.1);
    color: #2d3748;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 5px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 5px solid #28a745;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #a0aec0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
}

.empty-state .icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 600;
}

.empty-state p {
    font-size: 16px;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 25px;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,249,250,0.98) 100%);
    text-align: center;
    padding: 18px 20px;
    color: #718096;
    font-size: 13px;
    border-top: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(15px);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .navbar h1 {
        font-size: 22px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .card {
        padding: 25px;
        margin-bottom: 30px;
    }

    .card h2 {
        font-size: 22px;
    }

    .table-container {
        margin: 0 -15px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .card {
        padding: 20px;
    }

    .btn, .logout-btn, .register-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .badge {
        padding: 8px 12px;
        font-size: 12px;
    }

    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }