/* ==========================================================================
   Interactive Course Style System - "إتقان نموذج العمل التجاري"
   Premium Glassmorphism & Gamified UI
   ========================================================================== */

:root {
    --bg-base: #060913;
    --surface-glass: rgba(17, 24, 39, 0.7);
    --surface-hover: rgba(31, 41, 55, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: #6366f1;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #ec4899;
    --secondary-glow: rgba(236, 72, 153, 0.35);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
}

* {
    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: -15%; right: -10%; width: 600px; height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    filter: blur(50px); animation: pulse1 10s infinite alternate;
}
.light-2 {
    position: absolute; bottom: -15%; left: -10%; width: 600px; height: 600px;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    filter: blur(50px); animation: pulse2 12s infinite alternate;
}
@keyframes pulse1 { 0% { opacity: 0.4; transform: scale(0.9); } 100% { opacity: 0.8; transform: scale(1.1); } }
@keyframes pulse2 { 0% { opacity: 0.4; transform: scale(1); } 100% { opacity: 0.8; transform: scale(1.2); } }

/* Course Header & Gamification Bar */
.course-nav {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(6, 9, 19, 0.8); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass); padding: 1rem 0;
}
.nav-wrapper {
    width: 90%; 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: 44px; height: 44px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; box-shadow: 0 0 15px var(--primary-glow);
}

.gamification-stats { display: flex; align-items: center; gap: 1.25rem; }
.stat-pill {
    display: flex; align-items: center; gap: 0.5rem; background: var(--surface-glass); border: 1px solid var(--border-glass); padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 700; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.xp-icon { color: #fbbf24; font-size: 1.1rem; }
.level-badge { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; padding: 0.15rem 0.6rem; border-radius: 50px; font-size: 0.8rem; font-weight: 900; }
.btn-nav-exit {
    background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--border-glass); padding: 0.5rem 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 15px rgba(239,68,68,0.4); }

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

/* Roadmap Header */
.roadmap-hero { text-align: center; margin-bottom: 3.5rem; position: relative; }
.roadmap-hero h1 { font-size: 2.8rem; font-weight: 900; margin-bottom: 0.75rem; background: linear-gradient(135deg, #fff, var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.roadmap-hero p { font-size: 1.15rem; 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; }

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

.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 1.25rem; }
.mod-title { font-size: 1.6rem; font-weight: 900; color: #fff; display: flex; align-items: center; gap: 1rem; }
.mod-num { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 900; box-shadow: 0 0 10px var(--primary-glow); }
.mod-desc { color: var(--text-muted); font-size: 1rem; 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(10, 15, 30, 0.5); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 1.5rem; transition: all 0.3s ease; display: flex; flex-direction: column; position: relative; overflow: hidden; text-decoration: none; color: var(--text-main);
}
.item-card:hover:not(.locked) {
    transform: translateY(-5px); border-color: var(--primary); background: rgba(30, 41, 59, 0.6); box-shadow: 0 10px 20px var(--primary-glow);
}
.item-card.locked { opacity: 0.5; filter: grayscale(80%); cursor: not-allowed; }

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

.item-badge { background: rgba(255,255,255,0.05); padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; gap: 0.3rem; }
.badge-xp { color: #fbbf24; }

.item-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.5rem; color: #fff; }
.item-summary { font-size: 0.85rem; 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.8rem; color: var(--text-muted); }
.status-indicator { display: flex; align-items: center; gap: 0.4rem; }
.indicator-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.completed .indicator-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.in-progress .indicator-dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }

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

/* Interactive Canvas & Simulators */
.interactive-box { background: rgba(10, 15, 30, 0.6); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 2rem; margin: 2rem 0; box-shadow: inset 0 0 15px rgba(0,0,0,0.5); }

/* Buttons & Inputs */
.btn-action { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: none; padding: 0.75rem 1.75rem; border-radius: 8px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; gap: 0.5rem; box-shadow: 0 8px 16px -4px var(--primary-glow); }
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 12px 24px var(--primary-glow); filter: brightness(1.1); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-main); border: 1px solid var(--border-glass); padding: 0.75rem 1.75rem; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.3s; }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.custom-slider { width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); outline: none; -webkit-appearance: none; accent-color: var(--primary); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); 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-glass); border-radius: var(--radius-md); width: 90%; max-width: 550px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,0.7); transform: scale(0.95); transition: 0.3s; text-align: center; }
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 1rem; left: 1rem; background: rgba(255,255,255,0.06); border: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--danger); }

/* Toast Notifications */
.toast-box { position: fixed; bottom: 2rem; left: 2rem; z-index: 3000; background: rgba(16, 185, 129, 0.95); backdrop-filter: blur(10px); color: #fff; padding: 0.8rem 1.5rem; border-radius: 50px; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; box-shadow: 0 10px 25px rgba(0,0,0,0.4); transform: translateY(100px); opacity: 0; transition: 0.3s 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.2rem; }
    .lesson-container { padding: 1.5rem; }
}
