/* 
   ==========================================================================
   Success International School - Main Design System
   Consolidated from internal CSS across all pages.
   ========================================================================== 
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

/* --- Base & Reset --- */
html, body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    background-color: #ffffff;
}

/* --- Accessibility: Screen Reader Only --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Accessibility: Focus Visible Styles --- */
/* Keyboard users see a clear focus ring; mouse users don't (using :focus-visible) */
:focus-visible {
    outline: 3px solid #f7b926;
    outline-offset: 3px;
    border-radius: 3px;
}

/* Ensure buttons and links have visible focus */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #f7b926;
    outline-offset: 3px;
}

/* Remove outline only for mouse/touch users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
    outline: none;
}



/* Arabic Font Overrides */
[dir="rtl"], [dir="rtl"] body {
    font-family: 'Cairo', sans-serif !important;
}

/* RTL Layout Adjustments */
[dir="rtl"] .ml-4 { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .mr-4 { margin-right: 0; margin-left: 1rem; }
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .flex-row-reverse { flex-direction: row; }

/* Flip icons in RTL */
[dir="rtl"] .material-symbols-outlined {
    display: inline-block;
    transform: scaleX(-1);
}

/* Specific component fixes for RTL */
[dir="rtl"] #fullMenu {
    transform: translateX(-100%);
}
[dir="rtl"] #fullMenu.visible {
    transform: translateX(0);
}

[dir="rtl"] .translate-x-full {
    transform: translateX(-100%);
}


/* Search button flip */
[dir="rtl"] .search-button svg {
    transform: scaleX(-1);
}

body.overflow-hidden {
    overflow: hidden;
}

/* --- Navigation System --- */
.menu-open #menu-line-1 {
    transform: translateY(10px) rotate(45deg);
}

.menu-open #menu-line-2 {
    transform: translateY(-10px) rotate(-45deg);
}

.menu-open #menu-text {
    opacity: 0;
    visibility: hidden;
}

.nav-dropdown-item {
    position: relative;
    overflow: hidden;
}

.nav-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: #0c2b53;
    transition: width 0.3s ease;
    z-index: -1;
}

.nav-dropdown-item:hover::before {
    width: 100%;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Watermark System --- */
.logo-watermark {
    position: absolute;
    width: 500px;
    height: 500px;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    opacity: 0.05;
}

/* --- Global Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all .8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all .8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* --- Search & Notification Animations --- */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -10px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-white {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.pulse-white {
    animation: pulse-white 2s infinite;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 185, 38, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(247, 185, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(247, 185, 38, 0);
    }
}

.pulse-gold {
    animation: pulse-gold 2s infinite;
}

/* --- Wave Transition --- */
.wave-container {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    line-height: 0;
    background: white;
    direction: ltr !important; /* Force LTR to keep wave animation consistent in RTL */
}

.wave-svg {
    position: relative;
    display: block;
    width: 200%;
    height: 100px;
    will-change: transform;
    left: 0; /* Ensure alignment to the physical left */
}

.wave-path-1 {
    animation: rolling-wave 12s linear infinite;
}

.wave-path-2 {
    animation: rolling-wave 18s linear infinite;
}

.wave-path-3 {
    animation: rolling-wave 24s linear infinite;
}

@keyframes rolling-wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- Page Components --- */

/* Index specific */
@keyframes loop-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.animate-loop-scroll {
    animation: loop-scroll 25s linear infinite;
}

.pause-on-hover:hover .animate-loop-scroll {
    animation-play-state: paused;
}

.mask-image-fade {
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.premium-hover {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(166, 25, 46, 0.3);
}

/* Gallery specific */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
}

.gallery-item {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -15px rgba(12, 43, 83, 0.3);
}

.gallery-overlay {
    background: linear-gradient(to top, rgba(12, 43, 83, 0.95), transparent 70%);
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(20px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.filter-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: #a6192e;
    z-index: -1;
    transition: height 0.3s ease;
}

.filter-btn.active {
    color: white;
    border-color: #a6192e;
}

.filter-btn.active::after {
    height: 100%;
}

/* Lightbox Styles */
#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightboxImg {
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#lightbox.active #lightboxImg {
    transform: scale(1);
}

.gallery-item.hidden {
    display: none;
}


/* Careers specific */
.job-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.job-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.15);
    border-color: #a6192e;
}

