:root {
    --primary-blue: #3b82f6;
    --dark-blue: #4f46e5;
    --light-blue: #e0e7ff;
    --accent-cyan: #8b5cf6;
    --accent-light: #ddd6fe;
    --gradient-main: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-hover: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    --gradient-text: linear-gradient(90deg, #2563eb, #7c3aed, #9333ea);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --header-bg: linear-gradient(90deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
    --footer-bg: linear-gradient(90deg, #7c3aed 0%, #4f46e5 50%, #1e40af 100%);
    --bg-gradient: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 50%, #f3e8ff 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(139, 92, 246, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(79, 70, 229, 0.15);
    --bg-color: #eff6ff;
    --surface-color: #ffffff;
    --text-primary: #1e1b4b;
    --text-secondary: #475569;
    --border-color: #c7d2fe;
    --code-bg: #f5f3ff;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-code: 'Consolas', 'Monaco', monospace;
    --transition-speed: 0.3s;
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
[data-theme="dark"] {
    --primary-blue: #8b5cf6;
    --dark-blue: #6366f1;
    --light-blue: #312e81;
    --accent-cyan: #a78bfa;
    --accent-light: #c4b5fd;
    --gradient-main: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-hover: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-text: linear-gradient(90deg, #a78bfa, #818cf8, #60a5fa);
    --header-bg: linear-gradient(90deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    --footer-bg: linear-gradient(90deg, #4c1d95 0%, #312e81 50%, #1e1b4b 100%);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #2e1065 100%);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --bg-color: #0f172a;
    --surface-color: #1e1b4b;
    --text-primary: #e0e7ff;
    --text-secondary: #94a3b8;
    --border-color: #4338ca;
    --code-bg: #1e1b4b;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
[lang="ar"] {
    direction: rtl;
}
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.code-draw {
    display: block;
    margin-bottom: 20px;
}
.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawCode 1.5s ease-in-out forwards;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.6));
}
@keyframes drawCode {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}
.loading-text {
    font-family: var(--font-code);
    color: #818cf8;
    font-size: 1.2rem;
    animation: fadeInText 1s ease-in-out 0.5s forwards;
    opacity: 0;
}
@keyframes fadeInText {
    to {
        opacity: 1;
    }
}
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}
header {
    width: 100%;
    background: var(--header-bg);
    padding: 0.8rem 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}
header.scrolled {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.logo-container {
    display: flex;
    align-items: center;
}
.logo-container img {
    height: 50px;
}
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    outline: none;
    border: none;
    cursor: pointer;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}
@media (min-width: 769px) {
    nav {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}
nav a {
    text-decoration: none;
    color: #f8fafc !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
    border: 2px solid transparent;
}
nav a.active {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}
nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}
.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}
.theme-switch {
    position: relative;
    width: 60px;
    height: 32px;
    cursor: pointer;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.theme-switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
    border-radius: 34px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.theme-switch .slider::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(135deg, #fff, #f0f9ff);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 2;
}
.theme-switch .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 1;
}
.theme-switch .sun {
    left: 6px;
    opacity: 0;
}
.theme-switch .moon {
    right: 6px;
    opacity: 1;
}
.theme-switch input:checked+.slider {
    background: linear-gradient(135deg, #1e1b4b, #4c1d95, #7c3aed);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5), inset 0 2px 10px rgba(0, 0, 0, 0.3);
}
.theme-switch input:checked+.slider::before {
    transform: translateX(28px);
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.theme-switch input:checked+.slider .sun {
    opacity: 1;
}
.theme-switch input:checked+.slider .moon {
    opacity: 0;
}
.theme-switch:hover .slider {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.15);
}
.theme-switch:hover input:checked+.slider {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.7), inset 0 2px 10px rgba(0, 0, 0, 0.3);
}
.toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(4px);
    padding: 0;
    box-shadow: none;
}
#lang-toggle {
    border-radius: 20px;
    width: auto;
    padding: 6px 12px;
    min-width: 60px;
}
.lang-dropdown {
    position: relative;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}
.flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.lang-arrow {
    color: white;
    font-size: 10px;
    transition: transform 0.3s ease;
}
.lang-dropdown.open .lang-arrow {
    transform: rotate(180deg);
}
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.lang-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}
.lang-option:hover {
    background: rgba(99, 102, 241, 0.3);
}
.lang-option.active {
    background: rgba(99, 102, 241, 0.5);
}
.toggle-btn svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    border-color: white;
}
.lang-ar {
    display: none !important;
}
html[lang="ar"] .lang-en {
    display: none !important;
}
html[lang="ar"] .lang-ar {
    display: inline !important;
}
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.7)), url('hero-image-v2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem;
}
.hero-text {
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    color: #f8fafc;
}
.hero-text h1 {
    color: #f8fafc;
    font-size: 3.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.hero-text p {
    color: #e2e8f0;
    font-size: 1.3rem;
    margin: 1.5rem auto;
    max-width: 700px;
}
.feature-icon-wrapper {
    width: 70px;
    height: 70px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.card h3 {
    font-size: 1.5rem;
    margin: 0 auto;
    padding: 0 2rem;
    flex: 1;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}
.card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15), 0 0 15px rgba(6, 182, 212, 0.2);
    animation: pulseCardGlow 4s infinite alternate ease-in-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 5rem;
}
@keyframes pulseCardGlow {
    0% {
        box-shadow: 0 4px 15px rgba(124, 58, 237, 0.1), 0 0 10px rgba(6, 182, 212, 0.15);
    }
    33% {
        box-shadow: 0 4px 25px rgba(6, 182, 212, 0.2), 0 0 20px rgba(236, 72, 153, 0.15);
    }
    66% {
        box-shadow: 0 4px 25px rgba(236, 72, 153, 0.2), 0 0 20px rgba(124, 58, 237, 0.15);
    }
    100% {
        box-shadow: 0 4px 30px rgba(124, 58, 237, 0.25), 0 0 25px rgba(6, 182, 212, 0.2);
    }
}
.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.3), 0 0 30px rgba(6, 182, 212, 0.25);
    border-color: var(--primary-blue);
}
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient-main);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}
.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    background: var(--gradient-hover);
}
.modules-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    width: 100%;
}
.modules-container>.module-card {
    flex: 1 1 calc(50% - 2rem);
    max-width: 100%;
}
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
    width: 100%;
    display: block;
    margin-bottom: 2rem;
    margin-top: 4rem;
}
.module-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1), 0 0 15px rgba(6, 182, 212, 0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    height: 100%;
}
.module-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.35), 0 0 40px rgba(236, 72, 153, 0.2), 0 0 30px rgba(6, 182, 212, 0.25);
    border-color: var(--primary-blue);
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}
.module-card:hover::before {
    transform: translateX(100%);
}
.module-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5));
    align-self: flex-start;
}
.module-content {
    flex: 1;
    width: 100%;
}
.module-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.module-desc {
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}
.module-link {
    color: var(--primary-blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: gap 0.3s;
}
.module-card:hover .module-link {
    gap: 15px;
    color: #a5b4fc;
}
.back-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}
.lessons-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
    color: var(--primary-blue);
    width: 100%;
    margin-bottom: 5rem;
}
.topic-list {
    position: relative;
    top: 0;
    width: 100%;
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
}
.topic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 200px;
    padding: 14px 18px;
    margin-bottom: 0px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    text-align: center;
    cursor: pointer;
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.topic-btn:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-blue);
    transform: translateX(3px);
}
.topic-btn.active {
    background: var(--surface-color);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}
.topic-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-blue);
}
.topic-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.05);
    min-height: 600px;
}
.topic-pane.active {
    display: block;
}
.topic-pane h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}
.topic-pane p {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}
.topic-pane ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}
.topic-pane li {
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    line-height: 1.6;
}
pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: var(--font-code);
    overflow-x: auto;
    position: relative;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
