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

:root {
    /* Color Palette */
    --primary-color: #046b46; /* Emerald Green */
    --primary-light: #089c67;
    --primary-dark: #023824;
    --secondary-color: #D4AF37; /* Gold */
    --secondary-light: #f5d76e;
    --bg-color: #f8fcfb; /* Off white with a hint of green */
    --bg-dark: #0F172A; /* Dark Slate Blue for dark mode or specific sections */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    
    /* Fonts */
    --font-heading: 'Amiri', serif;
    --font-body: 'Tajawal', sans-serif;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-gold: 0 4px 14px 0 rgba(212, 175, 55, 0.39);
    --transition: all 0.3s ease-in-out;
}

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

body {
    scroll-padding-top: 160px;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0; /* Padding moved to .navbar to prevent white gap below ticker */
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    /* border-bottom removed as ticker has its own */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled .navbar {
    padding: 0.5rem 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0; /* Moved from header */
    transition: padding 0.4s ease;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin-right: auto;
    margin-left: auto;
}

.nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    right: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
    left: 0;
    right: auto;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: linear-gradient(rgba(4, 107, 70, 0.8), rgba(15, 23, 42, 0.9)), url('https://images.unsplash.com/photo-1564769662543-4f9ce3ea7d0f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    color: var(--white);
    padding-top: 130px; /* Accounts for taller header + ticker */
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    padding: 2rem;
    animation: fadeIn 1.5s ease-out;
}

.hero h1 {
    font-size: 4rem;
    color: var(--secondary-light);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background-color: var(--secondary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    margin-right: 1rem;
}

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

/* Sections */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
}

/* Features/Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212,175,55,0.05) 0%, rgba(4,107,70,0.05) 100%);
    z-index: 0;
    opacity: 0;
    transition: var(--transition);
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.card p {
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* Biography Cards */
.bio-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.bio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.bio-img-container {
    height: 200px;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 4rem;
    position: relative;
}

.bio-img-container::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--white), transparent);
}

.bio-content {
    padding: 1.5rem;
}

