/* Complete Shelly Hero Section - Exact Copy with Arabic Support */

/* Import Google Fonts for better typography */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

/* Wrapper and Main Section - Shelly Style */
.wrapper {
    position: relative;
    overflow: hidden;
}

.main-section {
    background: var(--surface-0);
    position: relative;
    /* min-height يُدار في hero-unified.css (≥992: 100dvh؛ ≤991: 100dvh/svh للرئيسية) */
    min-height: 0;
    overflow: hidden;

    /* contain: layout أُزيل — كان يتعارض مع flex sizing وتجاوز min-height في بعض المتصفحات */
    contain: style;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: auto;
}


/* School Background Image - Full Coverage Option (ACTIVE) */
/* صورة الخلفية ستُحمّل ديناميكياً من JavaScript عبر API */
.school-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--neutral-300);
    /* ملاحظة: الصورة تُحمّل ديناميكياً من home-data-loader.js */
    /* Responsive Background Sizing Strategy as requested */
    background-size: cover;
    /* Mobile/Tablet: Zoomed in to cover full height */
    background-position: center center;
}

@media (min-width: 1024px) {
    .school-background {
        background-size: 105%;
        /* Desktop: Panoramic width-based scaling (User's preference) */
    }
}

.school-background {
    z-index: 0;
    opacity: 0;
    /* Updated: Start invisible for fade-in */
    /* Radial gradient mask removed to prevent bottom transparency gap */
    filter: grayscale(30%) contrast(1.2) brightness(1.1) blur(0.5px);
    /* transition: all 0.5s ease; Removed in favor of animation */
    will-change: opacity, transform;
}

/* ✨ Home Hero Fade-In Animation */
/* الشفافية النهائية تُحدد عبر CSS variable من JavaScript */
@keyframes heroImageFadeIn {
    0% {
        opacity: 0;
        transform: scale(1.15);
        /* Increased zoom for more dramatic effect */
    }

    100% {
        opacity: var(--hero-bg-opacity, 0.15);
        /* القيمة تأتي من JavaScript أو 0.15 كقيمة افتراضية */
        transform: scale(1);
        /* End at natural size */
    }
}

/* Trigger animation when loader is gone */
body:not(.is-loading) .school-background {
    /* Increased duration to 3s for cinematic feel, settles after text */
    animation: heroImageFadeIn 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 
ALTERNATIVE OPTION 2: Mirror/Reflection Effect
Replace the above .school-background with this code for mirrored effect:

.school-background {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: var(--neutral-200) url('../../images/hero_background/img_hero.jpg') no-repeat center center;
    background-size: cover;
    z-index: 0;
    opacity: 0.2;
    mask: linear-gradient(to left, 
        rgba(var(--black-rgb),1) 0%, 
        rgba(var(--black-rgb),0.8) 30%, 
        rgba(var(--black-rgb),0.5) 60%, 
        rgba(var(--black-rgb),0.2) 80%, 
        rgba(var(--black-rgb),0) 100%);
    -webkit-mask: linear-gradient(to left, 
        rgba(var(--black-rgb),1) 0%, 
        rgba(var(--black-rgb),0.8) 30%, 
        rgba(var(--black-rgb),0.5) 60%, 
        rgba(var(--black-rgb),0.2) 80%, 
        rgba(var(--black-rgb),0) 100%);
    filter: grayscale(30%) contrast(1.2) brightness(1.1) blur(0.5px);
    transition: all 0.5s ease;
}

.school-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: url('../../images/hero_background/img_hero.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.6;
    transform: scaleX(-1);
    mask: linear-gradient(to right, 
        rgba(var(--black-rgb), 1) 0%, 
        rgba(var(--black-rgb), 0.8) 30%, 
        rgba(var(--black-rgb), 0.5) 60%, 
        rgba(var(--black-rgb), 0.2) 80%, 
        rgba(var(--black-rgb), 0) 100%);
    -webkit-mask: linear-gradient(to right, 
        rgba(var(--black-rgb), 1) 0%, 
        rgba(var(--black-rgb), 0.8) 30%, 
        rgba(var(--black-rgb), 0.5) 60%, 
        rgba(var(--black-rgb), 0.2) 80%, 
        rgba(var(--black-rgb), 0) 100%);
    filter: grayscale(40%) contrast(1.1) brightness(1.0) blur(1px);
}
*/

.school-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(var(--primary-rgb), 0.15) 0%,
            rgba(var(--secondary-rgb), 0.1) 50%,
            transparent 100%);
    z-index: -5;
}

