﻿/* ========== إعدادات عامة ========== */
html, body {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ========== Fix: منع تعدد السكرول ========== */
html {
    direction: ltr; /* شريط التمرير يظهر يمين */
    overflow-y: auto !important; /* تفعيل السكرول الرأسي */
    overflow-x: hidden !important; /* إلغاء السكرول الأفقي */
    height: auto;
    scrollbar-gutter: stable; /* منع الاهتزاز */
}

/* النصوص من اليمين لليسار */
body {
    direction: rtl;
    overflow: visible !important; /* بدون سكرول إضافي داخل body */
}

/* منع أي سكرول داخلي في الحاويات (استبعدنا .sr-app) */
#app, .sr-main, main, .hp {
    overflow: visible !important;
}

/* قصّ أي تمدد أفقي من الأقسام الكبيرة */
.sr-app, .sr-main, .hp, .kv-hero, .hp-grid {
    overflow-x: clip !important;
}

/* ========== تصميم شريط التمرير ========== */
html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 10px;
    transition: background 0.3s ease;
}

    html::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #2563eb, #1e3a8a);
    }

html::-webkit-scrollbar-track {
    background: transparent;
}

/* تأكيد إظهار الشريط */
html::-webkit-scrollbar,
html::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-track {
    display: block !important;
}

/* ========== تحسين العناصر المرئية ========== */
img, video, svg, canvas, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== تهيئة البوكس سايزينج ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ========== روابط وأزرار عامة ========== */
a, .btn-link {
    color: #ffffff;
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-primary {
    color: #fff;
    background-color: #ff6666;
    border-color: #ff6666;
}

/* تنسيق الفوكس */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ========== عناصر عامة ========== */
.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ========== معالجة الأخطاء ========== */
.blazor-error-boundary {
    background-color: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ========== الهيدر العلوي (إن وُجد) ========== */
.top-row {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    letter-spacing: 0.2px;
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
}

/* أزرار تسجيل الدخول */
.auth-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.auth-btn {
    border: 1px solid #ffffff88;
    border-radius: 6px;
    padding: 5px 12px;
    color: white;
    background: transparent;
    transition: background-color 0.3s;
    text-decoration: none;
}

    .auth-btn:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
