/* ============================================
   Ibn Hashim Institute - Main Stylesheet
   Extracted from original index.html for reusability
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --accent: #7aa2ff;
    --accent-glow: rgba(122, 162, 255, 0.4);
    --accent-primary: #5a90ff;
    --accent-primary-rgb: 90, 144, 255;
    --bg: #05070d;
    --glass: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.08);
    --text: #eaeaea;
    --text-dim: rgba(255,255,255,0.7);
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", system_ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* App Content Fade-in Sequence */
#app-content {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}
#app-content.visible {
    opacity: 1;
}

/* ===== MODAL & LIST ANIMATIONS ===== */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-animate-in {
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== FUTURISTIC BACKGROUND ===== */
#bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: 
        radial-gradient(circle at 15% 20%, #0a1628, transparent 45%),
        radial-gradient(circle at 85% 30%, #111827, transparent 40%),
        radial-gradient(circle at 50% 85%, #0a0f1c, transparent 55%),
        linear-gradient(180deg, #05070d 0%, #0a0f1c 100%);
}

canvas#particles {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

/* ===== CURSOR LIGHT ===== */
.cursor-light {
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(122,162,255,0.07), transparent 65%);
    transform: translate(-50%, -50%);
    z-index: 9999;
    mix-blend-mode: screen;
    transition: width 0.2s, height 0.2s;
}

/* ===== GLASSMORPHISM ===== */
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.23, 1.0, 0.32, 1);
}

.glass:hover {
    background: rgba(255,255,255,0.075);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* ===== NAV ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5,7,13,0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

/* Special golden/beige buttons (Clarifying Doubts & About) */
.nav-link.special {
    color: #eed3ab;
    font-weight: 600;
    border: 2px solid rgba(238, 211, 171, 0.3);
}

.nav-link.special2 {
    color: #eed3ab;
    font-weight: 600;
}

.nav-link.special:hover {
    background: rgba(238, 211, 171, 0.15);
    border-color: #eed3ab;
    color: #ffe7c3;
    box-shadow: 0 0 20px rgba(122, 162, 255, 0.5);
    transform: translateY(-1px);
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: rgba(8, 11, 20, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 8px;
    backdrop-filter: blur(30px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.23, 1.0, 0.32, 1);
    z-index: 1001;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: block;
    padding: 11px 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.dropdown a:hover {
    background: rgba(122,162,255,0.12);
    color: white;
    padding-left: 22px;
    box-shadow: 0 0 10px rgba(122, 162, 255, 0.2);
}

.dropdown-header {
    padding: 8px 16px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 80px;
    position: relative;
    text-align: center;
}

.hero-content {
    max-width: 820px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(122,162,255,0.1);
    border: 1px solid rgba(122,162,255,0.3);
    color: #a3c0ff;
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.hero h1 {
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(42px, 7vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -3.5px;
    margin-bottom: 20px;
}

.hero h1 .accent {
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.hero p {
    font-size: 20px;
    max-width: 620px;
    margin: 0 auto 36px;
    color: var(--text-dim);
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, #7aa2ff, #5c8cff);
    color: #05070d;
    box-shadow: 0 10px 30px rgba(122,162,255,0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(122,162,255,0.45);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.4);
}

/* ===== STATS ===== */
.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 70px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ===== SECTION ===== */
.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 32px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -1px;
}

.section-header .subtitle {
    color: var(--text-dim);
    font-size: 15px;
}

/* ===== VIDEO GRID ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(122,162,255,0.3);
    box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0f172a, #1e2937);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(122,162,255,0.15), transparent 60%);
}

.play-btn {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.play-btn svg {
    width: 26px;
    height: 26px;
    margin-left: 4px;
    fill: #05070d;
}

.video-card:hover .play-btn {
    transform: scale(1.1);
}

.video-info {
    padding: 20px;
}

.video-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(122,162,255,0.15);
    color: #a3c0ff;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.video-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== CATEGORY CARDS ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.category-card {
    padding: 28px 24px;
    text-align: left;
    cursor: pointer;
}

.category-card h3 {
    font-size: 19px;
    margin-bottom: 8px;
    font-weight: 600;
}

.category-card p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.category-card .count {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    pointer-events: none;
    
    opacity: 0;
    transition: display 0.4s allow-discrete, opacity 0.4s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    
    @starting-style {
        opacity: 0;
    }
}

.modal-content {
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0a0f1c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    overflow: hidden;
    
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    view-transition-name: modal-card;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
    
    @starting-style {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }
}

.modal-header {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
}

@media (max-width: 500px) {
    .modal {
        padding: 12px;
    }
    .modal-header {
        padding: 16px 20px;
    }
    .modal-body {
        padding: 16px 20px;
    }
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #111827;
    margin-bottom: 24px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-description {
    font-size: 15.5px;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ===== CLARIFYING DOUBTS SECTION ===== */
.doubts-section {
    background: linear-gradient(145deg, rgba(122,162,255,0.06), transparent);
    border: 1px solid rgba(122,162,255,0.15);
    padding: 60px 40px;
    border-radius: 28px;
    text-align: center;
    margin: 40px 0;
}

.doubts-section h2 {
    color: #7aa2ff;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 60px 20px 40px;
    opacity: 0.6;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== UTILITIES ===== */
.fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.23, 1.0, 0.32, 1);
}

.fade.show {
    opacity: 1;
    transform: translateY(0);
}

.accent-text {
    color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 2px;
    }
    
    .nav-link:hover {
        background: rgba(255,255,255,0.06);
        color: white;
        box-shadow: 0 0 16px rgba(122, 162, 255, 0.35);
        transform: translateY(-1px);
        transition: all 0.2s cubic-bezier(0.23, 1.0, 0.32, 1);
    }
    
    .dropdown {
        min-width: 180px;
    }
    
    .hero h1 {
        font-size: 42px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE HAMBURGER MENU ===== */
.hamburger {
    display: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 26px;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1002;
}

.hamburger:hover {
    background: rgba(122,162,255,0.15);
    border-color: #7aa2ff;
    box-shadow: 0 0 15px rgba(122, 162, 255, 0.3);
}

@media (max-width: 1100px) {
    .nav-menu {
        display: flex; 
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(8, 11, 20, 0.97);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 0 0 20px 20px;
        padding: 16px;
        backdrop-filter: blur(30px);
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
        z-index: 1001;
        max-height: 70vh;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-15px) scale(0.98);
        transition: all 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
        transform-origin: top center;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 12px;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,0.04);
        margin: 4px 0 12px 20px;
        border-radius: 12px;
        padding: 8px 0;
    }

    .hamburger {
        display: flex;
    }

    .nav-container {
        padding: 0 20px;
    }
}

/* Mobile submenu handling */
body.no-scroll {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .nav-menu .dropdown {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transform: translateY(-10px);
        transition: all 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
        padding: 0;
        border: none;
        margin: 0 20px;
        background: rgba(255, 255, 255, 0.04); 
        border-radius: 12px;
    }

    .nav-menu .dropdown.open {
        max-height: 500px; 
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        padding: 8px 0;
        margin-top: 4px;
        margin-bottom: 12px;
    }
}

/* ===== INTERACTIVE FILTER & SEARCH SYSTEM ===== */
.controls-capsule {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    padding: 8px 12px 8px 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    color: var(--accent-primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-input-field {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-family: inherit;
    font-size: 15px;
    width: 100%;
}

.search-input-field::placeholder {
    color: var(--text-dim);
}

.filter-select {
    background: rgba(8, 12, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.15);
}

/* ===== PDF BUTTONS ===== */
#modal-pdf-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#modal-pdf-container[style*="display: block"] {
    display: flex !important;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(122,162,255, 0.15); /* Translucent Blue */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(122,162,255, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: fit-content;
}

.pdf-btn:hover {
    background: rgba(122,162,255, 0.3);
    border-color: rgba(122,162,255, 0.5);
    box-shadow: 0 6px 20px rgba(122,162,255, 0.2);
    transform: translateY(-2px);
}

.pdf-btn.secondary {
    /* A slightly deeper/different shade of blue (Indigo tint) */
    background: rgba(99, 102, 241, 0.15); 
    border-color: rgba(99, 102, 241, 0.3);
}

.pdf-btn.secondary:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
}