/* ==========================================================================
   Interactive Course Style System - "كيف تبدأ مشروع"
   Premium Glassmorphism & Gamified UI
   ========================================================================== */

:root {
    --bg-base: #0b0f19;
    --surface-glass: rgba(26, 35, 50, 0.75);
    --surface-hover: rgba(36, 48, 69, 0.85);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-active: #6366f1;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --secondary-glow: rgba(236, 72, 153, 0.4);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    direction: rtl;
}

/* Ambient Background Lights */
.bg-ambient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden; pointer-events: none;
}
.light-1 {
    position: absolute; top: -200px; right: -200px; width: 700px; height: 700px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    filter: blur(60px); animation: pulse1 12s infinite alternate;
}
.light-2 {
    position: absolute; bottom: -200px; left: -200px; width: 700px; height: 700px;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    filter: blur(60px); animation: pulse2 15s infinite alternate;
}
@keyframes pulse1 { 0% { opacity: 0.5; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); } }
@keyframes pulse2 { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 1; transform: scale(1.3); } }

/* Course Header & Gamification Bar */
.course-nav {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border-glass); padding: 1rem 0;
}
.nav-wrapper {
    width: 92%; max-width: 1400px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.course-brand {
    display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.5rem;
}
.brand-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 0 20px var(--primary-glow);
}