.badge-urgent {
    background: #cc2128;
    color: white;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) rotate(45deg) translateY(100%);
    transition: transform 0.6s ease;
}

.cta-button:hover::after {
    transform: translate(-50%, -50%) rotate(45deg) translateY(0);
}

/* Contact Us \& Admissions specific */
.contact-card {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.1);
}

.form-container {
    background: white;
}

.input-glow:focus {
    border-color: #a6192e;
    box-shadow: 0 0 0 4px rgba(166, 25, 46, 0.1);
    outline: none;
}

/* Branch specific (Modern/Glassmorphism) */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.animated-gradient {
    background: linear-gradient(-45deg, #0c2b53, #004b87, #a6192e, #0c2b53);
    background-size: 400% 400%;
    animation: move-bg 15s ease infinite;
}

@keyframes move-bg {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.premium-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.15);
}

/* --- Stats Section --- */
.stats-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-card:hover {
    transform: scale(1.05);
}

.counter-value {
    font-family: 'Merriweather', serif;
}

/* --- Leadership Section --- */
.leader-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.leader-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.leader-img-container {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
}

.leader-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.leader-card:hover .leader-img {
    transform: scale(1.1);
}

.leader-info {
    padding: 2rem;
}

/* --- Curriculum & Services --- */
.curriculum-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.curriculum-card:hover {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #a6192e;
}

.service-icon-box {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a6192e;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon-box {
    background: #a6192e;
    color: #ffffff;
    transform: rotate(10deg);
}

/* --- Mission Section - Advanced Design --- */
.mission-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 4rem 3rem;
    box-shadow:
        0 20px 60px -10px rgba(12, 43, 83, 0.1),
        0 4px 12px rgba(255, 255, 255, 0.4) inset;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    animation: floatMission 8s ease-in-out infinite;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 30px 80px -15px rgba(12, 43, 83, 0.15),
        0 4px 12px rgba(255, 255, 255, 0.5) inset;
    border-color: rgba(166, 25, 46, 0.2);
}

.mission-card::before {
    content: '“';
    position: absolute;
    top: -20px;
    left: 15px;
    font-family: 'Merriweather', serif;
    font-size: 200px;
    color: #0c2b53;
    opacity: 0.04;
    line-height: 1;
    pointer-events: none;
}

.mission-quote {
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mission-separator {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #f7b926, transparent);
    margin: 2rem auto;
    transition: width 1s cubic-bezier(0.645, 0.045, 0.355, 1) 0.5s;
}

.reveal.active .mission-separator {
    width: 140px;
}


@keyframes floatMission {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-15px) rotate(0.5deg);
    }

    66% {
        transform: translateY(-5px) rotate(-0.5deg);
    }
}

/* Staggered Entrance Animations */
.reveal-mission-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.reveal.active .reveal-mission-item:nth-child(1) {
    transition-delay: 0.1s;
    opacity: 1;
    transform: translateY(0);
}

.reveal.active .reveal-mission-item:nth-child(2) {
    transition-delay: 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.reveal.active .reveal-mission-item:nth-child(3) {
    transition-delay: 0.5s;
    opacity: 1;
    transform: translateY(0);
}

.reveal.active .reveal-mission-item:nth-child(4) {
    transition-delay: 0.7s;
    opacity: 1;
    transform: translateY(0);
}

.reveal.active .reveal-mission-item:nth-child(5) {
    transition-delay: 0.9s;
    opacity: 1;
    transform: translateY(0);
}

.mission-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.mission-dot:hover {
    transform: scale(1.8);
    filter: brightness(1.2);
}