.bio-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: inline-block;
    background: rgba(4, 107, 70, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

.bio-name {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.bio-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Filtering */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Articles Layout */
.article-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.article-main {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.article-sidebar {
    position: sticky;
    top: 160px; /* Increased from 100px to account for the ticker always being visible */
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-light);
}

.sidebar-links li {
    margin-bottom: 0.8rem;
}

.sidebar-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.sidebar-links a:hover, .sidebar-links a.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links ul a {
    color: #cbd5e1;
}

.footer-links ul a:hover {
    color: var(--secondary-color);
    padding-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonials */
.testimonial-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    position: relative;
    margin-bottom: 2rem;
    border-right: 4px solid var(--secondary-color);
}

.testimonial-card::before {
    content: '\201D';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 5rem;
    color: rgba(212, 175, 55, 0.2);
    font-family: var(--font-heading);
    line-height: 1;
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.testimonial-role {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Detailed Article / Biography Page */
.page-header {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 180px 0 80px; /* Increased top padding to avoid overlap with thick header */
    text-align: center;
    position: relative;
}

.page-header h1 {
    color: var(--secondary-light);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.article-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-top: -50px;
    position: relative;
    z-index: 10;
    line-height: 1.9;
    font-size: 1.15rem;
}

.article-content h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 2.5rem 0 1rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content blockquote {
    background: var(--bg-color);
    border-right: 4px solid var(--secondary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 8px 0 0 8px;
}

.article-content ul {
    list-style-type: disc;
    margin-right: 2rem;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Media Queries */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
        text-align: center;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

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

.dropdown .dropbtn {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    border-radius: 8px;
    top: 100%;
    right: 0;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1rem;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding-right: 20px; /* Slight indent effect */
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown:hover .dropbtn {
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .dropdown {
        display: block;
        width: 100%;
    }
    .dropdown .dropbtn {
        justify-content: center;
        padding: 10px;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background-color: var(--bg-color);
        display: none; /* Hidden by default on mobile */
    }
    .dropdown-content.show {
        display: block; /* Shown when toggled */
    }
    .dropdown-content a {
        text-align: center;
        padding: 10px;
    }
}

/* Phase 9 Additions: Search Modal & Masbaha */

/* Search Icon in Navbar */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(4, 107, 70, 0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(4, 107, 70, 0.1);
}

.action-btn:hover {
    color: var(--white);
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(4, 107, 70, 0.2);
}



/* Global Search Modal */
.search-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85); /* Dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
}

.search-modal-content {
    background-color: var(--bg-color);
    margin: 10% auto;
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-search {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-search:hover {
    color: var(--primary-dark);
}

.search-input-container {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.search-input-container i {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-left: 1rem;
}

#global-search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text-main);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    text-decoration: none;
}

.search-result-item:hover {
    background: rgba(4,107,70,0.05);
    border-color: var(--primary-color);
    transform: translateX(-5px);
}

.search-result-title {
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.search-result-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-result-type {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--secondary-light);
    color: var(--primary-dark);
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    margin-left: 0.5rem;
}

/* Masbaha Styles */
.masbaha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.masbaha-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.masbaha-glass::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(203,172,113,0.1) 0%, transparent 70%);
    z-index: -1;
}

.masbaha-counter {
    font-size: 5rem;
    font-weight: bold;
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin: 2rem 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.masbaha-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 3rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(4,107,70,0.3);
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.masbaha-btn:active {
    transform: scale(0.95) translateY(5px);
    box-shadow: 0 5px 10px rgba(4,107,70,0.3);
}

.masbaha-reset {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 2rem;
    transition: var(--transition);
}

.masbaha-reset:hover {
    color: #ef4444; /* red */
}

.masbaha-select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--primary-dark);
    background: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
    outline: none;
}


/* Phase 10: Hikma Ticker (Premium Redesign) */
.hikma-ticker-container {
    background: linear-gradient(to right, #0F172A, #023824, #0F172A);
    color: var(--secondary-light);
    padding: 0.6rem 0;
    margin-top: 0; 
    text-align: center;
    font-size: 1.35rem;
    font-family: var(--font-heading);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    
    /* Animation properties for scrolling */
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hikma-ticker-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%23D4AF37" fill-opacity="0.1"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.hikma-ticker-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.hikma-ticker-icon {
    color: var(--secondary-color);
    font-size: 1rem;
    opacity: 0.8;
}

.hikma-text {
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.5px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hikma-text.fade-out {
    opacity: 0;
    transform: translateY(-8px);
}

@media (max-width: 1024px) {
    .hikma-ticker-container {
        font-size: 1.1rem;
        padding: 0.8rem 0.5rem;
    }
}

header .container {
    width: 98%;
    max-width: 1600px;
}


/* Phase 11: Accordion (Fatwas) & Timeline (Roadmap) */

/* Accordion */
.accordion {
    background-color: var(--white);
    color: var(--primary-dark);
    cursor: pointer;
    padding: 1.5rem;
    width: 100%;
    text-align: right;
    border: none;
    outline: none;
    transition: var(--transition);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    font-weight: bold;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.accordion.active, .accordion:hover {
    background-color: rgba(4, 107, 70, 0.05);
    color: var(--primary-color);
}

.accordion::after {
    content: '\f067'; /* fa-plus */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.accordion.active::after {
    content: '\f068'; /* fa-minus */
    transform: rotate(180deg);
}

.panel {
    padding: 0 1.5rem;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    border-radius: 0 0 8px 8px;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.panel p {
    margin: 1.5rem 0;
    line-height: 1.8;
    color: var(--text-main);
}

.fatwa-source {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-dark);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    right: 50%;
    margin-right: -2px;
    border-radius: 2px;
}

.timeline-container {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-container.left {
    right: 0;
}

.timeline-container.right {
    right: 50%;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--white);
    border: 4px solid var(--secondary-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-container.right::after {
    right: calc(100% - 10px);
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--white);
    position: relative;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--primary-color);
}

.timeline-content h3 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.timeline-content .phase-tag {
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--secondary-color);
    color: var(--primary-dark);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

@media screen and (max-width: 1024px) {
    .timeline::after {
        right: 31px;
    }
    .timeline-container {
        width: 100%;
        padding-left: 25px;
        padding-right: 70px;
    }
    .timeline-container.right {
        right: 0;
    }
    .timeline-container::after {
        right: 21px;
    }
    .timeline-container.right::after {
        right: 21px;
    }
}

/* English Page specifics */
.en-body {
    direction: ltr;
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.en-body .logo {
    font-family: 'Segoe UI', serif;
}
.en-body .nav-links {
    margin-left: auto;
    margin-right: 0;
}
.en-body .nav-actions {
    margin-left: 0;
    margin-right: auto;
}


/* Phase 12: Lightbox Gallery & Audio Player */

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    aspect-ratio: 4/5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.9), transparent);
    padding: 2rem 1rem 1rem;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 2px solid var(--secondary-color);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--secondary-color);
}

.lightbox-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 2rem;
    border-radius: 30px;
    border: 1px solid var(--secondary-color);
}

/* Custom Audio Player */
.audio-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 4px solid var(--primary-color);
}

.audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audio-title {
    font-size: 1.2rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

.play-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.play-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.progress-container {
    flex-grow: 1;
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--secondary-color);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -4px;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
}

.time-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: left;
}


/* --- Professional Footer Upgrade --- */
footer {
    background-color: #050d1a;
    color: var(--white);
    padding: 4rem 0 0 0;
    margin-top: auto;
    border-top: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

footer .footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

footer .footer-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

footer .footer-logo span {
    color: var(--secondary-color);
}

footer .footer-desc {
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 400px;
    font-size: 0.95rem;
}

footer .social-links {
    display: flex;
    gap: 1rem;
}

footer .social-links a,
footer .social-links .social-link-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    transition: all 0.3s ease;
    text-decoration: none;
}

footer .social-links .social-link-placeholder {
    cursor: not-allowed;
    opacity: 0.55;
}

footer .social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

footer .footer-col h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

footer .footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

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

footer .footer-col ul li {
    margin-bottom: 0.8rem;
}

footer .footer-col ul li a {
    color: #94a3b8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

footer .footer-col ul li a i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

footer .footer-col ul li a:hover {
    color: var(--secondary-color);
    padding-right: 8px;
}

footer .footer-col ul li a:hover i {
    transform: translateX(-3px);
}

footer .footer-bottom {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.4);
    color: #cbd5e1;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

@media (max-width: 1024px) {
    footer .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}


/* Hero Pattern Overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at center, rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

.hero .hero-content {
    position: relative;
    z-index: 2;
}


/* Coming Soon Badge */
.badge-coming-soon {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--secondary-light);
  color: var(--white);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 10;
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  background: #ccc !important;
  border-color: #ccc !important;
  color: #666 !important;
}


/* Defense Categories & Cards Styles */
.category-section h2 {
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 2rem;
    border-bottom: 3px solid var(--secondary-light);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.article-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color) !important;
}

