/* 🌟 استدعاء خطوط احترافية من جوجل (Cairo للعربي و Poppins للإنجليزي) 🌟 */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Poppins:wght@400;600;800&display=swap');

:root {
    --primary: #ec4899;       /* لون وردي زاهي */
    --primary-dark: #be185d;  /* روز داكن */
    --primary-light: #fdf2f8; /* وردي فاتح جداً للخلفيات */
    --secondary: #8b5cf6;     /* بنفسجي هادي */
    --bg-main: #f8fafc;       
    --text-main: #334155;     
}

/* ========================================== */
/* 🌟 الإعدادات الأساسية (Base) 🌟 */
/* ========================================== */
body {
    font-family: 'Cairo', 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #f8fafc 100%);
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    text-align: center;
    /* منع تحديد النصوص للحماية */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* منع تأثير السحب الزائد في الموبايل (PWA Feel) */
    overscroll-behavior-y: none; 
}

/* استثناء مربعات الإدخال عشان الموظف يقدر يكتب وينسخ منها */
input, select, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* 🌟 شريط التمرير المخصص (Custom Scrollbar) 🌟 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ========================================== */
/* 🌟 شريط التنقل (Navbar) 🌟 */
/* ========================================== */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.navbar a {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    transition: 0.3s;
}

.navbar a:hover { color: var(--primary); transform: translateY(-2px); }

.lang-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}
.lang-btn:hover { transform: translateY(-2px); background: var(--primary-dark); box-shadow: 0 6px 15px rgba(14, 165, 233, 0.3); }

/* ========================================== */
/* 🌟 الكروت الأساسية (Cards) 🌟 */
/* ========================================== */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 15px 35px -5px rgba(0,0,0,0.05);
    margin: 40px auto;
    padding: 40px;
    max-width: 600px; /* تم تكبيره قليلاً ليكون مريح للشاشات */
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255,255,255,0.8);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2 { color: var(--primary-dark); font-weight: 900; margin-top: 0; margin-bottom: 15px; letter-spacing: 0.5px;}

/* ========================================== */
/* 🌟 عناصر الإدخال (Inputs & Dropdowns) 🌟 */
/* ========================================== */
.dropdown, .input-field, .phone-input {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-family: inherit;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background-color: #f8fafc;
    color: var(--text-main);
    transition: 0.3s;
    outline: none;
    box-sizing: border-box; /* يمنع خروج العنصر عن الشاشة */
}
.dropdown:focus, .input-field:focus, .phone-input:focus { 
    border-color: var(--primary); 
    background-color: white; 
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1); 
}

/* ========================================== */
/* 🌟 الأزرار المودرن (Buttons) 🌟 */
/* ========================================== */
.btn-next {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px 30px;
    font-size: 18px;
    font-family: inherit;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
    width: 100%;
}
.btn-next:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(14, 165, 233, 0.4); filter: brightness(1.05); }
.btn-next:active { transform: translateY(1px); }

/* ========================================== */
/* 🌟 الأرقام الكبيرة (Big Numbers) 🌟 */
/* ========================================== */
.big-number {
    font-size: 90px;
    font-weight: 900;
    color: var(--primary);
    margin: 15px 0;
    line-height: 1;
    text-shadow: 0 10px 20px rgba(14, 165, 233, 0.15);
}

/* ========================================== */
/* 🌟 الجداول (Tables) 🌟 */
/* ========================================== */
table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: white; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); margin-top: 20px;
    border: 1px solid #f1f5f9;
}
th { background: #f8fafc; color: var(--text-muted); padding: 18px; font-size: 16px; font-weight: 800; border-bottom: 2px solid #e2e8f0;}
td { padding: 18px; border-bottom: 1px solid #f1f5f9; font-size: 18px; font-weight: 700; text-align: center; color: var(--text-main);}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #f8fafc; }

/* ========================================== */
/* 📱 تحسينات الموبايل (Mobile First PWA) 📱 */
/* ========================================== */
@media screen and (max-width: 768px) {
    .card { width: 92%; padding: 30px 20px; margin: 20px auto; border-radius: 20px;}
    
    .navbar { flex-direction: column; text-align: center; padding: 15px; gap: 15px; border-radius: 0 0 20px 20px;}
    .navbar div { display: flex; justify-content: center; flex-wrap: wrap; width: 100%; gap: 10px;}
    
    h2 { font-size: 24px; }
    .big-number { font-size: 65px; }
    
    table, .admin-table { display: block; overflow-x: auto; white-space: nowrap; width: 100%; }
    .kpi-card, .chart-box { min-width: 100%; flex: 100%; }
    
    .login-box { width: 90%; padding: 30px 20px; margin: 20px auto; border-radius: 25px;}
}

/* ========================================== */
/* 🌟 توقيع المهندس (Developer Signature) 🌟 */
/* ========================================== */
.developer-signature {
    text-align: center;
    padding: 25px 10px;
    margin-top: auto; 
    font-size: 14px;
    color: var(--text-muted); 
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.developer-signature .dev-name {
    color: var(--primary);
    font-weight: 900;
    transition: 0.3s;
    cursor: default;
}
.developer-signature .dev-name:hover {
    color: var(--primary-dark);
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.4); 
}
/* ========================================== */
/* 🖨️ الكود النهائي لطابعات الريسيت الحرارية 🖨️ */
/* ========================================== */
@media print {
    @page {
        margin: 0; /* مسح هوامش المتصفح بالكامل */
    }
    
    /* إخفاء كل الموقع تماماً ومسح مساحته */
    body > *:not(#print-ticket) {
        display: none !important;
    }
    
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    /* إظهار التذكرة فقط وإجبارها على أخذ عرض الورقة */
    #print-ticket {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        text-align: center !important;
        color: #000 !important; /* إجبار اللون الأسود للطباعة */
    }

    /* تكبير الـ QR Code ليملأ عرض ورقة الطابعة */
    #print-qr-code {
        width: 90% !important; /* هياخد 90% من عرض ورقة الريسيت */
        max-width: 250px !important;
        height: auto !important;
        margin: 10px auto !important;
        display: block !important;
    }

    /* تظبيط مقاسات الخطوط لتناسب الطابعة الحرارية */
    #print-ticket h1 { font-size: 45px !important; margin: 5px 0 !important; color: #000 !important; font-weight: 900 !important; }
    #print-ticket h2 { font-size: 24px !important; margin: 5px 0 !important; color: #000 !important; }
    #print-ticket p { font-size: 18px !important; margin: 5px 0 !important; color: #000 !important; font-weight: bold !important; }
}

/* 🌟 بادج رقم العيادة الموحد لجميع الشاشات 🌟 */
.room-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 16px;
    padding: 4px 15px;
    border-radius: 20px;
    margin-top: 8px;
    margin-right: 10px;
    font-weight: 900;
    border: 1px solid #bae6fd;
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.1);
}