﻿
/* ✅ إعدادات عامة */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background-color: #fff8e7;
}

/* قيم الحاوية الموحدة لكل الصفحات (اجعل max مطابق لحاوية الكروت) */
:root {
    --topbar-h: 110px;
    --site-max: 1200px; /* غيّرها لما يطابق عرض الكروت عندك */
    --site-pad: 16px;
    /* مسافة اللوحة يمين (ثابتة) */
    --admin-sidebar-w: 300px;
    /* أمان إضافي بين المحتوى واللوحة */
    --admin-gutter: 40px;
    /* فراغ فاضي على الجانب المقابل (الشمال في RTL) */
    --admin-outer-gap: 48px;
}

/* عوّض ارتفاع الهيدر الثابت لكل صفحات الهوية */
.identity-page .main-layout,
.identity-page main,
.identity-page .auth-page-container {
    padding-top: var(--topbar-h);
}

/* حاوية قياسية مشتركة للهيدر/المحتوى/الكروت */
.site-container {
    max-width: var(--site-max);
    margin-inline: auto;
    padding-inline: var(--site-pad);
}

/* ✅ هيكل الصفحة */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== الهيدر =====
   تحذير: لا تعرّف .main-header أو .nav-links هنا مرة أخرى كي لا يحصل تعارض
*/

/* ===== محتوى الصفحة ===== */
.main-layout {
    /* مسافة كافية تحت الهيدر الثابت */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    box-sizing: border-box;
}

    /* RTL-safe: inline-start = اليمين، inline-end = الشمال في RTL */
    .main-content.with-sidebar {
        /* فراغ فاضي على الشمال */
        padding-inline-end: var(--admin-outer-gap);
        /* إزاحة + أمان من اللوحة الثابتة على اليمين */
        padding-inline-start: calc(var(--admin-sidebar-w) + var(--admin-gutter));
    }


/* ===== الشريط الجانبي ===== */
.sidebar-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 210px;
    background-color: #fff3cd;
    padding: 25px 15px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

/* ===== الفوتر ===== */
.site-footer {
    background: linear-gradient(to right, #ffe0b2, #ffcc80);
    padding: 20px;
    text-align: center;
    font-size: 16px;
    color: #444;
    border-top: 2px dashed #ff9800;
    direction: rtl;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
}

.footer-content p {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 17px;
}

.footer-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    flex-wrap: wrap;
}

    .footer-icons img {
        width: 32px;
        height: 32px;
        transition: transform .3s ease;
        cursor: pointer;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,.2));
    }

        .footer-icons img:hover {
            transform: scale(1.2) rotate(6deg);
        }

/* ======== Header (shared with Identity) ======== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(to right, #ffcc70, #ff8c42);
    border-bottom: 4px solid #ff6b6b;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    padding: 12px 0;
}

/* نفس حاوية كروت الهوم */
.header-container {
    max-width: 1100px; /* لو عرض الكروت عندك غير كده عدّله */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0,0,0,.2);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

    /* روابط الهيدر (رابط + زر الخروج بنفس الشكل تماماً) */
    .nav-links a,
    .nav-links .nav-logout {
        -webkit-appearance: none;
        appearance: none;
        border: 0;
        box-sizing: border-box;
        text-decoration: none;
        color: #fff;
        background: rgba(255,255,255,.2);
        padding: 8px 14px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 700;
        font-family: inherit; /* ✅ يخلي الزر ياخد نفس الخط */
        line-height: 1.4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 40px;
        cursor: pointer;
        transition: .25s ease;
    }


        .nav-links a:hover,
        .nav-links .nav-logout:hover {
            background: #fff;
            color: #ff6b6b;
            box-shadow: 0 0 5px rgba(0,0,0,.1);
        }

    /* نسخة الموبايل للقائمة المنسدلة */
    .nav-links.show a,
    .nav-links.show .nav-logout {
        background: #ffcc80;
        color: #333;
        border-radius: 10px;
    }


.menu-toggle {
    background: none;
    border: none;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    display: none;
}

/* ========== Footer Pro (مُحدّث) ========== */