/* Enhanced text readability overlay */
.main-banner {
    position: relative;
    z-index: 2;
}

.main-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center left,
            rgba(var(--white-rgb), 0.1) 0%,
            rgba(var(--white-rgb), 0.05) 40%,
            transparent 70%);
    z-index: -1;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* Hover effect for school background - Full coverage */
/* يزيد الشفافية بـ 5% عند الهوفر */
.main-section:hover .school-background {
    opacity: calc(var(--hero-bg-opacity, 0.15) + 0.05);
    filter: grayscale(20%) contrast(1.3) brightness(1.2) blur(0.3px);
}

/* Theme-based school background tinting - الثيمات الأربعة الرسمية */
body.theme-blue .school-background::before,
body.theme-nature .school-background::before,
body.theme-night .school-background::before,
body.theme-sunset .school-background::before {
    background: linear-gradient(135deg,
            rgba(var(--primary-color-rgb), 0.12) 0%,
            rgba(var(--secondary-color-rgb), 0.08) 50%,
            transparent 100%);
}


@keyframes floatOrange {

    0%,
    100% {
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) scale(1.05);
        opacity: 0.5;
    }
}

@keyframes floatGeneric {

    0%,
    100% {
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) scale(1.05);
        opacity: 0.5;
    }
}

@keyframes floatYellow {

    0%,
    100% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 0.9;
    }

    50% {
        transform: translateY(-20px) scale(1.1) rotate(180deg);
        opacity: 0.7;
    }
}

@keyframes floatSmall {

    0%,
    100% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.7;
    }

    33% {
        transform: translateY(-15px) translateX(10px) scale(1.2);
        opacity: 0.9;
    }

    66% {
        transform: translateY(-5px) translateX(-8px) scale(0.9);
        opacity: 0.5;
    }
}

@keyframes floatTiny {

    0%,
    100% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-12px) scale(1.3) rotate(360deg);
        opacity: 0.8;
    }
}

/* Hover effects for circles */
.main-section::before:hover,
.main-section::after:hover {
    transform: scale(1.2);
    opacity: 0.9;
}

/* Main Banner Section */
.main-banner {
    padding: 0;
    position: relative;
    z-index: 2;
}

/* Banner Background Decorations */
.main-banner::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.015) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -5;
    animation: floatDecoration 8s ease-in-out infinite;
}

.main-banner::after {
    content: '';
    position: absolute;
    bottom: 15%;
    left: 5%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.01) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -5;
    animation: floatDecoration 6s ease-in-out infinite reverse;
}

@keyframes floatDecoration {

    0%,
    100% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 0.02;
    }

    25% {
        transform: translateY(-15px) scale(1.02) rotate(1deg);
        opacity: 0.04;
    }

    50% {
        transform: translateY(-25px) scale(1.05) rotate(0deg);
        opacity: 0.05;
    }

    75% {
        transform: translateY(-10px) scale(1.03) rotate(-1deg);
        opacity: 0.03;
    }
}

/* Banner Text Styles - Restored Original */
.main-banner .banner-text {
    position: relative;
    z-index: 100;
    padding: 0;
    margin-top: 0;
}

.main-banner .banner-text .hero-badge {
    margin-bottom: var(--hero-badge-margin-bottom);
}

.main-banner .banner-text.text-center {
    text-align: center;
}

/* Hero Badge - Main Page Only */
.main-banner .hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
    border: none;
    min-width: 180px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 10;
}

.main-banner .hero-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.4);
}

.main-banner .hero-badge i {
    font-size: 1.1rem;
    color: var(--text-white);
}

.main-banner .hero-badge span {
    color: var(--text-white);
}

