:root {
    --bg-dark: #0b0d12;
    --bg-card: rgba(18, 20, 29, 0.85);
    --accent-yellow: #f5b000;
    --accent-gold: #ffc107;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(245, 176, 0, 0.12);
    --glow-shadow: 0 8px 32px 0 rgba(245, 176, 0, 0.2);
    --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

.navbar {
    background: rgba(11, 13, 18, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.logo-container {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-svg {
    width: clamp(32px, 8vw, 42px);
    height: clamp(32px, 8vw, 42px);
    filter: drop-shadow(0 0 8px rgba(245, 176, 0, 0.4));
    transition: var(--transition-fast);
}

.logo-container:hover .nav-logo-svg {
    transform: scale(1.08);
    filter: drop-shadow(0 0 12px rgba(245, 176, 0, 0.7));
}

.logo-text {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* فصل الألوان: كلمة دماغ أصفر وكلمة تك أبيض */
.logo-dmag {
    color: var(--accent-yellow);
}

.logo-tech {
    color: #ffffff;
}

.text-accent {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-yellow) !important;
}

.hero-section {
    background: radial-gradient(circle at top right, rgba(245, 176, 0, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(255, 193, 7, 0.05), transparent 40%),
                var(--bg-dark);
    padding: clamp(50px, 12vw, 100px) 0 clamp(40px, 8vw, 80px) 0;
}

.hero-logo-container {
    display: inline-block;
    max-width: 100%;
    padding: clamp(14px, 4vw, 25px) clamp(18px, 6vw, 45px);
    background: rgba(18, 20, 29, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(245, 176, 0, 0.05);
    transition: var(--transition-fast);
}

.hero-logo-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(245, 176, 0, 0.1);
    border-color: rgba(245, 176, 0, 0.3);
}

.hero-logo-svg {
    width: clamp(38px, 12vw, 70px);
    height: clamp(38px, 12vw, 70px);
    margin-right: clamp(8px, 3vw, 15px);
    flex-shrink: 0;
    filter: drop-shadow(0 0 15px rgba(245, 176, 0, 0.5));
}

.hero-logo-text {
    font-size: clamp(1.6rem, 8vw, 3.2rem);
    font-weight: 900;
    white-space: nowrap;
}

.hero-section h1 {
    font-weight: 800;
    line-height: 1.3;
    font-size: clamp(1.75rem, 5vw + 1rem, 4.5rem);
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section .lead {
    font-size: clamp(1rem, 2.5vw, 1.5rem) !important;
}

.quran-text {
    font-size: clamp(1rem, 3vw, 1.5rem) !important;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-gold));
    color: #0b0d12 !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    box-shadow: 0 4px 20px rgba(245, 176, 0, 0.35);
    transition: var(--transition-fast);
}

.btn-accent:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(245, 176, 0, 0.55);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white !important;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
    transition: var(--transition-fast);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.category-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    border-radius: 16px !important;
    transition: var(--transition-fast) !important;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: rgba(245, 176, 0, 0.45) !important;
    box-shadow: var(--glow-shadow);
}

.category-card i {
    font-size: clamp(2rem, 6vw, 3rem);
}

.category-card h4 {
    font-size: clamp(1rem, 3vw, 1.25rem);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

footer {
    background: #06070a !important;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}

/* شريط تمرير أنيق */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-yellow));
    border-radius: 10px;
}

/* ==========================================
   زر تبديل الوضع (لايت / دارك)
   ========================================== */
.btn-theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 176, 0, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--accent-yellow);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.btn-theme-toggle:hover {
    background: rgba(245, 176, 0, 0.2);
    color: var(--accent-yellow);
    transform: translateY(-2px) rotate(15deg);
}

/* ==========================================
   الوضع الفاتح (Light Mode) - نسخة احترافية
   يُفعَّل بإضافة كلاس light-mode على عنصر html
   ========================================== */
html.light-mode {
    --bg-dark: #f1efea;
    --bg-card: rgba(255, 255, 255, 0.75);
    --text-main: #34322d;
    --text-muted: #767268;
    --glass-border: rgba(180, 150, 90, 0.18);
    --glow-shadow: 0 16px 32px -14px rgba(50, 45, 35, 0.12);
}

/* خلفية هادئة منخفضة التشبع بدل التوهج الأصفر القوي */
html.light-mode body {
    background:
        radial-gradient(circle at 10% 0%, rgba(180, 150, 90, 0.05), transparent 35%),
        radial-gradient(circle at 95% 15%, rgba(160, 160, 140, 0.05), transparent 32%),
        var(--bg-dark);
    background-attachment: fixed;
}

html.light-mode .navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(180, 150, 90, 0.14);
    box-shadow: 0 4px 20px rgba(50, 45, 35, 0.04);
}

