/* ============================================================
   IcyKit Academy — Course UI Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    /* Reusing core palette from index.css */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111119;
    --bg-sidebar: #0f0f15;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-elevated: #1e1e2a;

    --accent-blue: #38bdf8;
    --accent-violet: #a78bfa;
    --accent-cyan: #22d3ee;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);

    --sidebar-width: 320px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --- Utilities --- */
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ============================================================
      SIDEBAR
      ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar__header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 15, 21, 0.8);
    backdrop-filter: blur(10px);
}

.sidebar__logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar__logo-icon {
    color: var(--accent-cyan);
}

.sidebar__back {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar__back:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.sidebar__progress {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.progress__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress__text.complete {
    color: #10b981;
}

.progress__bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 100px;
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    border-radius: 100px;
    transition: width 0.5s ease;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

/* Scrollbar stylisée */
.sidebar__nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 10px;
}

.nav__section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.75rem 0.5rem;
}

.nav__section-title:first-child {
    margin-top: 0;
}

.nav__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    position: relative;
}

.nav__item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav__item.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.nav__item.locked {
    opacity: 0.5;
    pointer-events: none;
}

.nav__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.nav__item.completed .nav__item-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.nav__item.active .nav__item-icon {
    background: var(--accent-gradient);
    color: #fff;
}

.nav__item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav__item-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}

.nav__item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
      MAIN CONTENT AREA
      ============================================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background: var(--bg-primary);
    background-image: radial-gradient(circle at top right, rgba(167, 139, 250, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.05) 0%, transparent 40%);
}

.header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.header__mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
}

.header__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header__badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.header__actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
}

.btn--primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ============================================================
      MODULE CONTENT VIEWS
      ============================================================ */
.content-scroll-area {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) transparent;
    scroll-behavior: smooth;
}

.content-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.content-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-scroll-area::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 10px;
}

.module-view {
    display: none;
    padding: 3rem 2rem 6rem;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease forwards;
}

.module-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module__header {
    margin-bottom: 3rem;
}

.module__tag {
    display: inline-block;
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.module__title {
    font-size: 2.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.module__desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
}

/* --- Video Placeholder (If needed) --- */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(22, 22, 31, 0.8), rgba(10, 10, 15, 0.9));
    color: var(--text-muted);
}

.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--glow-blue);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-btn:hover {
    transform: scale(1.1);
}

.play-btn .icon {
    width: 24px;
    height: 24px;
    margin-left: 4px;
    /* Optical optical alignment */
}

/* --- Text Content Styles --- */
.prose {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.prose h2 {
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem;
}

.prose h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    color: var(--text-primary);
}

/* ============================================================
      PROMPT CARDS (The core value)
      ============================================================ */
.prompt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.prompt-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.prompt__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.prompt__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.prompt__logic {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.prompt__badge {
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent-violet);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.prompt__code-wrapper {
    position: relative;
    margin-top: 1.5rem;
}

.prompt__code {
    background: #0d0d12;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    white-space: pre-wrap;
    line-height: 1.6;
}

.prompt__var {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.prompt__copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.prompt__copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.prompt__copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* ============================================================
      CHECKLIST / ROADMAP
      ============================================================ */
.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.checklist li .icon {
    color: #10b981;
    margin-top: 2px;
}

.checklist li.dont .icon {
    color: #ef4444;
}

/* ============================================================
      NAVIGATION FOOTER (Next/Prev)
      ============================================================ */
.module-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.module-nav__btn {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.2s;
    min-width: 200px;
}

.module-nav__btn.next {
    text-align: right;
    align-items: flex-end;
}

.module-nav__btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.module-nav__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.module-nav__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
      MOBILE RESPONSIVENESS
      ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .header__mobile-toggle {
        display: block;
    }

    .header {
        padding: 0 1rem;
    }

    .module-view {
        padding: 2rem 1rem 4rem;
    }
}

@media (max-width: 640px) {
    .module-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .module-nav__btn {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }
}