.site-footer {
    background: linear-gradient(to right, #ffe0b2, #ffcc80);
    border-top: 2px dashed #ff9800;
    color: #444;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
    padding: 22px 16px;
}

.footer-wrap {
    max-width: var(--site-max);
    margin-inline: auto;
    padding-inline: var(--site-pad);
    display: grid;
    grid-template-columns: 1fr auto; /* براند | سوشيال */
    gap: 20px;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 80px; /* حجم أوضح ومتوازن */
    height: 80px;
    border-radius: 50%; /* دائرية كاملة */
    object-fit: cover; /* يملأ الدائرة تماماً */
    background-color: transparent; /* إزالة أي خلفية */
    padding: 0; /* بدون فراغ داخلي */
    border: none; /* بدون إطار */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); /* ظل ناعم */
    display: block; /* يمنع وجود أي فراغات inline */
    overflow: hidden; /* يقطع أي بروز خارج الدائرة */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .footer-logo:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    }



.footer-title {
    margin: 0 0 2px;
    font-weight: 800;
    font-size: 18px;
    color: #2b2b2b;
}

.footer-tagline {
    margin: 0;
    color: #6b7280;
    font-weight: 700;
    font-size: 14px;
}

.footer-social {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

    .footer-social img {
        width: 30px;
        height: 30px;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,.2));
        transition: transform .2s ease;
    }

    .footer-social a:hover img {
        transform: scale(1.1) rotate(5deg);
    }

.footer-legal {
    max-width: var(--site-max);
    margin: 10px auto 0;
    text-align: center;
    padding-inline: var(--site-pad);
}

    .footer-legal p {
        margin: 6px 0 0;
        font-weight: 800;
    }

.footer-links a {
    color: #444;
    text-decoration: none;
}

    .footer-links a:hover {
        text-decoration: underline;
    }

/* موبايل */
@media (max-width: 768px) {
    .footer-wrap {
        grid-template-columns: 1fr; /* عمود واحد */
        gap: 10px;
        text-align: center;
        justify-items: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
    }
}



/* موبايل */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
    }

        .nav-links.show {
            display: flex;
            flex-direction: column;
            gap: 8px;
            background: linear-gradient(to right, #ffcc70, #ff8c42);
            border-radius: 10px;
            padding: 12px;
        }

            .nav-links.show a {
                background: #ffcc80;
                color: #333;
            }

    .logo-welcome {
        order: 1;
    }

    .menu-toggle {
        order: 2;
        margin-inline-start: auto;
        display: block;
    }

    .nav-links {
        order: 3;
    }
}

/* يسار: دعم LearnPlay */
.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.footer-left-title {
    margin: 0;
    font-weight: 800;
    font-size: 16px;
    color: #2b2b2b;
}

.footer-left-sub {
    margin: 0 0 4px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 700;
}

/* نسخة خفيفة من أيقونات السوشيال لليسار */
.footer-social.lf {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .footer-social.lf img {
        width: 28px;
        height: 28px;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,.2));
        transition: transform .2s ease;
    }

    .footer-social.lf a:hover img {
        transform: scale(1.1) rotate(5deg);
    }

/* موبايل: وسط */
@media (max-width: 768px) {
    .footer-left {
        align-items: center;
        text-align: center;
    }
}


/* ===== دعم الشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .main-layout {
    }

    .main-content.with-sidebar {
        padding-right: 0;
    }

    .sidebar-nav {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 15px;
        border-bottom: 2px solid #ffcc80;
    }
}

/* ===== إخفاء زر القائمة في صفحات Identity ===== */
/*.identity-page .menu-toggle {
    display: none !important;
}
*/
/* ===== إخفاء رسالة الخطأ من Blazor ===== */
#blazor-error-ui {
    display: none !important;
}


@media (max-width: 992px) {
    .main-content.with-sidebar {
        /* لما اللوحة تبقى فوق، نخلي الجانبين فراغ بسيط ومتساوي */
        padding-inline: 24px;
    }

    .sidebar-nav {
        position: relative; /* مش fixed */
        right: auto;
        width: 100%;
        height: auto;
    }
}