html.light-mode footer {
    background: #f8f6f2 !important;
    border-top: 1px solid rgba(180, 150, 90, 0.15);
    box-shadow: 0 -6px 20px rgba(50, 45, 35, 0.02);
    color: var(--text-muted);
}

html.light-mode .page-header {
    background: rgba(255, 255, 255, 0.4) !important;
    border-bottom: 1px solid rgba(180, 150, 90, 0.12);
}

html.light-mode .hero-logo-container {
    background: rgba(255, 255, 255, 0.65) !important;
    border-color: rgba(180, 150, 90, 0.16);
    box-shadow: 0 20px 40px -18px rgba(50, 45, 35, 0.14), inset 0 0 25px rgba(180, 150, 90, 0.03);
}

html.light-mode .hero-logo-container:hover {
    box-shadow: 0 24px 48px -18px rgba(50, 45, 35, 0.18), inset 0 0 30px rgba(180, 150, 90, 0.05);
}

html.light-mode .hero-section h1 {
    background: linear-gradient(180deg, #34322d 0%, #5c584e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.light-mode .hero-section {
    background: none;
}

html.light-mode .ticker-banner {
    background: rgba(255, 255, 255, 0.5) !important;
    box-shadow: inset 0 0 16px rgba(180, 150, 90, 0.04);
}

html.light-mode .ticker-banner::before {
    background: linear-gradient(to left, var(--bg-dark), transparent);
}

html.light-mode .ticker-banner::after {
    background: linear-gradient(to right, var(--bg-dark), transparent);
}

/* بطاقات الأقسام: عمق هادئ، حدود ناعمة، لمسة زخرفية خفيفة */
html.light-mode .category-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(180, 150, 90, 0.14) !important;
    box-shadow: 0 10px 26px -14px rgba(50, 45, 35, 0.1);
}

html.light-mode .category-card::before {
    content: '';
    position: absolute;
    top: -35px;
    left: -35px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 150, 90, 0.08), transparent 70%);
    pointer-events: none;
}

html.light-mode .category-card:hover {
    box-shadow: 0 18px 38px -16px rgba(50, 45, 35, 0.16);
    border-color: rgba(180, 150, 90, 0.3) !important;
}

/* مؤشر أنيق تحت الرابط النشط في القائمة */
html.light-mode .nav-link {
    position: relative;
}

html.light-mode .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 50%;
    transform: translateX(50%);
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-yellow));
}

html.light-mode .btn-accent {
    box-shadow: 0 8px 20px -6px rgba(180, 130, 20, 0.28);
}

html.light-mode .btn-accent:hover {
    box-shadow: 0 12px 26px -6px rgba(180, 130, 20, 0.36);
}

html.light-mode .btn-whatsapp {
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.18);
}

/* شريط تمرير أنيق في الوضع الفاتح */
html.light-mode ::-webkit-scrollbar {
    width: 10px;
}

html.light-mode ::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

html.light-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-yellow));
    border-radius: 10px;
}

html.light-mode .navbar-toggler {
    border-color: rgba(43, 38, 32, 0.25) !important;
}

html.light-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(43, 38, 32, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

html.light-mode .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(245, 176, 0, 0.2) !important;
}

html.light-mode .text-white,
html.light-mode .text-light {
    color: var(--text-main) !important;
}

html.light-mode .text-white-50 {
    color: var(--text-muted) !important;
}

html.light-mode .btn-theme-toggle {
    color: #b37c00;
}

html.light-mode .logo-tech {
    color: var(--text-main);
}

/* ==========================================
   ضبط عام للاستجابة على كل المقاسات
   (موبايل صغير، تابلت، لابتوب، شاشات كبيرة)
   ========================================== */
img, svg {
    max-width: 100%;
    height: auto;
}

.container {
    padding-left: 16px;
    padding-right: 16px;
}

@media (max-width: 380px) {
    .btn-accent, .btn-whatsapp {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .hero-logo-text {
        white-space: normal;
    }
}

@media (min-width: 1400px) {
    .hero-section h1 {
        font-size: 4.5rem;
    }
}
