/* 
 * SnLycee Design System
 * Modern Scientific Aesthetic (Biology & Chemistry)
 * Glassmorphism, Dark UI, RTL support.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Tajawal:wght@300;400;700&display=swap');

:root {
    --bg-dark: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(147, 51, 234, 0.2);
    --primary-sci: #9333ea; /* Purple */
    --accent-energy: #db2777; /* Pink/Magenta */
    --warning-dna: #06b6d4; /* Cyan */
    --text-main: #1e293b;
    --text-dim: #475569;
    --sidebar-width: 280px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background: radial-gradient(circle at top right, #faf5ff, #ffffff);
    color: var(--text-main);
    font-family: 'Tajawal', 'Outfit', sans-serif;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Shell */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(250, 245, 255, 0.8);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-glass);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: var(--transition-smooth);
    z-index: 100;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-sci), var(--accent-energy));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit';
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
    color: var(--text-dim);
}

.nav-item:hover, .nav-item.active {
    background: rgba(147, 51, 234, 0.1);
    color: var(--primary-sci);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.05);
}

.badge-soon {
    background: rgba(219, 39, 119, 0.1);
    color: var(--accent-energy);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: auto;
}

.nav-item i {
    font-size: 1.2rem;
}

/* Main Workspace */
.main-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Glass Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.08);
    animation: fadeInSlide 0.6s ease-out;
    margin: 0 auto;
}

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

/* Workflow Steps */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-glass);
    z-index: -1;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-dim);
    transition: var(--transition-smooth);
}

.step.active {
    background: var(--primary-sci);
    border-color: var(--primary-sci);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.step.completed {
    background: var(--accent-energy);
    border-color: var(--accent-energy);
    color: var(--bg-dark);
}

/* Typography & Content */
h1, h2, h3 { color: var(--text-main); line-height: 1.3; }
p { color: var(--text-dim); line-height: 1.6; font-size: 1.1rem; }

/* Interactive Elements */
.sci-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    padding: 1.2rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    margin: 1.5rem 0;
    transition: var(--transition-smooth);
}

.sci-input:focus {
    outline: none;
    border-color: var(--primary-sci);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.sci-button {
    background: linear-gradient(135deg, var(--primary-sci), #c084fc);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sci-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

/* Timer HUD */
.timer-hud {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
}

.timer-display {
    font-family: 'Outfit';
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-energy);
}

/* Flashcards */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 400px;
    height: 300px;
    margin: 2rem auto;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    text-align: center;
}

.card-back {
    transform: rotateY(180deg);
    background: rgba(58, 237, 185, 0.1);
    border-color: var(--accent-energy);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container { flex-direction: column; height: auto; }
    
    .sidebar { 
        width: 100%; 
        height: auto; 
        padding: 1rem;
        border-left: none;
        border-bottom: 1px solid var(--border-glass);
        gap: 1rem;
    }

    .logo {
        text-align: center;
        margin-bottom: 0;
    }

    .nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0;
    }

    .nav-links li:nth-child(1) {
        grid-column: span 2;
    }

    .nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.6rem;
        gap: 0.4rem;
        text-align: center;
    }

    .nav-item i {
        font-size: 1.2rem;
    }

    .nav-item span {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .badge-soon {
        margin: 0;
        padding: 0.1rem 0.4rem;
        font-size: 0.65rem;
    }

    .sidebar-footer {
        display: none; /* Hide theme toggle or push to secondary menu on mobile */
    }

    .main-workspace { 
        padding: 1rem; 
        min-height: calc(100vh - 150px);
    }

    /* Magazine Responsive Defaults Override */
    .mag-main-card { padding: 1.5rem 1rem !important; }
    .mag-content-card { padding: 1.5rem 1rem !important; }
    .mag-hero { flex-direction: column !important; text-align: center !important; }
    .mag-hero-text { text-align: center !important; }
    .mag-hero-badges { justify-content: center !important; }
    .mag-title { font-size: 2.2rem !important; }
    .mag-subtitle { font-size: 1.2rem !important; }
    .mag-contact-row { flex-direction: column !important; gap: 1rem !important; }
    .glass-card { padding: 1.5rem !important; }
}
