/* Import IBM Plex Sans Arabic Font */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
    --font-family: 'IBM Plex Sans Arabic', sans-serif;
    
    /* Rich, Vibrant & Luxury Saudi NGO Palette (Light Theme) */
    --bg-primary: #f0f6f4;         /* Soft warm tinted green-white */
    --bg-secondary: #ffffff;       /* Pure white for cards */
    --bg-accent: #e1ede8;          /* Muted emerald-green background elements */
    --text-main: #0a221d;          /* Deep rich forest charcoal text */
    --text-muted: #3d5e56;         /* Sage forest gray */
    --accent-teal: #025951;        /* Rich Deep Emerald Green (Primary Brand) */
    --accent-teal-hover: #013e38;
    --accent-emerald: #01d679;     /* Vibrant bright green (Success & Highlights) */
    --accent-gold: #c59c5f;        /* Luxurious gold (Badges, Stars, Icons) */
    --border-color: #d1e2db;       /* Soft green-gray border */
    
    --card-shadow: 0 10px 30px rgba(2, 89, 81, 0.05);
    --card-hover-shadow: 0 20px 40px rgba(2, 89, 81, 0.12);
}

[data-theme="dark"] {
    /* Muted Dark Corporate Palette (Dark Theme) */
    --bg-primary: #07100d;         /* Very dark emerald black */
    --bg-secondary: #0d1a15;       /* Dark card background */
    --bg-accent: #152921;          /* Dark green accents */
    --text-main: #f0f7f4;          /* Clean off-white */
    --text-muted: #7ca895;         /* Muted sage */
    --accent-teal: #01d679;        /* Bright emerald green becomes primary in dark */
    --accent-teal-hover: #00b063;
    --accent-emerald: #025951;
    --accent-gold: #e2b26b;
    --border-color: #193127;
    
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--accent-teal); /* Main headers in deep brand green */
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
}

/* Navbar */
.custom-navbar {
    background-color: var(--accent-teal); /* Dark Emerald Green Navbar */
    border-bottom: 3px solid var(--accent-gold); /* Gold bottom border */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.custom-navbar .navbar-brand {
    color: #ffffff !important;
}
.custom-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.2s ease;
}
.custom-navbar .nav-link:hover, 
.custom-navbar .nav-link.active {
    color: var(--accent-emerald) !important; /* Vibrant green on hover/active */
}

/* Custom Cards */
.custom-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease, border-color 0.4s ease;
}
.custom-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--accent-gold); /* Gold highlight border on hover */
}

/* Icons */
.icon-box-wrapper {
    background-color: var(--bg-primary);
    color: var(--accent-gold); /* Gold icons */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.custom-card:hover .icon-box-wrapper {
    background-color: var(--accent-teal);
    color: #ffffff;
    transform: scale(1.1);
}

/* Buttons */
.btn-teal {
    background-color: var(--accent-gold); /* Gold as primary call to action */
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(197, 156, 95, 0.3);
    transition: all 0.3s ease;
}
.btn-teal:hover {
    background-color: #b0844f;
    box-shadow: 0 6px 20px rgba(197, 156, 95, 0.4);
    transform: translateY(-2px);
}
.btn-teal:active {
    transform: scale(0.97);
}

.btn-outline-teal {
    background-color: transparent;
    color: var(--accent-teal) !important;
    border: 2px solid var(--accent-teal);
    border-radius: 12px;
    padding: 10px 28px;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-outline-teal:hover {
    background-color: var(--accent-teal);
    color: #ffffff !important;
}

/* RTL Helpers */
[dir="rtl"] .ms-auto-rtl {
    margin-right: auto !important;
    margin-left: 0 !important;
}
[dir="ltr"] .ms-auto-rtl {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Hero Section */
.hero-sec {
    padding: 90px 0;
    position: relative;
    background: radial-gradient(circle at 10% 20%, rgba(2, 89, 81, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(197, 156, 95, 0.05) 0%, transparent 40%);
}

.profile-img-container img {
    border-radius: 24px;
    border: 5px solid var(--bg-secondary);
    box-shadow: var(--card-hover-shadow);
    width: 320px;
    height: 320px;
    object-fit: cover;
    transition: all 0.3s ease;
}
.profile-img-container:hover img {
    border-color: var(--accent-gold);
    transform: rotate(1deg) scale(1.02);
}

/* Stat Cards */
.stat-card {
    text-align: center;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 26px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}
.stat-card:hover {
    border-color: var(--accent-teal);
    transform: scale(1.03);
}
.stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent-teal);
    margin-bottom: 5px;
}

/* Table styling */
.library-table-container {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 26px;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}
.custom-table {
    width: 100%;
    border-collapse: collapse;
}
.custom-table th {
    padding: 20px;
    text-align: start;
    border-bottom: 3px solid var(--accent-teal); /* Elegant thick border */
    font-weight: 700;
    color: var(--accent-teal);
}
.custom-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.custom-table tbody tr:hover {
    background-color: rgba(2, 89, 81, 0.02);
}

/* Collapsible hamburger lines in navbar */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5) !important;
}
.navbar-toggler i {
    color: #ffffff;
}