.main-banner .banner-text>h2 {
    color: var(--text-primary);
    font-size: var(--font-size-5xl);
    line-height: var(--hero-title-line-height);
    font-weight: var(--hero-title-font-weight);
    margin-bottom: var(--hero-title-margin-bottom);
    font-family: 'Tajawal', 'Poppins', sans-serif;
    text-shadow: none;
}

.main-banner .banner-text>h2 span {
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.main-banner .banner-text>h2 span:hover {
    /* No hover effect on title for consistency/clean look */
    transform: none;
    filter: none;
}

.main-banner .banner-text p {
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 30px;
    font-family: 'Tajawal', 'Open Sans', sans-serif;
    font-weight: 500;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.hero-btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 8px 25px rgba(var(--black-rgb), 0.15);
    font-family: 'Tajawal', 'Poppins', sans-serif;
}

.hero-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border: none;
}

.hero-btn.primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.4);
}

.hero-btn.secondary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border: none;
}

.hero-btn.secondary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.4);
}

/* Additional School Info Section Styles */
.school-info-extra {
    margin: 60px 0;
    position: relative;
    z-index: 2;
}

.info-card {
    background: var(--surface-0);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(var(--black-rgb), 0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(var(--primary-color-rgb), 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(var(--black-rgb), 0.15);
}

.info-card .info-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
}

.info-card:hover .info-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.4);
}

.info-card .info-icon i {
    font-size: 28px;
    color: var(--text-white);
    transition: all 0.3s ease;
}

.info-card h4 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    font-family: 'Tajawal', 'Poppins', sans-serif;
    text-align: center;
}

.info-card p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 25px;
    text-align: center;
}

.social-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
}

.activity-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
}

.section-title {
    margin-bottom: 70px;
}

.section-title h2 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-family: 'Tajawal', 'Poppins', sans-serif;
}

.section-title h2 span {
    color: var(--primary-color);
}

.section-title p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* About Columns */
.about-sec {
    margin-bottom: 80px;
}

.abt-col {
    text-align: center;
    padding: 40px 20px;
    background: rgba(var(--white-rgb), 0.8);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(var(--black-rgb), 0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.abt-col:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(var(--black-rgb), 0.15);
    background: rgba(var(--white-rgb), 0.95);
}

.abt-col .abt-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
}

.abt-col:hover .abt-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.4);
}

.abt-col .abt-icon i {
    font-size: 32px;
    color: var(--text-white);
    transition: all 0.3s ease;
}

.abt-col:hover .abt-icon i {
    transform: scale(1.1);
}

.abt-col h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-family: 'Tajawal', 'Poppins', sans-serif;
}

.abt-col p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Masonry Gallery - Exact Shelly Layout with Enhanced Effects */
.abt-img {
    margin-top: 50px;
    overflow: hidden;
}