.article-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    font-size: 1.25rem;
}

.article-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.article-meta {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.article-meta span:first-child {
    background: rgba(4,107,70,0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.article-meta span:last-child {
    color: var(--text-muted);
    margin-right: 1rem;
}

.article-card a {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Library Layout Styles */
        .library-layout {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }
        @media (min-width: 992px) {
            .library-layout {
                flex-direction: row;
                align-items: flex-start;
            }
            .library-sidebar {
                flex: 0 0 250px;
                position: sticky;
                top: 100px;
            }
            .library-content {
                flex: 1;
            }
        }
        
        .library-sidebar {
            background: var(--white);
            padding: 1.5rem;
            border-radius: 12px;
            box-shadow: var(--shadow-sm);
        }
        
        .category-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .cat-btn {
            text-align: right;
            padding: 0.8rem 1rem;
            background: transparent;
            border: none;
            border-right: 3px solid transparent;
            cursor: pointer;
            font-family: var(--font-body);
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-muted);
            transition: var(--transition);
        }
        
        .cat-btn:hover, .cat-btn.active {
            background: var(--bg-color);
            border-right-color: var(--primary-color);
            color: var(--primary-color);
        }

        .book-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 1.5rem;
        }

        .book-card {
            background: var(--white);
            border-radius: 8px;
            padding: 1.5rem 1rem;
            text-align: center;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
            border: 1px solid rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
        }
        
        .book-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-md);
            border-color: var(--secondary-light);
        }
        
        .book-icon {
            font-size: 2.5rem;
            color: var(--primary-color);
            margin-bottom: 1rem;
        }
        
        .book-title {
            font-size: 1.1rem;
            color: var(--primary-dark);
            margin-bottom: 0.3rem;
            font-weight: 700;
        }
        
        .book-author {
            font-size: 0.85rem;
            color: var(--secondary-color);
            font-weight: bold;
            margin-bottom: 0.5rem;
        }
        
        .book-actions {
            margin-top: auto;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .btn-read, .btn-download {
            padding: 0.4rem;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: bold;
            border: 1px solid var(--primary-light);
            text-decoration: none;
            display: block;
        }

        .btn-read {
            background: var(--bg-color);
            color: var(--primary-color);
        }

        .btn-download {
            background: var(--primary-color);
            color: var(--white);
        }
        
        .btn-read:hover {
            background: var(--primary-light);
            color: var(--white);
        }
        
        .btn-download:hover {
            background: var(--primary-dark);
        }
    