pre::before {
    content: 'PHP';
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0.5;
}
.kwd {
    color: #d73a49;
    font-weight: bold;
}
.str {
    color: #032f62;
}
.num {
    color: #005cc5;
}
.var {
    color: #e36209;
}
.cmt {
    color: #6a737d;
    font-style: italic;
}
.func {
    color: #6f42c1;
}
[data-theme="dark"] .str {
    color: #7dd3fc;
}
[data-theme="dark"] .kwd {
    color: #f472b6;
}
[data-theme="dark"] .cmt {
    color: #94a3b8;
}
[data-theme="dark"] .var {
    color: #fbbf24;
}
[data-theme="dark"] .num {
    color: #a5b4fc;
}
[data-theme="dark"] .func {
    color: #c084fc;
}
footer {
    background: var(--footer-bg);
    color: white !important;
    padding: 4rem 2rem 2rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-col h3 {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    color: white !important;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.footer-col p,
.footer-links li {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.footer-col h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: white;
    margin-top: 8px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links li a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.footer-links li a:hover {
    color: white !important;
    padding-left: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}
.reveal-delay-1 {
    transition-delay: 0.05s;
}
.reveal-delay-2 {
    transition-delay: 0.1s;
}
.reveal-delay-3 {
    transition-delay: 0.15s;
}
.reveal-delay-4 {
    transition-delay: 0.2s;
}
.reveal-delay-5 {
    transition-delay: 0.25s;
}
body {
    transition: background 0.6s ease, color 0.4s ease;
}
.theme-transitioning,
.theme-transitioning * {
    transition: background 0.5s ease,
        background-color 0.5s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.5s ease !important;
}
.lang-switching .lang-en,
.lang-switching .lang-ar {
    animation: langFade 0.4s ease-out;
}
@keyframes langFade {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.theme-toggle-spin {
    animation: spinSwitch 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes spinSwitch {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(0.8);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes flyIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-in {
    animation: flyIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
    width: 40px;
    height: 40px;
}
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    position: relative;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.mobile-menu-btn.active .hamburger span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.mobile-menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active .hamburger span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}
.mobile-menu-btn:hover .hamburger span {
    background: var(--primary-blue);
    box-shadow: 0 0 10px var(--primary-blue);
}
@media (max-width: 768px) {
    header {
        padding: 0.5rem !important;
    }
    .logo-container img {
        height: 35px !important;
    }
    .controls {
        gap: 0.5rem !important;
    }
    .theme-switch {
        transform: scale(0.85);
    }
    .lang-btn {
        padding: 4px 8px !important;
        font-size: 0.85rem !important;
    }
    .flag-icon {
        width: 16px !important;
        height: 12px !important;
    }
    .mobile-menu-btn {
        width: 35px;
        height: 35px;
    }
    .hero-text h1 {
        font-size: 2.5rem;
    }
    .hero-section {
        padding: 1rem;
    }
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    nav ul.show {
        display: flex;
        animation: fadeIn 0.3s ease;
    }
    .mobile-menu-btn {
        display: block;
    }
    .lessons-container {
        grid-template-columns: 1fr;
    }
    .topic-list {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 1rem;
    }
    .topic-btn {
        min-width: 140px;
        margin-bottom: 0;
    }
}
.social-buttons {
    display: flex;
    gap: 15px;
}
.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.social-btn::after {
    display: none;
}
.social-btn:hover {
    transform: translateY(-5px);
    background: var(--primary-blue);
    color: white !important;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}
.social-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden !important;
        width: 100vw;
        max-width: 100%;
    }
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        margin-bottom: 3rem;
        width: 100%;
        box-sizing: border-box;
    }
    .hero-text h1 {
        font-size: 2rem !important;
        line-height: 1.3;
        padding: 0 10px;
    }
    .hero-text p {
        font-size: 1rem !important;
        padding: 0 10px;
    }
    .hero-text>div {
        flex-direction: column !important;
        gap: 15px;
        width: 100%;
        padding: 0 20px;
    }
    .hero-text .btn {
        width: 100% !important;
        padding: 12px 0 !important;
        display: block;
        text-align: center;
    }
    .hero-section {
        padding: 4rem 1rem !important;
        min-height: auto !important;
        height: auto !important;
    }
    .modules-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    .modules-container>.module-card {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
    .container {
        padding: 0 15px;
    }
    .quiz-container,
    .example-container {
        width: 100%;
        padding: 1rem;
    }
}
.tabs-container {
    width: 100%;
    margin-bottom: 4rem;
}
.tab-nav {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 2rem;
    padding: 8px;
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    position: relative;
    width: 100%;
}
.tab-indicator {
    position: absolute;
    height: calc(100% - 16px);
    top: 8px;
    background: var(--gradient-main);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}
.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}
.tab-btn:hover {
    color: var(--primary-blue);
}
.tab-btn.active {
    color: white;
}
.tab-btn.active {
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}
.tab-btn.active::before {
    opacity: 1;
}
.tab-btn .tab-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
.tab-btn:hover .tab-icon {
    transform: scale(1.1);
}
.tab-btn.active .tab-icon {
    transform: scale(1.2);
}
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}
.tab-content.active {
    display: block;
    animation: smoothSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes smoothSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.sub-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.sub-lesson-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.sub-lesson-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}
.sub-lesson-card:hover::after {
    left: 100%;
}
.sub-lesson-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.2);
    border-color: var(--primary-blue);
}
.sub-lesson-card h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
.sub-lesson-card:hover h3 {
    transform: translateX(5px);
}
.sub-lesson-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.sub-lesson-card .card-arrow {
    color: var(--primary-blue);
    font-weight: bold;
    transition: transform 0.3s ease;
    display: inline-block;
}
.sub-lesson-card:hover .card-arrow {
    transform: translateX(5px);
}
.lesson-content-area {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    min-height: 400px;
    margin-bottom: 3rem;
    overflow: hidden;
}
.lesson-content-area h2 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.lesson-article {
    animation: fadeInContent 0.5s ease forwards;
}
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.back-to-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid var(--primary-blue);
    border-radius: 10px;
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.back-to-tabs:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(14, 165, 233, 0.3);
}
@media (max-width: 768px) {
    .tab-nav {
        flex-direction: column;
        gap: 8px;
        background: transparent;
        border: none;
        padding: 0;
        backdrop-filter: none;
    }
    .tab-btn {
        width: 100%;
        justify-content: center;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 12px 16px;
        backdrop-filter: blur(8px);
    }
    .tab-btn.active {
        background: var(--gradient-main);
        border-color: transparent;
        transform: none !important;
        width: 100%;
        margin: 0;
    }
    .tab-indicator {
        display: none;
    }
    .sub-lessons-grid {
        grid-template-columns: 1fr;
    }
    .lesson-content-area {
        padding: 1rem;
    }
    .tabs-container {
        margin-bottom: 2rem;
    }
    .lesson-section {
        padding: 1rem;
    }
    .lesson-section h3 {
        font-size: 1.1rem;
    }
    .lesson-section ul {
        padding-left: 1.2rem;
    }
    pre {
        font-size: 0.85rem;
        padding: 1rem;
    }
    .mobile-tab-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 20px;
        background: var(--gradient-main);
        border: none;
        border-radius: 12px;
        color: white;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    .mobile-tab-toggle:hover {
        transform: scale(1.02);
        box-shadow: 0 5px 20px rgba(14, 165, 233, 0.4);
    }
    .mobile-tab-toggle .toggle-text {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .mobile-tab-toggle .toggle-arrow {
        transition: transform 0.3s ease;
    }
    .mobile-tab-toggle.open .toggle-arrow {
        transform: rotate(180deg);
    }
    .tabs-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        margin-top: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            margin-top 0.3s ease;
    }
    .tabs-list.open {
        max-height: 500px;
        opacity: 1;
        margin-top: 12px;
    }
    .tab-nav {
        flex-direction: column;
        gap: 0;
        background: transparent;
        border: none;
        padding: 0;
        backdrop-filter: none;
        overflow: visible;
    }
    .tabs-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        margin-top: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            margin-top 0.3s ease;
    }
    .tabs-list.open {
        max-height: 500px;
        opacity: 1;
        margin-top: 12px;
    }
    .tab-btn {
        width: 100%;
        justify-content: flex-start;
        background: var(--glass-bg);
        border: 2px solid var(--glass-border);
        border-radius: 12px;
        padding: 14px 18px;
        transition: all 0.3s ease;
        backdrop-filter: blur(8px);
        box-sizing: border-box;
    }
    .tab-btn:hover {
        border-color: var(--primary-blue);
        background: rgba(14, 165, 233, 0.08);
    }
    .tab-btn.active {
        background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(59, 130, 246, 0.15));
        border: 2px solid var(--primary-blue);
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
    }
    .tab-btn.active .tab-icon {
        transform: scale(1.1);
    }
    .tab-indicator {
        display: none;
    }
}
@media (min-width: 769px) {
    .mobile-tab-toggle {
        display: none !important;
    }
    .tabs-list {
        display: flex !important;
        flex-direction: row !important;
        max-height: none !important;
        opacity: 1 !important;
        margin-top: 0 !important;
        overflow: visible !important;
        gap: 0;
        flex: 1;
    }
}
.btn {
    padding: 12px 24px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}
.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--hover-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.logo-container {
    order: 1;
}
nav {
    order: 2;
}
.controls {
    order: 3;
}
body[dir='rtl'] header {
    flex-direction: row !important;
}
body[dir='rtl'] .controls {
    order: 1 !important;
    direction: ltr !important;
}
body[dir='rtl'] nav {
    order: 2 !important;
    direction: rtl !important;
}
body[dir='rtl'] .logo-container {
    order: 3 !important;
}