:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-primary: #346bb2;
    --accent-gradient: linear-gradient(135deg, #2a5592 0%, #346bb2 50%, #4a7bc8 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --grid-overlay: rgba(255, 255, 255, 0.03);
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(52, 107, 178, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(74, 123, 200, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(42, 85, 146, 0.12) 0%, transparent 50%);
    color: var(--text-main);
    font-family: 'Cairo', 'Tajawal', 'Noto Kufi Arabic', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;

    justify-content: space-between;
    transition: background-color 0.3s, color 0.3s;
}

/* Ambient animated background grid */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, var(--grid-overlay) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-overlay) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
    transition: background-image 0.3s;
}

header {
    position: relative;
    z-index: 10;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(52, 107, 178, 0.45);
    font-size: 1.15rem;
    color: white;
    font-weight: bold;
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
}

.lang-switch {
    transition: all 0.2s ease;
}

.lang-switch:hover {
    background: rgba(52, 107, 178, 0.3) !important;
    border-color: rgba(74, 123, 200, 0.6) !important;
    transform: translateY(-1px);
}

.btn-portal {
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    padding: 0.65rem 1.4rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px -5px rgba(52, 107, 178, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-portal:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(74, 123, 200, 0.6);
}

main {
    position: relative;
    z-index: 10;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    flex: 1;
}

.hero-section {
    text-align: center;
    max-width: 860px;
    margin: 0 auto 5rem;
    animation: fadeIn 0.8s ease-out;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(52, 107, 178, 0.15);
    border: 1px solid rgba(74, 123, 200, 0.35);
    color: #6fa0e6;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4a7bc8;
    box-shadow: 0 0 10px #4a7bc8;
    animation: pulse 2s infinite;
}

h1 {
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

[dir="rtl"] h1 {
    line-height: 1.45;
    letter-spacing: 0;
    padding-bottom: 0.35rem;
}

[dir="rtl"] h2,
[dir="rtl"] h3 {
    line-height: 1.5;
    letter-spacing: 0;
}

[dir="rtl"] p {
    line-height: 1.8;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 680px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.65rem 1.4rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Features Cards Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2.25rem 1.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 123, 200, 0.4);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

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

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(52, 107, 178, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
    color: #6fa0e6;
}

.feature-title {
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 4-Step Simple Educator Workflow */
.workflow-section {
    margin: 4rem auto 5.5rem;
    max-width: 1200px;
    position: relative;
    z-index: 10;
}

.workflow-header {
    text-align: center;
    margin-bottom: 3rem;
}

.workflow-title {
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.workflow-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
}

@media (max-width: 992px) {
    .workflow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .workflow-grid {
        grid-template-columns: 1fr;
    }
}

.workflow-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.workflow-card:hover {
    transform: translateY(-6px);
    border-color: rgba(74, 123, 200, 0.45);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.workflow-step-num {
    font-family: 'Outfit', 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #6fa0e6;
    background: rgba(52, 107, 178, 0.18);
    border: 1px solid rgba(74, 123, 200, 0.35);
    padding: 5px 14px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 1.3rem;
}

.workflow-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.workflow-card-title {
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
}

.workflow-card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* Stats banner */
.stats-banner {
    margin-top: 5rem;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
    backdrop-filter: blur(12px);
}

.stat-num {
    font-family: 'Cairo', 'Tajawal', 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border-glass);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(0.95); opacity: 1; }
}

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

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}
