/* ==========================================================================
   Navigation Styles
   Extracted from Navigation.php
   Keep section order unchanged because later rules may intentionally override
   earlier rules.
   ========================================================================== */

/* ==========================================================================
   1. General, ads, navbar toggler, suggestion icon and modal header
   ========================================================================== */
/* 🖥️ Desktop */
@media (min-width: 769px) {
  body {
    overflow-x: hidden;
  }

  .container-fluid {
    max-width: 100%;
  }
}

/* 📱 Mobile */
@media (max-width: 768px) {
  .navbar,
  .offcanvas-collapse,
  .adsbygoogle,
  .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ===== Ads ===== */
.quiz-ad-horizontal { margin:auto; text-align:center; padding:0; background:#F8F8F8; }
@media (max-width:768px){ .Ad1{display:none;} .Ad2{width:100%;height:60px;} }
@media (min-width:769px){ .Ad2{display:none;} }

/* تحسين القائمة المنسدلة للأصناف */
.dropdown-menu { max-height: 400px; overflow-y: auto; overflow-x: hidden; }

/* ===== Logo Shine ===== */
.shine-logo{ position:relative; display:inline-block; overflow:hidden; }
.shine-logo::before{
  content:"";
  position:absolute; top:0; left:-120%;
  width:100%; height:100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.65) 50%, transparent 100%);
  transform: skewX(-25deg);
  animation: logoShine 2.6s infinite;
}
@keyframes logoShine{
  0%{left:-120%;opacity:0;}
  35%{opacity:1;}
  65%{left:120%;opacity:0;}
  100%{opacity:0;}
}

/* ===== أيقونة المنيو ☰ / X (متوازنة) ===== */
.navbar-toggler{
  padding: 8px;
}

.navbar-toggler .menu-icon{
  width: 28px;
  height: 2.5px;
  background-color: #6c757d;   /* رمادي موحّد */
  display: inline-block;
  position: relative;
  transition: background-color .25s ease, transform .25s ease;
}

.navbar-toggler .menu-icon::before,
.navbar-toggler .menu-icon::after{
  content: "";
  width: 28px;
  height: 2.5px;
  background-color: #6c757d;   /* نفس اللون تمامًا */
  position: absolute;
  left: 0;
  transition: transform .25s ease, top .25s ease;
}

/* المسافة بين الخطوط */
.navbar-toggler .menu-icon::before{ top: -9px; }
.navbar-toggler .menu-icon::after { top:  9px; }

/* ===== عند فتح القائمة → X ===== */
.navbar-toggler.offcanvas-open .menu-icon{
  background-color: transparent; /* إخفاء الخط الأوسط */
}

.navbar-toggler.offcanvas-open .menu-icon::before{
  top: 0;
  transform: rotate(45deg);
}

.navbar-toggler.offcanvas-open .menu-icon::after{
  top: 0;
  transform: rotate(-45deg);
}

/* ================================
   ✅ اقتراح سؤال داخل القائمة (موبايل فقط)
   ================================ */
.suggestion-menu-item .nav-link{ font-weight:700; cursor:pointer; }
.suggestion-menu-item .nav-link i{ margin-left:6px; } /* RTL */

@media (min-width: 769px) {
  .suggestion-menu-item { display:none !important; } /* اخفاء من القائمة على الكمبيوتر */
}

/* ================================
   ✅ أيقونة الاقتراح (كمبيوتر فقط)
   ================================ */
#suggestionIcon{
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f4e185, #f4c430, #d4a017);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 9999;
}
#suggestionIcon i{ animation: pulseLight 1.6s infinite; }
@keyframes pulseLight{
  0%{transform:scale(1);}
  70%{transform:scale(1.25);}
  100%{transform:scale(1);}
}
@media (max-width: 768px) {
  #suggestionIcon{ display:none !important; } /* اخفاء الايقونة على الجوال */
}

/* ================================
   ✅ تعديل زر الإغلاق X داخل المودال
   ================================ */
