/* ========== ROOT VARIABLES ========== */
:root {
    --primary: #1e3a5f;
    --secondary: #2c5aa0;
    --accent: #4a90e2;
    --gold: #d4af37;
    --light: #f8fafc;
    --dark: #0f172a;      /* Deep Dark Background */
    --card-bg: #1e293b;   /* Card Background */
    --gray: #94a3b8;      /* Light Gray Text */
    --text-main: #e2e8f0; /* Main Text Color */
    --gradient: linear-gradient(135deg, #1e3a5f 0%, #4a90e2 100%);
}

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background-color: var(--dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: 70px;
}

/* ========== PAGE CONTAINER ========== */
.page-content {
    min-height: 100vh;
    padding-top: 85px;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== HERO & SECTIONS ===== */
.hero-badge {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--gold);
    color: var(--gold);
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.quran-verse {
    font-family: 'Kufam', serif;
    font-size: 2rem;
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-right: 4px solid var(--gold);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    font-weight: 800;
}
.hero {
    position: relative;
    min-height: 90vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
    width: 100%;
    padding: 0;
    margin: 0;
}

.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.4) 0%, rgba(44, 90, 160, 0.3) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    z-index: 3;
}

.carousel-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.carousel-dot.active {
    background: var(--gold);
    width: 30px;
    border-radius: 6px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.carousel-arrow:hover {
    background: rgba(212, 175, 55, 0.4);
}

.carousel-arrow.prev {
    left: 2rem;
}

.carousel-arrow.next {
    right: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    padding: 0 2rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-family: 'Amiri', serif;
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-title-img {
    display: block;
    margin: 0 auto 1.25rem auto;
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    font-weight: 400;
}

.quran-verse {
    font-family: 'Kufam', serif;
    font-size: 2rem;
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-right: 4px solid var(--gold);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    font-weight: 800;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-block;
}

.btn-primary {
    background: var(--gold);
    color: #0f172a;
    font-weight: bold;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

/* ========== SECTIONS ========== */
section {
    padding: 6rem 2rem;
    background: transparent !important;
    width: 100%;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page { 
    background: var(--dark);
}

.section-tag {
    display: inline-block;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Kufam', serif; /* Matching the new font style */
    color: #ffffff;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.section-desc {
    color: var(--gray);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ========== CARDS ========== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    color: var(--text-main);
    transition: all 0.3s ease;
    padding: 2.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: var(--gold); /* Gold border on hover */
}

.card-icon {
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.1);
    width: fit-content;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.card h3 {
    color: #ffffff;
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card p {
    color: var(--gray);
    line-height: 1.8;
}

/* Special Maali/Olama Cards */
.maali-card {
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* ========== FEATURES ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    display: none;
}

/* ========== STATS ========== */
.stats-section {
    background: #1e293b; /* Darker stripe */
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    text-align: center;
}

.stat-number { 
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label { 
    color: var(--gray);
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ========== TIMELINE ========== */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 50%;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    transform: translateX(50%);
    border: 4px solid white;
    box-shadow: 0 0 0 4px var(--accent);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.timeline-date {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ========== POETRY STYLES ========== */
.poetry-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1) !important;
    color: var(--gold) !important;
    border-color: var(--gold) !important;
    border: 2px solid var(--gold);
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-weight: 600;
    animation: fadeInDown 1s ease;
}

.poetry-container {
    background: linear-gradient(rgba(30, 41, 59, 0.9), rgba(30, 41, 59, 0.9)), url('poet.webp');
    background-size: cover;
    border-right: 5px solid var(--gold);
    padding: 4rem 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeInUp 1.2s ease;
}

.verse-line {
    color: #e2e8f0;
    position: relative;
    transition: all 0.3s ease;
}

.poetry-verse {
    font-family: 'Kufam', serif;
    font-weight: 800;
}

.bait {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInVerse 0.8s ease forwards;
    align-items: center;
    line-height: 2.8;
}

.bait p {
    margin: 0;
    flex: 0 1 auto;
    line-height: 2.8;
}

/* Video Section */
.video-poetry-container {
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.5s ease;
}

.video-poetry-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2) !important;
}

.video-poetry-container:hover video {
    transform: scale(1.02);
}

.play-button {
    animation: pulsePlay 2s ease-in-out infinite;
}

.play-button:hover {
    transform: scale(1.1);
    background: var(--gold) !important;
}

#playOverlay {
    backdrop-filter: blur(5px);
}

@keyframes pulsePlay {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(212, 175, 55, 0.6);
    }
}

/* ========== FOOTER ========== */
footer {
    background: var(--dark);
    color: white;
    padding: 4rem 2rem 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1300px;
    margin: 0 auto 3rem;
}

.footer-section h4 {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* ========== ANIMATIONS ========== */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.05);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.05);
    }
    56% {
        transform: scale(1);
    }
}

@keyframes pulseCard {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 12px 40px rgba(30, 58, 95, 0.15);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 16px 50px rgba(212, 175, 55, 0.3);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInVerse {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes smoothScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

.maali-card {
    animation: pulseCard 2.5s ease-in-out infinite;
}

.maali-card:hover {
    animation: smoothScale 2s ease-in-out infinite !important;
}

/* ========== SEARCH HIGHLIGHT ========== */
.search-highlight {
    background-color: var(--gold);
    color: var(--dark);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* ========== DARK MODE OVERRIDES ========== */
/* Specific fix for the inline styles in original HTML that forced white background */
[style*="background: #ffffff"], 
[style*="background: white"] {
    background: var(--dark) !important;
}

[style*="color: var(--primary)"], 
[style*="color: #1e3a5f"] {
    color: var(--light) !important; 
}

/* Fix for dark text inside mitaq box */
#mitaq p { 
    color: var(--gray) !important; 
}

#mitaq p[style*="color: var(--dark)"] { 
    color: #fff !important; 
}

/* Inputs */
#searchInput {
    background: rgba(255, 255, 255, 0) !important;
    border: 0px solid rgba(255,255,255,0.1) !important;
    color: white !important;
}

#searchInput::placeholder {
    color: var(--gray) !important;
}

#searchBtn { 
    color: var(--gold) !important; 
}

/* === IFRAME FOOTER === */
#footerFrame {
    width: 100% !important;
    border: none !important;
    display: block !important;
    margin-top: 2rem !important;
    padding: 0 !important;
    min-height: unset !important;
    height: auto !important;
}


.scroll-container {
    display: flex;
    overflow-x: auto;
    padding: 2rem 2rem 4rem 2rem;
    gap: 1.5rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #1e3a5f;
    max-width: 100%;
    margin: 0 auto;
}

.scroll-container::-webkit-scrollbar {
    height: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

.assoc-container {
    padding: 1.5rem 1rem 3rem 1rem;
    gap: 1.5rem;
}

.game-card {
    flex: 0 0 220px;
    height: 380px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    background: #1e293b;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3);
    border-color: var(--gold);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4) grayscale(80%);
    transition: all 0.6s ease;
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 100%);
    z-index: 2;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 3;
    color: white;
}

.card-title {
    font-family: 'Kufam', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.card-info {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.action-btn {
    background: var(--gold);
    color: #0f172a;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.action-btn:hover {
    background: #fff;
    transform: scale(1.05);
}
.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
    order: 4;
}

.nav-menu li a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: block;
    white-space: nowrap;
}
