:root {
    /* Variables are now injected via index.php based on settings */
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hero-full {
    height: 100vh;
    width: 100%;
    background-image: url('../assets/hero_family_mosque_older.png');
    background-size: cover;
    background-position: center center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 76, 117, 0.5), rgba(15, 76, 117, 0.8));
    /* Note: We keep RGBA here for transparency, hard to var() perfectly without RGB components */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

/* Hero Glass Card */
.hero-glass-card {
    position: absolute;
    bottom: 50px;
    right: 50px;
    width: 320px;
    /* Reduced from 400px */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.0));
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    /* Slightly smaller radius */
    padding: 15px;
    /* Reduced padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    text-align: left;

    /* Animation & Interactivity */
    animation: float 6s ease-in-out infinite;
    transition: all 0.3s ease;
    cursor: pointer;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

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

.hero-glass-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.2);
}

.hero-glass-card .card-text {
    flex: 1;
    padding-right: 10px;
}

.hero-glass-card h3 {
    font-size: 1rem;
    /* Reduced from 1.2rem */
    font-weight: 700;
    margin-bottom: 3px;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-glass-card p {
    font-size: 0.8rem;
    /* Reduced from 0.9rem */
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-glass-card img {
    width: 60px;
    /* Reduced from 100px */
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* RTL Support for Hero Card */
body.rtl .hero-glass-card {
    right: auto;
    left: 50px;
    text-align: right;

    /* Since text is first in HTML, row-reverse will put it last (on left in LTR, on right in RTL)
       Wait, let's just be explicit.
       HTML: [Text] [Image]
       LTR: [Text] [Image]
       RTL (natural): [Text] [Image] flowing Right->Left. 
       Visually: [Image] [Text] if aligned right.
       Since justify-content is space-between.
       Let's just use explicit direction.
    */
    flex-direction: row-reverse;
}

body.rtl .hero-glass-card .card-text {
    padding-right: 0;
    padding-left: 10px;
}

@media (max-width: 991px) {

    /* Hide card on mobile as requested */
    .hero-glass-card {
        display: none;
    }

    .hero-content h1 {
        font-size: 2.5rem !important;
    }

    .hero-content p {
        font-size: 1rem !important;
    }
}

body {
    font-family: var(--font-en);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body.rtl {
    font-family: var(--font-ar);
    direction: rtl;
    text-align: right;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-medium);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--primary-dark);
}

/* Sections */
section {
    padding: 80px 0;
}

.stats-section {
    background-color: #eef4f8;
    background-image: linear-gradient(rgba(238, 244, 248, 0.8), rgba(238, 244, 248, 0.8)), url('../assets/islamic_pattern.png');
    background-repeat: repeat;
    background-size: 400px;
    padding: 80px 0;
}

/* Utility */
.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-20 {
    gap: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }

    .d-flex {
        flex-wrap: wrap;
    }

    /* Stats Section Specific Mobile Styles */
    .stats-section .container {
        flex-direction: column;
        gap: 30px;
    }

    .stats-section .container>div {
        width: 100%;
        /* Ensure full width for centering */
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem !important;
        /* Smaller font for phones to prevent overflow */
    }

    .hero-content p {
        font-size: 0.95rem !important;
    }
}

/* Features Section Redesign */
#features {
    background-color: var(--bg-light);
}

.features-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.feature-item-new {
    display: flex;
    align-items: center;
    min-width: 280px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid #eee;
    gap: 25px;
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card-new {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background-image: url('../assets/course_bg.png') !important;
    background-size: cover;
    background-position: center;
    color: white;
}

.course-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 76, 117, 0.9), rgba(50, 130, 184, 0.95)) !important;
    z-index: 1;
}

.course-card-new h3,
.course-card-new h2,
.course-card-new p {
    color: white !important;
    position: relative;
    z-index: 2;
}

.feature-item-new::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 150px;
    height: 150px;
    background: var(--primary-medium);
    opacity: 0.08;
    border-radius: 50%;
    z-index: 1;
}

.mihrab-icon-container,
.feature-content-new {
    position: relative;
    z-index: 2;
}

.feature-item-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Highlighted Blue Card */
.feature-item-new.highlighted-blue {
    background-color: var(--primary-dark);
    border: none;
}

.feature-item-new.highlighted-blue::after {
    background: white;
    opacity: 0.12;
}

.feature-item-new.highlighted-blue h3,
.feature-item-new.highlighted-blue p {
    color: white;
}

.feature-item-new.highlighted-blue .mihrab-icon-container {
    background: white;
    color: var(--primary-dark);
}

.feature-item-new.highlighted-blue .mihrab-icon-container::after {
    background: white;
}

.mihrab-icon-container {
    width: 90px;
    height: 130px;
    background: var(--primary-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    position: relative;
    flex-shrink: 0;
    border-radius: 45px 45px 15px 15px;
}

.mihrab-icon-container::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--primary-dark);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.feature-content-new {
    flex: 1;
}

.feature-content-new h3 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    margin-top: 0;
}

/* New Footer Design Override */
.site-footer {
    background-color: #0d3b36;
    /* Dark Teal matching image */
    color: white;
    margin: 20px;
    border-radius: 40px;
    padding: 60px;
    position: relative;
    overflow: hidden;
    text-align: left;
    /* Reset text align */
}

/* Islamic Footer Background Overlay */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/footer_bg_final.png');
    background-size: cover;
    background-position: center;
    opacity: 1;
    /* 100% opacity as requested */
    z-index: 0;
    pointer-events: none;
}



.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    /* Ensure content sits above pattern */
}