.modal-header { padding: 15px 28px !important; position: relative; }
.modal-header .close{
  position:absolute;
  left:20px; /* RTL */
  top:70%;
  transform: translateY(-50%);
  font-size:28px;
  padding:5px 10px;
  opacity:.8;
}
.modal-header .close:hover{ opacity:1; }

/* ==========================================================================
   2. Premium menu link and badge
   ========================================================================== */
/* ================================
   👑 رابط وحالة Premium في القائمة
   ================================ */
.premium-member-link{
  display:flex !important;
  align-items:center;
  gap:6px;
  font-weight:700;
  color:#d4a017 !important;
  transition:.3s ease;
}

.premium-member-link:hover{
  color:#b8860b !important;
  transform:translateY(-1px);
}

.premium-crown{
  font-size:17px;
  line-height:1;
}

.premium-badge{
  display:inline-block;
  padding:2px 7px;
  border-radius:20px;
  background:linear-gradient(135deg,#ffe08a,#e0a800);
  color:#222;
  font-size:10px;
  font-weight:900;
  line-height:1.5;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}

@media(max-width:768px){
  .premium-member-link{
    flex-wrap:wrap;
  }
}

/* ==========================================================================
   3. Sound controls visibility
   ========================================================================== */
/* إخفاء أزرار الصوت والواتساب عند فتح أي مودال */
body.modal-open #soundNotifWrapper,
body.modal-open #mobileSoundBtn,
body.modal-open .float {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ==========================================================================
   4. Sound buttons and effects
   ========================================================================== */
#toggleSound, #mobileSoundBtn { position: relative; overflow: hidden; }

#toggleSound::before, #mobileSoundBtn::before{
  content:"";
  position:absolute; top:0; left:-70%;
  width:70%; height:100%;
  border-radius:50%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
  transform: skewX(-25deg);
  /*animation: innerShine 2.3s infinite;*/
  pointer-events:none;
}
@keyframes innerShine{
  0%{left:-80%;opacity:0;}
  40%{opacity:1;}
  70%{left:80%;opacity:0;}
  100%{opacity:0;}
}

#toggleSound:not(.off), #mobileSoundBtn:not(.off){ box-shadow: inset 0 0 12px rgba(46,204,113,.5); }
#toggleSound.off, #mobileSoundBtn.off{ box-shadow: inset 0 0 12px rgba(231,76,60,.5); }

#soundNotifWrapper{
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1045;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  font-family:"Tajawal", sans-serif !important;
}

#toggleSound{
  width:40px;height:40px;border-radius:50%;
  background: rgba(255,255,255,.93);
  border:2px solid #2ecc71;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.25);
  cursor:pointer;transition:.25s ease;
}
#toggleSound i{ font-size:18px !important; color:#2ecc71 !important; }
#toggleSound.off{ border-color:#e74c3c !important; }
#toggleSound.off i{ color:#e74c3c !important; }

#mobileSoundBtn{
  position: fixed;
  top: 76px;
  left: 55px;
  z-index: 1045;
  width:40px;height:40px;border-radius:50%;
  background: rgba(255,255,255,.93);
  border:2px solid #2ecc71;
  display:none;
  align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.25);
  cursor:pointer;transition:.25s ease;
}
#mobileSoundBtn i{ font-size:18px !important; color:#2ecc71 !important; }
#mobileSoundBtn.off{ border-color:#e74c3c !important; }
#mobileSoundBtn.off i{ color:#e74c3c !important; }

@media (max-width:768px){ #toggleSound{display:none;} #mobileSoundBtn{display:flex;} }

@media (min-width: 769px) {
  #toggleSound{
    margin-left: 15px; /* عدّل الرقم حسب ما بدك */
  }
}

/* ==========================================================================
   5. Mobile Premium banner
   ========================================================================== */
/* إعلان Premium / YouTube — للجوال فقط وبدون تجاوز الشاشة */