.gamification-stats { display: flex; align-items: center; gap: 1.5rem; }
.stat-pill {
    display: flex; align-items: center; gap: 0.75rem; background: var(--surface-glass); border: 1px solid var(--border-glass); padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 700; font-size: 0.95rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.xp-icon { color: #f59e0b; font-size: 1.2rem; }
.level-badge { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; padding: 0.2rem 0.75rem; border-radius: 50px; font-size: 0.85rem; font-weight: 800; }
.btn-nav-exit {
    background: rgba(255,255,255,0.08); color: var(--text-main); border: 1px solid var(--border-glass); padding: 0.6rem 1.25rem; border-radius: 50px; text-decoration: none; font-weight: 700; transition: 0.3s;
}
.btn-nav-exit:hover { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 20px rgba(239,68,68,0.5); }

/* Main Container */
.main-content {
    width: 92%; max-width: 1400px; margin: 2rem auto 6rem; flex-grow: 1;
}

/* Roadmap Header */
.roadmap-hero { text-align: center; margin-bottom: 4rem; position: relative; }
.roadmap-hero h1 { font-size: 3.2rem; font-weight: 900; margin-bottom: 1rem; background: linear-gradient(135deg, #fff, var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.roadmap-hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 800px; margin: 0 auto; line-height: 1.7; }

/* Skill Tree & Modules Grid */
.roadmap-container { display: flex; flex-direction: column; gap: 3rem; position: relative; }
.roadmap-container::before {
    content: ''; position: absolute; top: 2rem; bottom: 2rem; right: 40px; width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary), var(--accent));
    border-radius: 4px; opacity: 0.3;
}

.module-group {
    background: var(--surface-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 2.5rem; position: relative; backdrop-filter: blur(20px); box-shadow: 0 15px 35px rgba(0,0,0,0.3); transition: 0.3s;
}
.module-group:hover { border-color: rgba(99, 102, 241, 0.4); box-shadow: 0 20px 50px rgba(0,0,0,0.5); }

.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 1.5rem; }
.mod-title { font-size: 1.8rem; font-weight: 900; color: #fff; display: flex; align-items: center; gap: 1rem; }
.mod-num { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; box-shadow: 0 0 15px var(--primary-glow); }
.mod-desc { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }

/* Items List (Lessons/Games/Tools) */
.items-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.item-card {
    background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 1.75rem; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column; position: relative; overflow: hidden; text-decoration: none; color: var(--text-main);
}
.item-card:hover:not(.locked) {
    transform: translateY(-8px); border-color: var(--primary); background: rgba(30, 41, 59, 0.8); box-shadow: 0 15px 30px var(--primary-glow);
}
.item-card.locked { opacity: 0.6; filter: grayscale(50%); cursor: not-allowed; border-color: rgba(255,255,255,0.05); }

.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.item-icon { width: 56px; height: 56px; border-radius: var(--radius-sm); background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); display: flex; align-items: center; justify-content: center; font-size: 1.75rem; color: var(--primary); }
.item-card.game .item-icon { background: rgba(236, 72, 153, 0.15); border-color: rgba(236, 72, 153, 0.3); color: var(--secondary); }
.item-card.tool .item-icon { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: var(--accent); }

.item-badge { background: rgba(255,255,255,0.08); padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.badge-xp { color: #f59e0b; }

.item-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; color: #fff; }
.item-summary { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; flex-grow: 1; }

.item-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border-glass); font-weight: 700; font-size: 0.9rem; }
.status-indicator { display: flex; align-items: center; gap: 0.5rem; }
.indicator-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.completed .indicator-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.in-progress .indicator-dot { background: var(--primary); box-shadow: 0 0 10px var(--primary); }

/* Lesson Page UI */
.lesson-container { background: var(--surface-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 3rem; backdrop-filter: blur(25px); box-shadow: 0 20px 50px rgba(0,0,0,0.5); margin-bottom: 3rem; }
.lesson-head { text-align: center; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-glass); }
.lesson-head h1 { font-size: 2.8rem; font-weight: 900; color: var(--primary); margin-bottom: 0.5rem; }
.lesson-head p { font-size: 1.2rem; color: var(--text-muted); }

/* Interactive Canvas & Simulators */
.interactive-box { background: rgba(15, 23, 42, 0.7); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 2.5rem; margin: 2rem 0; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.canvas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.canvas-card { background: var(--surface-glass); border: 1px dashed var(--border-glass); border-radius: var(--radius-sm); padding: 1.5rem; transition: 0.3s; cursor: pointer; }
.canvas-card:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.1); transform: scale(1.02); }
.canvas-card h4 { font-size: 1.15rem; color: #fff; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.canvas-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Buttons & Inputs */
.btn-action { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: none; padding: 0.8rem 2rem; border-radius: var(--radius-sm); font-weight: 800; font-size: 1.05rem; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; gap: 0.75rem; box-shadow: 0 10px 20px -5px var(--primary-glow); }
.btn-action:hover { transform: translateY(-3px); box-shadow: 0 15px 30px var(--primary-glow); filter: brightness(1.1); }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-main); border: 1px solid var(--border-glass); padding: 0.8rem 2rem; border-radius: var(--radius-sm); font-weight: 800; cursor: pointer; transition: 0.3s; }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.form-input { width: 100%; padding: 1rem 1.25rem; border-radius: var(--radius-sm); background: rgba(11, 15, 25, 0.8); border: 1px solid var(--border-glass); color: #fff; font-size: 1rem; outline: none; transition: 0.3s; margin-bottom: 1.5rem; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box { background: var(--bg-base); border: 1px solid var(--border-active); border-radius: var(--radius-lg); width: 90%; max-width: 650px; padding: 2.5rem; box-shadow: 0 25px 60px rgba(0,0,0,0.7); transform: scale(0.9); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 1.5rem; left: 1.5rem; background: rgba(255,255,255,0.1); border: none; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 1.25rem; cursor: pointer; transition: 0.3s; }
.modal-close:hover { background: var(--danger); transform: rotate(90deg); }

/* Toast Notifications */
.toast-box { position: fixed; bottom: 2rem; left: 2rem; z-index: 3000; background: rgba(16, 185, 129, 0.95); backdrop-filter: blur(15px); color: #fff; padding: 1rem 1.75rem; border-radius: 50px; font-weight: 800; display: flex; align-items: center; gap: 0.75rem; box-shadow: 0 15px 35px rgba(0,0,0,0.4); transform: translateY(100px); opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toast-box.show { transform: translateY(0); opacity: 1; }

@media(max-width: 768px) {
    .roadmap-hero h1 { font-size: 2.4rem; }
    .lesson-container { padding: 1.75rem; }
    .canvas-grid { grid-template-columns: 1fr; }
}