/* Ensure override */
html[lang="ar"] .site-footer {
    text-align: right;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 60px;
}

/* Brand Column */
.footer-brand {
    flex: 1;
    max-width: 500px;
    text-align: left;
}

/* RTL Support for footer brand */
html[lang="ar"] .footer-brand {
    text-align: right;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 30px;
}

.footer-heading {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 40px;
    color: white;
}

.social-section p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: white;
    color: #0d3b36;
    transform: translateY(-3px);
}

/* Links Columns */
.footer-links-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.footer-col {
    text-align: left;
}

html[lang="ar"] .footer-col {
    text-align: right;
}

.footer-col h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: white;
    padding-inline-start: 5px;
    /* RTL aware padding */
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: right;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom p {
    margin: 0;
}

/* Footer Responsive */
@media (max-width: 991px) {
    .footer-heading {
        font-size: 1.8rem;
    }

    .footer-grid {
        flex-direction: column;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 40px;
        /* Uniform padding */
        margin: 10px;
        border-radius: 20px;
    }

    .footer-grid {
        padding: 0 10px;
        /* Extra internal padding */
    }

    .footer-links-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        text-align: center;
    }
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-medium);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
    color: white;
}

.feature-content-new p {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .features-grid-new {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .feature-item-new {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .mihrab-icon-container {
        width: 80px;
        height: 110px;
        font-size: 1.8rem;
    }
}

/* Intro Section */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.intro-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 991px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }

    .intro-text h2 {
        font-size: 2rem !important;
    }
}

@media (max-width: 576px) {
    .intro-stats {
        grid-template-columns: 1fr;
    }
}

/* Benefits Section */
.benefits-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.benefit-item {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.benefit-item:last-child {
    border-bottom: none;
}

.benefit-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    opacity: 0.3;
}

.benefits-visual {
    position: relative;
    height: 600px;
}

.staggered-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.staggered-images img {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: absolute;
}

.image-top {
    top: 0;
    left: 0;
    z-index: 2;
}

.image-bottom {
    bottom: 0;
    right: 0;
    z-index: 1;
}

@media (max-width: 1199px) {
    .benefits-grid {
        gap: 50px;
    }

    .staggered-images img {
        width: 250px;
        height: 350px;
    }

    .benefits-visual {
        height: 500px;
    }
}

@media (max-width: 991px) {
    .benefits-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .benefit-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .benefits-visual {
        height: 450px;
        max-width: 500px;
        margin: 50px auto 0;
    }
}

@media (max-width: 576px) {
    .staggered-images img {
        width: 150px;
        height: 220px;
    }

    .benefits-visual {
        height: 300px;
        max-width: 320px;
        /* Ensure container isn't too wide */
    }
}

/* Header */
header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 76, 117, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

/* Register Section Wrapper */
.register-wrapper {
    background: var(--primary-dark);
    border-radius: 30px;
    padding: 60px 40px;
    /* More padding */
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 76, 117, 0.2);
}

.register-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.register-text {
    flex: 1;
    text-align: left;
    color: white;
}

/* RTL Support for register text */
html[lang="ar"] .register-text {
    text-align: right;
}

.register-img {
    width: 100%;
    height: 250px;
    /* Fixed height for crop */
    object-fit: cover;
    /* Intelligent crop */
    object-position: center 25%;
    /* Focus mainly on faces/upper body */
    margin-bottom: 20px;
    border-radius: 20px;
    display: block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.register-text h2 {
    color: white !important;
    font-size: 2.5rem;
    margin-bottom: 20px !important;
    line-height: 1.2;
}

.register-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 100%;
    /* Allow full width of column */
}

.register-form-container {
    flex: 1;
    max-width: 500px;
    /* Keep form width controlled */
}

.form-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* Mobile responsive padding for wrapper */
@media (max-width: 991px) {
    .register-content {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .register-text {
        text-align: center;
    }

    html[lang="ar"] .register-text {
        text-align: center;
    }

    .register-wrapper {
        padding: 40px 20px;
        border-radius: 20px;
    }

    .register-form-container {
        width: 100%;
    }
}

header .logo {
    font-size: 1.5rem;

    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

header nav ul {
    display: flex;
    gap: 30px;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropbtn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.lang-dropbtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    z-index: 1000;
    margin-top: 5px;
    overflow: hidden;
}

body.rtl .lang-dropdown-content {
    right: auto;
    left: 0;
}

.lang-dropdown-content a {
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    text-align: left;
}

body.rtl .lang-dropdown-content a {
    text-align: right;
}

.lang-dropdown-content a:hover {
    background-color: #f1f1f1;
}

.lang-dropdown-content.show {
    display: block;
}

/* Mobile Menu */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    header nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-dark);
        padding: 20px;
        display: none;
    }

    header nav.active {
        display: block;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
    }
}

/* Quran Ticker */
.quran-ticker-section {
    background: var(--primary-dark);
    color: white;
    padding: 10px 0;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    direction: ltr !important;
    /* Force LTR for consistent animation scroll */
}

.quran-ticker-wrapper {
    display: inline-block;
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    direction: ltr !important;
}

.quran-text {
    display: inline-block;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

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

/* Seamless Left-to-Right Scroll (Visible on Load) */
@keyframes scroll-ltr {
    0% {
        transform: translateX(-33.33%);
    }

    100% {
        transform: translateX(0);
    }
}

.quran-ticker-wrapper.ltr {
    animation: scroll-ltr 100s linear infinite;
}

/* Footer Accent */
.site-footer {
    background: var(--primary-dark);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    margin-top: 0;
}