/* Responsive Tables for Mobile */
@media (max-width: 767.98px) {
    .custom-table, .custom-table thead, .custom-table tbody, .custom-table th, .custom-table td, .custom-table tr {
        display: block;
    }
    .custom-table thead {
        display: none;
    }
    .custom-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 10px;
        background-color: var(--bg-primary);
    }
    .custom-table td {
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
    }
}

/* Infinite Scrolling Partners Marquee */
.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 25px 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.marquee-content {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: marquee-scroll 35s linear infinite;
}
.marquee-content:hover {
    animation-play-state: paused;
}
.marquee-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    margin: 0 15px;
    background-color: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    user-select: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}
.marquee-item:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-gold);
    box-shadow: 0 6px 15px rgba(2, 89, 81, 0.08);
    transform: translateY(-2px);
}
.marquee-item img {
    height: 38px;
    max-width: 120px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.3s ease;
}
.marquee-item:hover img {
    filter: none;
    opacity: 1;
}
.marquee-item span {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.15rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}
.marquee-item:hover span {
    color: var(--accent-teal);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-25%);
    }
}

/* Partner Grid Card styling for About Page */
.partner-card-premium {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.partner-card-premium:hover {
    transform: translateY(-5px);
    border-color: var(--accent-teal);
    box-shadow: 0 10px 20px rgba(2, 89, 81, 0.08);
}
.partner-card-logo-container {
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    width: 100%;
}
.partner-card-logo-container img {
    max-height: 65px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}
.partner-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 5px;
}

/* ================= PARTNERS PREMIUM DISPLAY STYLES ================= */

/* Spotlight Glow Card style */
.glow-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.glow-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle 120px at var(--x, 50%) var(--y, 50%), rgba(197, 156, 95, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}
.glow-card:hover::before {
    opacity: 1;
}
.glow-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(197, 156, 95, 0.12);
}
.glow-card:hover .partner-card-logo-container img {
    filter: none;
    transform: scale(1.05);
}

/* Glass Carousel style */
.carousel-wrapper-custom {
    position: relative;
    width: 100%;
}
.carousel-inner-custom {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    padding: 15px 5px;
    width: 100%;
}
.carousel-inner-custom::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}
.carousel-inner-custom .carousel-card-item {
    flex: 0 0 250px; /* fixed card width */
    max-width: 250px;
}
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--accent-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 10;
    transition: all 0.3s ease;
}
.carousel-nav-btn:hover {
    background-color: var(--accent-teal);
    color: white;
    border-color: var(--accent-teal);
    box-shadow: 0 6px 15px rgba(2, 89, 81, 0.15);
}
.carousel-nav-btn.prev {
    right: -22px;
}
.carousel-nav-btn.next {
    left: -22px;
}
/* Flip arrows for LTR direction */
[dir="ltr"] .carousel-nav-btn.prev {
    left: -22px;
    right: auto;
}
[dir="ltr"] .carousel-nav-btn.next {
    right: -22px;
    left: auto;
}

/* Floating Parallax Card style */
.float-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: gentle-float-y 6s ease-in-out infinite alternate;
}
.float-card:nth-child(2n) {
    animation-duration: 7s;
    animation-delay: 1.2s;
}
.float-card:nth-child(3n) {
    animation-duration: 8s;
    animation-delay: 2.4s;
}
.float-card:hover {
    border-color: var(--accent-teal);
    box-shadow: 0 10px 25px rgba(2, 89, 81, 0.08);
}
.float-card:hover .partner-card-logo-container img {
    filter: none;
    transform: scale(1.05);
}
@keyframes gentle-float-y {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-12px);
    }
}

/* Layout Switcher buttons */
.layout-switcher-btn {
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}
.layout-switcher-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}
.layout-switcher-btn.active {
    background-color: var(--accent-teal);
    color: white !important;
    border-color: var(--accent-teal);
    box-shadow: 0 5px 12px rgba(2, 89, 81, 0.15);
}