.masonary {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.masonary li {
    padding: 0 9.5px;
    margin-bottom: 19px;
    transition: all 0.4s ease;
    float: left;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.masonary li:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(var(--black-rgb), 0.2);
    z-index: 10;
}

.masonary li a {
    display: block;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

/* Light sweep effect - مثل Student Care */
.masonary li a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(var(--white-rgb), 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
    pointer-events: none;
    border-radius: 20px;
}

.masonary li:hover a::after {
    transform: translateX(100%);
}

.masonary li img {
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
    height: 100%;
    transition: all 0.4s ease;
    display: block;
}

.masonary li:hover img {
    transform: none;
}

/* Exact Shelly Masonry Sizes */
.masonary li.width1 {
    width: 199px;
    height: 210px;
    margin-top: 190px;
}

.masonary li.width2 {
    width: 297px;
    height: 360px;
}

.masonary li.width3 {
    width: 197px;
    height: 290px;
    margin-top: 20px;
}

.masonary li.width4 {
    width: 180px;
    margin-top: 60px;
}

.masonary li.width4 img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.masonary li.width5 {
    width: 297px;
    height: 192px;
    padding-left: 30px;
}

.masonary li.width6 {
    width: 198px;
    height: 240px;
    margin-top: -45px;
}

.masonary li.width7 {
    width: 198px;
    height: 240px;
    margin-top: 0;
}

.masonary li.width8 {
    width: 80px;
    height: 64px;
    margin-top: 0;
}

.masonary li.width8 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.masonary li.width9 {
    width: 199px;
    height: 190px;
}

.masonary li.width10 {
    width: 99px;
    height: 72px;
}

.masonary li.width10 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* WOW.js Animation Support */
.wow {
    visibility: hidden;
}

.wow.animated {
    visibility: visible;
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-100%, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInLeft {
    animation-name: fadeInLeft;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 100%, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInUp {
    animation-name: fadeInUp;
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }

    50% {
        opacity: 1;
    }
}

.zoomIn {
    animation-name: zoomIn;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-section .main-title {
        font-size: 120px;
    }

    .section-title h2 {
        font-size: 36px;
    }

    .abt-col {
        margin-bottom: 30px;
    }
}

/* about-us-section: position relative ضروري لأن الدوائر العائمة داخله position:absolute */
.about-us-section {
    position: relative;
    overflow: hidden;
}

@media (max-width: 991px) {
    .about-us-section {
        padding-block: clamp(1.25rem, 4vw, 1.75rem);
        padding-inline: 0;
    }
}

@media (max-width: 768px) {
    /* لا يُطبَّق على #hero-section — هيرو الرئيسية يُضبط في hero-unified (تعارض يسبب فراغاً رأسياً) */
    .main-section:not(#hero-section) {
        min-height: 80dvh;
        /* ⚡ Changed from 80vh */
    }

    /* .main-banner: padding الرأسي يُحسب داخل .banner-text فقط (hero-unified) — لا padding مباشر على الغلاف */

    .main-banner .banner-text>h2 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .main-banner .banner-text p {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    /* School background responsive adjustments - Full coverage */
    .school-background {
        /* استخدام CSS variable مع تقليل طفيف للموبايل */
        opacity: var(--hero-bg-opacity, 0.1);
        filter: grayscale(40%) contrast(1.1) brightness(1.2) blur(1px);
    }

    .section-title h2 {
        font-size: 28px;
    }

    .section-title {
        margin-bottom: 40px;
    }

    .about-sec {
        margin-bottom: 40px;
    }

    /* Responsive for new about section circles */
    .about-section-circle-1 {
        width: 100px;
        height: 100px;
    }

    .about-section-circle-2 {
        width: 80px;
        height: 80px;
    }

    .about-section-circle-3 {
        width: 60px;
        height: 60px;
    }

    .about-section-circle-4 {
        width: 50px;
        height: 50px;
    }

    /* Responsive for school info extra */
    .school-info-extra {
        margin: 40px 0;
    }

    .info-card {
        padding: 30px 20px;
        margin-bottom: 30px;
    }

    .info-card h4 {
        font-size: 20px;
    }

    .info-card p {
        font-size: 14px;
    }

    .social-stats {
        gap: 15px;
    }

    .activity-tags {
        gap: 8px;
    }

    .masonary {
        justify-content: center;
    }

    .masonary li.width1,
    .masonary li.width2,
    .masonary li.width3,
    .masonary li.width4,
    .masonary li.width5,
    .masonary li.width6,
    /* Media query specificity is sufficient for responsive overrides */
    .masonary li.width7,
    .masonary li.width8,
    .masonary li.width9,
    .masonary li.width10 {
        width: 150px;
        height: 150px;
        margin-top: 0;
        padding-left: 9.5px;
    }

    .masonary li.width4 img {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 576px) {
    .main-banner .banner-text>h2 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .main-banner .banner-text p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    /* School background for small mobile - Full coverage */
    .school-background {
        /* استخدام CSS variable مع تقليل طفيف للموبايل الصغير */
        opacity: var(--hero-bg-opacity, 0.08);
        filter: grayscale(50%) contrast(1.0) brightness(1.3) blur(1.5px);
    }

    .hero-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .abt-col {
        padding: 30px 15px;
    }

    .abt-col .abt-icon {
        width: 60px;
        height: 60px;
    }

    .abt-col .abt-icon i {
        font-size: 24px;
    }

    .abt-col h3 {
        font-size: 18px;
    }

    /* Further responsive for new about section circles */
    .about-section-circle-1 {
        width: 80px;
        height: 80px;
    }

    .about-section-circle-2 {
        width: 60px;
        height: 60px;
    }

    .about-section-circle-3 {
        width: 50px;
        height: 50px;
    }

    .about-section-circle-4 {
        width: 40px;
        height: 40px;
    }

    /* Further responsive adjustments for small mobile */
    .school-info-extra {
        margin: 30px 0;
    }

    .info-card {
        padding: 25px 15px;
    }

    .info-card .info-icon {
        width: 60px;
        height: 60px;
    }

    .info-card .info-icon i {
        font-size: 24px;
    }

    .info-card h4 {
        font-size: 18px;
    }

    .info-card p {
        font-size: 13px;
        line-height: 1.6;
    }

    .social-stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .masonary {
        justify-content: center;
    }

    /* Mobile responsive - media query provides specificity */
    .masonary li.width1,
    .masonary li.width2,
    .masonary li.width3,
    .masonary li.width4,
    .masonary li.width5,
    .masonary li.width6,
    .masonary li.width7,
    .masonary li.width8,
    .masonary li.width9,
    .masonary li.width10 {
        width: 120px;
        height: 120px;
        margin-top: 0;
        padding: 0 5px;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .main-banner .banner-text {
    padding-right: 0;
    padding-left: 20px;
}

[dir="rtl"] .main-banner .banner-text .search-form input {
    padding: 0 60px 0 25px;
}

[dir="rtl"] .main-banner .banner-text .search-form button {
    left: auto;
    right: 20px;
}

/* Theme Integration - Ultra Transparent Background Circles - الثيمات الأربعة الرسمية */
body.theme-blue .main-section::before,
body.theme-nature .main-section::before,
body.theme-night .main-section::before,
body.theme-sunset .main-section::before {
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.03) 0%, rgba(var(--primary-color-rgb), 0.01) 50%, transparent 70%);
    z-index: -10;
}

body.theme-blue .main-section::after,
body.theme-nature .main-section::after,
body.theme-night .main-section::after,
body.theme-sunset .main-section::after {
    background: radial-gradient(circle, rgba(var(--secondary-color-rgb), 0.04) 0%, rgba(var(--secondary-color-rgb), 0.015) 50%, transparent 70%);
    z-index: -10;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER POSITIONING
   Note: Keeping position: fixed without !important
   The selector specificity is sufficient
   ═══════════════════════════════════════════════════════════════ */
.main-header {
    position: fixed;
}

/* تم حذف تعريفات النافيجيشن القديمة - يتم استخدام modern-navbar.css */

/* تم حذف تعريفات زر القائمة القديم - يتم استخدام modern-navbar.css */

/* تم حذف تعريفات النافيجيشن المحمول القديمة - يتم استخدام modern-navbar.css */

/* تم حذف media queries القديمة للنافيجيشن */

/* End of Complete Shelly Hero Styles */

/* Responsive Design */
@media (max-width: 992px) {
    .main-banner .banner-text>h2 {
        font-size: 2.8rem;
    }

    .main-banner .banner-text p {
        font-size: 1rem;
    }

    .main-banner .main-title {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    /* .main-banner يوجد فقط في index — المسافات الرأسية من hero-unified على #home #hero-section */

    .main-banner .banner-text {
        text-align: center;
        padding-right: 0;
        margin-bottom: 30px;
    }

    .main-banner .banner-text>h2 {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .main-banner .banner-text p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .main-banner .banner-text .search-form {
        max-width: 100%;
    }

    .main-banner .main-title {
        font-size: 4rem;
        bottom: -10px;
    }

    .main-banner .elements-bg {
        width: 200px;
        height: 200px;
        top: -30px;
        right: -30px;
    }
}

@media (max-width: 576px) {

    /*
     * تحسين الحاوية للموبايل — استثناء #hero-section (الرئيسية):
     * ارتفاع هيرو الرئيسية يُضبط في hero-unified (min-height منطقة الرؤية + توسيط).
     */
    .main-section:not(#hero-section) {
        min-height: 100dvh;
        /* ⚡ Changed from 100vh */
        padding: 0;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }

    .main-banner {
        /* padding الرأسي يُحسب في .banner-text عبر hero-unified — لا padding مباشر هنا */
        padding: 0;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        width: 100%;
    }

    .main-banner .container {
        width: 100%;
        padding: 0 1rem;
    }

    .main-banner .banner-text {
        padding: 0 0 1rem;
        text-align: center;
        width: 100%;
    }

    /* تحسين الشارة للموبايل */
    .main-banner .hero-badge {
        font-size: 0.85rem;
        padding: 0.75rem 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 25px;
    }

    .main-banner .banner-text>h2 {
        font-size: 1.6rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        text-align: center;
        padding: 0 0.5rem;
    }

    .main-banner .banner-text p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        text-align: center;
        max-width: 100%;
    }

    .main-banner .banner-text .search-form input {
        height: 50px;
        font-size: 0.9rem;
        padding: 0 55px 0 20px;
    }

    .main-banner .banner-text .search-form button {
        width: 30px;
        height: 30px;
        right: 15px;
    }

    /* تحسين الأزرار للموبايل */
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        width: 100%;
        padding: 0 1rem;
    }

    .hero-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        text-align: center;
        border-radius: 25px;
        max-width: 280px;
        margin: 0 auto;
    }

    /* تحسين العناصر العائمة للموبايل */
    .main-floating-circle-1,
    .main-floating-circle-2,
    .main-floating-circle-3,
    .main-floating-circle-4,
    .main-floating-circle-5 {
        opacity: 0.2;
        z-index: 1;
    }

    .main-floating-circle-1 {
        width: 40px;
        height: 40px;
        top: 15%;
        right: 2%;
        transform: translateX(-50%);
    }

    .main-floating-circle-2 {
        width: 30px;
        height: 30px;
        top: 25%;
        left: 2%;
        transform: translateX(50%);
    }

    .main-floating-circle-3 {
        width: 50px;
        height: 50px;
        bottom: 35%;
        right: 3%;
        transform: translateX(-50%);
    }

    .main-floating-circle-4 {
        width: 35px;
        height: 35px;
        bottom: 25%;
        left: 3%;
        transform: translateX(50%);
    }

    .main-floating-circle-5 {
        width: 25px;
        height: 25px;
        top: 65%;
        right: 5%;
        transform: translateX(-50%);
    }
}

/* تحسينات إضافية للهواتف الصغيرة جداً */
@media (max-width: 375px) {
    .main-banner .banner-text>h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        padding: 0 0.25rem;
    }

    .main-banner .banner-text p {
        font-size: 0.85rem;
        padding: 0 0.75rem;
        line-height: 1.5;
    }

    .main-banner .hero-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }

    .hero-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
        max-width: 260px;
    }

    .main-banner .container {
        padding: 0 0.75rem;
    }
}

/* Theme Integration - الثيمات الأربعة الرسمية */
body.theme-blue .main-banner .banner-text>h2 span,
body.theme-nature .main-banner .banner-text>h2 span,
body.theme-night .main-banner .banner-text>h2 span,
body.theme-sunset .main-banner .banner-text>h2 span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Additional Enhancements */
.main-banner .container {
    position: relative;
    z-index: 2;
}

/* Smooth scroll behavior */
html {
    /* scroll-behavior: smooth; <-- REMOVED */
}

/* Loading animation for images */
.main-banner .banner-img img {
    opacity: 0;
    animation: fadeInImage 1s ease-out 0.5s both;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced hover effects */
.main-banner .banner-text .search-form:hover input {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.15);
}

/* Focus accessibility */
.main-banner .banner-text .search-form button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.main-banner .banner-text .search-form input:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* Additional Floating Circles - الثيمات الجديدة الموحدة */
/* Main Hero Section Floating Circles */
.main-floating-circle-1 {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.12) 0%, rgba(var(--primary-color-rgb), 0.04) 70%, transparent 100%);
    top: 20%;
    left: 5%;
    z-index: 1;
    animation: floatGeneric 10s ease-in-out infinite;
    transition: all 0.3s ease;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Theme Colored Circle - Top Right */
.main-floating-circle-2 {
    position: absolute;
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg,
            rgba(var(--primary-rgb), 0.05),
            rgba(var(--secondary-rgb), 0.02));
    border-radius: 50%;
    top: 15%;
    right: 10%;
    animation: floatOrange 8s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

/* Theme Colored Circle - Bottom Left */
.main-floating-circle-3 {
    position: absolute;
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg,
            rgba(var(--secondary-rgb), 0.05),
            rgba(var(--primary-rgb), 0.02));
    border-radius: 50%;
    bottom: 20%;
    left: 15%;
    animation: floatYellow 10s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

/* Theme Colored Circle - Middle Right */
.main-floating-circle-4 {
    position: absolute;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg,
            rgba(var(--primary-rgb), 0.4),
            rgba(var(--secondary-rgb), 0.2));
    border-radius: 50%;
    top: 50%;
    left: 5%;
    animation: floatSmall 11s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

/* Theme Colored Circle - Top Left */
.main-floating-circle-5 {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg,
            rgba(var(--secondary-rgb), 0.3),
            rgba(var(--primary-rgb), 0.1));
    border-radius: 50%;
    top: 25%;
    left: 8%;
    animation: floatTiny 9s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

/* Welcome Section Floating Circles */
.welcome-floating-circle-1 {
    position: absolute;
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg,
            rgba(var(--primary-color-rgb), 0.06),
            rgba(var(--secondary-color-rgb), 0.04));
    border-radius: 50%;
    top: 10%;
    right: 5%;
    animation: floatYellow 17s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

.welcome-floating-circle-2 {
    position: absolute;
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg,
            rgba(var(--secondary-color-rgb), 0.06),
            rgba(var(--primary-color-rgb), 0.04));
    border-radius: 50%;
    bottom: 20%;
    left: 8%;
    animation: floatSmall 19s ease-in-out infinite;
    z-index: -5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

/* Hover effects for all floating circles */
.main-floating-circle-1:hover,
.main-floating-circle-2:hover,
.main-floating-circle-3:hover,
.main-floating-circle-4:hover,
.main-floating-circle-5:hover,
.welcome-floating-circle-1:hover,
.welcome-floating-circle-2:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* Disable heavy floating animations for users who prefer reduced motion or touch devices */
@media (prefers-reduced-motion: reduce) {
  .main-floating-circle-1,
  .main-floating-circle-2,
  .main-floating-circle-3,
  .main-floating-circle-4,
  .main-floating-circle-5,
  .welcome-floating-circle-1,
  .welcome-floating-circle-2,
  .main-banner::before,
  .main-banner::after {
    animation: none;
  }
}

/* Responsive design for floating circles */
@media (max-width: 768px) {

    .main-floating-circle-1,
    .main-floating-circle-2,
    .main-floating-circle-3,
    .welcome-floating-circle-1,
    .welcome-floating-circle-2 {
        width: 80px;
        height: 80px;
    }

    .main-floating-circle-4,
    .main-floating-circle-5 {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {

    .main-floating-circle-1,
    .main-floating-circle-2,
    .main-floating-circle-3,
    .welcome-floating-circle-1,
    .welcome-floating-circle-2 {
        width: 60px;
        height: 60px;
    }

    .main-floating-circle-4,
    .main-floating-circle-5 {
        width: 40px;
        height: 40px;
    }
}

/* Simple background circles - ultra transparent */
.background-circles-only {
    pointer-events: none;
    user-select: none;
}

/* Ensure all content is always in front of circles */
.main-banner,
.main-banner .banner-text,
.main-banner .banner-text *,
.hero-badge,
.hero-title,
.hero-description,
.hero-buttons,
.btn,
.stats-container,
.welcome-section,
.welcome-section *,
.feature-card,
.masonry-gallery,
.masonry-gallery *,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
a,
button,
.container,
/* ═══════════════════════════════════════════════════════════════
   Z-INDEX LAYERING
   Ensure proper stacking context for content vs decorations
   ═══════════════════════════════════════════════════════════════ */
.row,
[class*="col-"] {
    position: relative;
    z-index: 10;
}

/* Force all floating circles to stay in background */
[class*="floating-circle"],
[class*="section-circle"],
.main-section::before,
.main-section::after,
.main-banner::before,
.main-banner::after {
    z-index: -10;
    pointer-events: none;
}

/* End of Shelly Hero Styles */