/* CipherBoy Ultimate Terminal Style v6.0
   Theme: Phosphorus Green & Cyber-Intelligence
   Features: Smart Navbar, Responsive Grid, Lesson UI, Interactive Quizzes
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&family=Share+Tech+Mono&display=swap');

:root {
    --glow-color: #45ff45;
    --primary-dim: rgba(69, 255, 69, 0.2);
    --bg-color: #1a1a1a;
    --input-bg: #2c2c2c;
    --border-color: #3c3c3c;
    --text-glow: 0 0 10px #45ff45, 0 0 20px rgba(69, 255, 69, 0.4);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.6;
    overflow-x: hidden;
}

body[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

/* 2. Global Background (الروح القديمة) */
.full-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(26, 26, 26, 0.9), rgba(26, 26, 26, 0.95)), url('cipherboy.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 25px;
}

/* 3. Smart Header & Nav */
header {
    background: rgba(26, 26, 26, 0.98);
    border-bottom: 2px solid var(--glow-color);
    box-shadow: 0 0 15px rgba(69, 255, 69, 0.2);
    padding: 12px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.4s ease-in-out;
}

header.nav-hidden {
    transform: translateY(-100%);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 55px;
    filter: drop-shadow(0 0 8px var(--glow-color));
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--glow-color);
    text-shadow: var(--text-glow);
    border-bottom: 2px solid var(--glow-color);
}

/* 4. Hero Section */
.hero {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    color: var(--glow-color);
    text-shadow: var(--text-glow);
    margin-bottom: 10px;
    font-weight: 900;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    max-width: 800px;
    color: #a0a0a0;
    margin-bottom: 40px;
}

/* 5. Lesson UI & Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding-bottom: 80px;
}

.card, .lesson-main-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 35px;
    transition: var(--transition);
    position: relative;
    margin-top: 20px;
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
}

.card:hover {
    border-color: var(--glow-color);
    box-shadow: inset 0 0 10px rgba(69, 255, 69, 0.1), 0 5px 20px rgba(0,0,0,0.5);
    transform: translateY(-5px);
}

/* Video Wrapper (Fix Drive) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border: 2px solid var(--border-color);
    margin: 30px 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* Python Code Blocks */
pre {
    background: #000;
    padding: 20px;
    border-left: 4px solid var(--glow-color);
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9rem;
}

pre, code {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext; 
}

code {
    color: #d1d5db;
    font-family: 'Share Tech Mono', monospace;
}

/* 6. Interactive Quiz Engine UI */
.quiz-container {
    margin-top: 50px;
    padding: 30px;
    border: 1px dashed var(--glow-color);
    background: rgba(0, 0, 0, 0.3);
}

.quiz-question {
    font-size: 1.2rem;
    color: var(--glow-color);
    margin-bottom: 20px;
}

.quiz-option {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover, .quiz-option.selected {
    border-color: var(--glow-color);
    background: rgba(69, 255, 69, 0.1);
}

.quiz-option.correct {
    background: rgba(69, 255, 69, 0.3) !important;
    border-color: var(--glow-color) !important;
    color: #fff;
}

.quiz-option.wrong {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: #ef4444 !important;
}

/* 7. Buttons & Utilities */
.btn-action {
    background: transparent;
    border: 2px solid var(--glow-color);
    color: var(--glow-color);
    padding: 12px 35px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
}

.btn-action:hover {
    background: var(--glow-color);
    color: #000;
    box-shadow: var(--text-glow);
}

/* 8. Footer */
footer {
    border-top: 2px solid var(--border-color);
    padding: 60px 0;
    text-align: center;
    background: #111;
    position: relative;
    z-index: 10;
}

/* 9. Mobile Responsiveness */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--glow-color);
    transition: var(--transition);
}

@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: var(--bg-color);
        width: 100%;
        height: calc(100vh - 80px);
        padding: 40px;
        transition: 0.5s;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 600px) {
    .lesson-nav {
        flex-direction: column;
    }
}