.mobile-premium-banner{
    display:block;
    width:100%;
    max-width:100%;
    padding:0 6px;
    margin:0;
    overflow:hidden;
    box-sizing:border-box;
}

.mobile-premium-banner *,
.mobile-premium-banner *::before,
.mobile-premium-banner *::after{
    box-sizing:border-box;
}

@media (min-width:769px){
    .mobile-premium-banner{
        display:none !important;
    }
}

.premium-banner{
    position:relative;
    display:flex;
    align-items:center;

    width:100%;
    max-width:100%;
    height:60px;

    margin:0;
    overflow:hidden;

    border:1px solid #e3b72f;
    border-radius:8px;

    background:linear-gradient(
        135deg,
        #fff9df 0%,
        #ffe98a 48%,
        #f6c83c 100%
    );

    color:#222;
    cursor:pointer;
    text-decoration:none !important;

    box-shadow:0 4px 14px rgba(212,160,23,.28);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.premium-banner:hover,
.premium-banner:focus{
    color:#222;
    text-decoration:none !important;
    transform:translateY(-1px);
    box-shadow:0 7px 18px rgba(212,160,23,.38);
    outline:none;
}

.premium-banner::before{
    content:"";
    position:absolute;
    z-index:0;
    top:0;
    left:-45%;
    width:35%;
    height:100%;

    background:linear-gradient(
        110deg,
        transparent,
        rgba(255,255,255,.75),
        transparent
    );

    transform:skewX(-20deg);
    animation:premiumBannerShine 3s infinite;
    pointer-events:none;
}

@keyframes premiumBannerShine{
    0%{left:-45%;}
    45%,100%{left:125%;}
}

.premium-banner-icon{
    position:relative;
    z-index:1;

    width:74px;
    height:60px;
    flex:0 0 74px;

    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;

    color:#5e4300;

    background:linear-gradient(
        145deg,
        #ffea7b,
        #dba816
    );

    border-left:1px solid rgba(110,75,0,.14);
}

.premium-banner-icon .crown{
    font-size:24px;
    line-height:1;
}

.premium-banner-icon small{
    margin-top:2px;
    font-size:8px;
    font-weight:900;
    line-height:1;
    letter-spacing:.5px;
}

.premium-banner .info{
    position:relative;
    z-index:1;

    flex:1 1 auto;
    min-width:0;

    overflow:hidden;
    padding:0 7px;
    text-align:right;
}

.premium-banner .title{
    overflow:hidden;
    color:#2b220b;
    font-size:13px;
    font-weight:900;
    line-height:1.2;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.premium-banner .description{
    margin-top:3px;
    overflow:hidden;
    color:#6c5310;
    font-size:10px;
    font-weight:700;
    line-height:1.2;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.premium-banner-action{
    position:relative;
    z-index:1;
    flex:0 0 auto;

    margin-left:5px;
    padding:5px 8px;

    border-radius:18px;
    background:#72b626;
    color:#fff;

    font-size:10px;
    font-weight:900;
    line-height:1.4;
    white-space:nowrap;

    box-shadow:0 3px 8px rgba(71,122,17,.28);
    animation:premiumButtonPulse 1.8s infinite;
}

@keyframes premiumButtonPulse{
    0%,100%{transform:scale(1);}
    50%{transform:scale(1.05);}
}

@media (max-width:380px){
    .mobile-premium-banner{
        padding:0 4px;
    }

    .premium-banner{
        height:56px;
    }

    .premium-banner-icon{
        width:60px;
        height:56px;
        flex-basis:60px;
    }

    .premium-banner-icon .crown{
        font-size:20px;
    }

    .premium-banner-icon small{
        font-size:7px;
    }

    .premium-banner .info{
        padding:0 5px;
    }

    .premium-banner .title{
        font-size:11px;
    }

    .premium-banner .description{
        font-size:8px;
    }

    .premium-banner-action{
        margin-left:3px;
        padding:4px 6px;
        font-size:9px;
    }
}

@media (max-width:320px){
    .premium-banner-icon{
        width:52px;
        flex-basis:52px;
    }

    .premium-banner .description{
        display:none;
    }

    .premium-banner-action{
        padding:4px 5px;
        font-size:8px;
    }
}

/* ==========================================================================
   6. Advertisement placeholder
   ========================================================================== */
.ad-placeholder{
  width:320px;
  height:31px;
  margin:10px auto;
  background:#f5f5f5; /* غيّرها لـ #f5f5f5 لو بدك تشوف المربع */
}

/* ==========================================================================
   7. Account, Premium and school administration menu items
   ========================================================================== */
/* =========================
           عنصر الحساب الأساسي
           ========================= */
        .premium-menu-item,
        .admin-menu-item {
            display: flex;
            align-items: center;
        }
        
        .account-menu-link {
            position: relative;
            display: flex !important;
            align-items: center;
            justify-content: center;
            gap: 9px;
            min-height: 44px;
            padding: 9px 12px !important;
            border-radius: 10px;
            font-weight: 700;
            line-height: 1.4;
            text-decoration: none !important;
            white-space: nowrap;
        
            transition:
                color 0.25s ease,
                background-color 0.25s ease,
                border-color 0.25s ease,
                transform 0.25s ease,
                box-shadow 0.25s ease;
        }
        
        /* نص الحساب */
        .account-menu-text {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            min-width: 0;
        }
        
        /* اسم المستخدم */
        .account-name {
            display: inline-block;
            max-width: 145px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        /* أيقونة الحساب العادي */
        .account-menu-icon {
            flex-shrink: 0;
            margin: 0 !important;
            font-size: 17px;
        }
        
        /* =========================
           إدارة المدرسة
           بنفس تصميم Premium باللون الأخضر
           ========================= */
        .account-menu-link--admin {
            color: #198754 !important;
            background: linear-gradient(
                135deg,
                rgba(25, 135, 84, 0.14),
                rgba(25, 135, 84, 0.05)
            );
            border: 1px solid rgba(25, 135, 84, 0.32);
        }

        .account-menu-link--admin:hover,
        .account-menu-link--admin:focus {
            color: #146c43 !important;
            background: linear-gradient(
                135deg,
                rgba(25, 135, 84, 0.22),
                rgba(25, 135, 84, 0.10)
            );
            border-color: rgba(25, 135, 84, 0.45);
            box-shadow: 0 5px 14px rgba(25, 135, 84, 0.17);
            transform: translateY(-1px);
        }

        .admin-title {
            font-weight: 800;
            white-space: nowrap;
        }

        .admin-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            padding: 3px 9px;
            border: 1px solid rgba(15, 92, 55, 0.18);
            border-radius: 999px;
            background: linear-gradient(135deg, #39b86f, #198754);
            color: #ffffff;
            box-shadow: 0 2px 7px rgba(25, 135, 84, 0.22);
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.2px;
            line-height: 1.4;
            white-space: nowrap;
        }

        /* =========================
           حساب Premium
           ========================= */
        .account-menu-link--premium {
            color: #a87500 !important;
        
            background: linear-gradient(
                135deg,
                rgba(255, 215, 0, 0.14),
                rgba(255, 193, 7, 0.05)
            );
        
            border: 1px solid rgba(212, 160, 23, 0.32);
        }
        
        .account-menu-link--premium:hover,
        .account-menu-link--premium:focus {
            color: #805b00 !important;
        
            background: linear-gradient(
                135deg,
                rgba(255, 215, 0, 0.22),
                rgba(255, 193, 7, 0.10)
            );
        
            border-color: rgba(184, 134, 11, 0.45);
            box-shadow: 0 5px 14px rgba(184, 134, 11, 0.17);
            transform: translateY(-1px);
        }
        
        /* التاج */
        .premium-crown {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 19px;
            line-height: 1;
            transform-origin: center;
            animation: premiumCrownPulse 2.4s ease-in-out infinite;
        }
        
        /* شارة Premium */
        .premium-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        
            padding: 3px 9px;
        
            border: 1px solid rgba(143, 99, 0, 0.18);
            border-radius: 999px;
        
            background: linear-gradient(
                135deg,
                #ffd700,
                #ffbf00
            );
        
            color: #332400;
        
            box-shadow:
                0 2px 7px rgba(212, 160, 23, 0.22);
        
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.2px;
            line-height: 1.4;
            text-transform: uppercase;
            white-space: nowrap;
        }
        
        /* =========================
           الحساب العادي
           ========================= */
        .account-menu-link--member {
            color: #198754 !important;
            background: rgba(25, 135, 84, 0.06);
            border: 1px solid rgba(25, 135, 84, 0.16);
        }
        
        .account-menu-link--member:hover,
        .account-menu-link--member:focus {
            color: #ffffff !important;
            background: #198754;
            border-color: #198754;
            box-shadow: 0 5px 14px rgba(25, 135, 84, 0.18);
            transform: translateY(-1px);
        }
        
        .account-name--normal {
            font-size: 12px;
            font-weight: 500;
            opacity: 0.78;
        }
        
        /* =========================
           الزائر
           ========================= */
        .account-menu-link--guest {
            color: #a87500 !important;
            background: rgba(255, 215, 0, 0.08);
            border: 1px dashed rgba(212, 160, 23, 0.35);
        }
        
        .account-menu-link--guest:hover,
        .account-menu-link--guest:focus {
            color: #805b00 !important;
            background: rgba(255, 215, 0, 0.16);
            border-color: rgba(184, 134, 11, 0.45);
            border-style: solid;
            box-shadow: 0 5px 14px rgba(184, 134, 11, 0.14);
            transform: translateY(-1px);
        }
        
        .premium-title {
            font-weight: 800;
            text-transform: uppercase;
        }
        
        .premium-subtitle {
            font-size: 11px;
            font-weight: 500;
            opacity: 0.75;
        }
        
        /* حركة خفيفة للتاج */
        @keyframes premiumCrownPulse {
            0%,
            100% {
                transform: scale(1) rotate(0deg);
        
                filter:
                    drop-shadow(
                        0 0 0 rgba(255, 193, 7, 0)
                    );
            }
        
            50% {
                transform: scale(1.12) rotate(-4deg);
        
                filter:
                    drop-shadow(
                        0 2px 4px rgba(255, 193, 7, 0.45)
                    );
            }
        }
        
        /* التركيز بلوحة المفاتيح */
        .account-menu-link:focus {
            outline: none;
        }
        
        .account-menu-link:focus-visible {
            outline: 3px solid rgba(25, 135, 84, 0.25);
            outline-offset: 2px;
        }
        
        /* =========================
           تصغير إدارة المدرسة وPremium على الكمبيوتر فقط
           لمنع نزول شريط التنقل إلى سطر جديد
           ========================= */
        @media (min-width: 769px) {
            .premium-menu-item .account-menu-link,
            .admin-menu-item .account-menu-link {
                min-height: 36px;
                padding: 5px 7px !important;
                gap: 5px;
                border-radius: 7px;
                font-size: 11px;
            }

            .premium-menu-item .premium-crown,
            .admin-menu-item .account-menu-icon {
                font-size: 15px;
            }

            .premium-menu-item .premium-badge,
            .admin-menu-item .admin-badge {
                padding: 2px 5px;
                font-size: 8px;
            }

            .premium-menu-item .account-name {
                max-width: 85px;
            }

            .premium-menu-item .premium-subtitle,
            .premium-menu-item .account-name--normal {
                font-size: 9px;
            }
        }
        /* =========================
           الجوال والتابلت
           لأن القائمة تستخدم navbar-expand-lg
           ========================= */
        @media (max-width: 991.98px) {
        
            .premium-menu-item,
            .admin-menu-item {
                display: block !important;
                width: 100%;
                margin: 0 !important;
                padding: 0 !important;
            }
        
            .premium-menu-item .account-menu-link,
            .admin-menu-item .account-menu-link {
                display: flex !important;
                align-items: center;
                justify-content: flex-start;
        
                width: 100%;
                min-height: auto;
        
                /* نفس بداية ومحاذاة روابط القائمة العادية */
                padding: 0.5rem 0 !important;
                margin: 0 !important;
        
                gap: 8px;
                line-height: 1.5;
                box-sizing: border-box;
            }
        
            .account-menu-text {
                display: inline-flex;
                align-items: center;
                flex-wrap: nowrap;
                gap: 4px;
            }
        
            .account-name {
                max-width: 155px;
            }
        
            .premium-badge,
            .admin-badge {
                margin-right: auto;
                margin-left: 0;
                padding: 3px 8px;
                font-size: 9px;
            }
        
            .premium-crown {
                font-size: 18px;
            }
        
            .account-menu-icon,
            .premium-crown {
                flex-shrink: 0;
                margin: 0 !important;
            }
        }
        
        /* الشاشات الصغيرة جدًا */
        @media (max-width: 380px) {
        
            .account-menu-link {
                font-size: 13px;
            }
        
            .account-name {
                max-width: 100px;
            }
        
            .premium-subtitle,
            .account-name--normal {
                display: none;
            }
        }
        
        /* تقليل الحركة حسب إعداد الجهاز */
        @media (prefers-reduced-motion: reduce) {
        
            .premium-crown {
                animation: none;
            }
        
            .account-menu-link {
                transition: none;
            }
        }
        /* ===== الكمبيوتر ===== */
        @media (min-width: 992px){
        
            /* نفس المسافة بين عناصر القائمة */
            .navbar-nav > .premium-menu-item,
            .navbar-nav > .admin-menu-item{
                margin-right: 8px;
            }
        
            /* محاذاة رأسية مع باقي عناصر القائمة */
            .navbar-nav > li{
                display:flex;
                align-items:center;
            }
        }
        
        /* ===== الجوال ===== */
        @media (max-width: 991.98px){
        
            .premium-menu-item .account-menu-link,
            .admin-menu-item .account-menu-link{
                display:flex !important;
                align-items:center;
                min-height:48px;
                padding:10px 30px !important;
            }
        
            /* يجعلها بنفس مستوى باقي العناصر */
            .premium-menu-item,
            .admin-menu-item{
                margin:0;
            }
        }

/* ==========================================================================
   8. Navbar bottom shine
   ========================================================================== */
/* ==============================
           Navbar Bottom Shine
           ============================== */
        
        .navbar{
            position: fixed !important;
            width: 100%;
            z-index: 1030;
        }
        
        /* الشريط السفلي */
        .navbar-bottom-shine{
            position:absolute;
            left:0;
            bottom:0;
            width:100%;
            height:2px;
            pointer-events:none;
            z-index:5;
        }
        
        /* اللمعة */
        .navbar-bottom-shine::after{
            content:"";
            position:absolute;
            top:0;
            left:-30%;
            width:30%;
            height:100%;
        
            background:linear-gradient(
                90deg,
                transparent,
                rgba(114,182,38,.25),
                rgba(255,255,255,.95),
                rgba(114,182,38,.25),
                transparent
            );
        
            box-shadow:0 0 8px rgba(114,182,38,.45);
        
            animation:navbarBottomShine 5s linear infinite;
        }
        
        @keyframes navbarBottomShine{
            0%{
                left:-30%;
            }
        
            100%{
                left:130%;
            }
        }

/* ==========================================================================
   9. Suggestion form answer selector
   ========================================================================== */
.answer-row select {
  text-align: center;
  text-align-last: center;

  appearance: none;

  background-position: right 10px center;
  padding-right: 25px;
}
