/* Wiz School - Premium Frontend Styles (Full-Width & Responsive) */
:root {
    --wizm-glass: rgba(255, 255, 255, 0.7);
    --wizm-glass-border: rgba(255, 255, 255, 0.3);
    --wizm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --wizm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wizm-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --wizm-radius: 20px;
    --wizm-font: 'Outfit', 'Inter', sans-serif;
}

.wizm-course-wrapper {
    width: 100%;
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Fluid Layout Grid */
.wizm-course-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First */
    gap: 30px;
    max-width: 1600px; /* Expansive desktop max */
    margin: 0 auto;
}

/* Premium Header with Neural Mesh Gradient */
.wizm-course-header {
    background: linear-gradient(135deg, var(--wizm-primary) 0%, #1e293b 100%);
    color: #fff;
    padding: 60px 20px;
    border-radius: var(--wizm-radius);
    margin: 30px auto 60px auto; /* More bottom margin for ribbon pop */
    max-width: 1600px;
    position: relative;
    overflow: visible; /* ALLOW RIBBON WRAP OVERFLOW */
    box-shadow: var(--wizm-shadow-lg);
}

.wizm-course-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
    border-radius: var(--wizm-radius);
    z-index: 1;
}

/* Outcomes Checklist */
.wizm-outcomes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.wizm-outcome-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--wizm-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Review Slider */
.wizm-reviews-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 10px 0 20px 0;
    scrollbar-width: none;
}

.wizm-review-card {
    flex: 0 0 280px; /* Narrower for mobile */
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--wizm-shadow-md);
}

/* FAQ Accordions */
.wizm-faq-item {
    margin-bottom: 12px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.wizm-faq-question {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

/* Sidebar Styling */
.wizm-sidebar-card {
    background: var(--wizm-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--wizm-glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--wizm-shadow-md);
}

.wizm-btn-premium {
    background: var(--wizm-primary);
    color: #fff !important;
    padding: 15px 24px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    font-size: 16px;
    transition: transform 0.2s;
}

/* Header Thumb Pop */
.wizm-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.wizm-header-text {
    flex: 1;
}

.wizm-header-thumb {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%) rotateY(-20deg) rotateZ(2deg);
    width: 480px;
    height: 320px;
    border-radius: 4px; /* Sharper for ribbon look */
    z-index: 5;
    perspective: 1000px;
    transform-style: preserve-3d;
    box-shadow: 
        -15px 15px 40px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.1),
        0 0 0 4px rgba(255,255,255,0.05); /* Multi-layered shadow */
    border: 1px solid rgba(255,255,255,0.2);
    background: #000;
}

/* The Folds - Creating the "Wrap" Illusion */
.wizm-header-thumb::before,
.wizm-header-thumb::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 40px;
    background: #064e3b; /* Darker version of primary for fold shadow */
    z-index: -1;
}

.wizm-header-thumb::before {
    top: -40px;
    right: 0;
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.wizm-header-thumb::after {
    bottom: -40px;
    right: 0;
    clip-path: polygon(100% 100%, 0 0, 100% 0);
}

.wizm-header-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
}

/* Media Queries for Desktop Polish */
@media (min-width: 1024px) {
    .wizm-course-grid {
        grid-template-columns: 1fr 380px;
    }
    .wizm-course-header {
        padding: 80px 40px;
    }
    .wizm-sidebar-card {
        position: sticky;
        top: 40px;
        box-shadow: var(--wizm-shadow-lg);
    }
    .wizm-review-card {
        flex: 0 0 350px;
    }
}

/* Curriculum High-Polish Mobile */
@media (max-width: 1024px) {
    .wizm-header-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .wizm-header-thumb {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        height: 240px;
        margin-top: 40px;
        border-radius: 12px;
        overflow: hidden;
    }
    .wizm-header-thumb::before,
    .wizm-header-thumb::after {
        display: none; /* Turn off folds on mobile for cleaner stack */
    }
}

@media (max-width: 768px) {
    .wizm-course-header h1 {
        font-size: 32px !important;
    }
    .wizm-course-header {
        padding: 40px 20px;
        margin-bottom: 60px;
    }
    .wizm-outcome-card {
        padding: 12px;
    }
}

/* Concept Visualizer - Premium Styles */
.wizm-visualizer-toolbar {
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.wizm-quick-tool {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.wizm-quick-tool:hover {
    background: #f8fafc;
    border-color: var(--wizm-primary);
    color: var(--wizm-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.wizm-mermaid-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    background: #f8fafc;
    color: #1e293b;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.wizm-mermaid-input:focus {
    border-color: var(--wizm-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--wizm-primary-rgb), 0.1);
}

.wizm-mermaid-preview {
    padding: 20px;
}

.wizm-mermaid-preview svg {
    max-width: 100%;
    height: auto;
}

/* Wiz Nebula - Infinite Studio Styles */
.wizm-nebula-workspace {
    background: #fff; /* Default to white as requested */
    color: #1e293b;
    transition: background 0.3s;
}

.wizm-nebula-workspace.nebula-dark {
    background: #0f172a;
}

.wizm-nebula-grid {
    position: absolute; 
    inset: 0; 
    pointer-events: none; 
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px); 
    background-size: 30px 30px; 
    opacity: 0.5;
}

.nebula-dark .wizm-nebula-grid {
    background-image: radial-gradient(#334155 1px, transparent 1px);
}

.wizm-nebula-tools {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 8px 16px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 100;
}

.nebula-dark .wizm-nebula-tools {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.wizm-nebula-tools button {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
    padding: 5px;
    border-radius: 50%;
    color: inherit;
}

.wizm-nebula-tools button:hover {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(0,0,0,0.05);
}

.nebula-dark .wizm-nebula-tools button:hover {
    background: rgba(255,255,255,0.05);
}

.wizm-nebula-tools button.active {
    opacity: 1 !important;
    background: rgba(2, 132, 199, 0.1) !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.2);
    border: 1px solid rgba(2, 132, 199, 0.3);
}

.nebula-drawing-cursor {
    cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEyIDE5bC03IDNsMS03TDYgNmw3IDFsNy0xLTEgN3oiLz48L3N2Zz4="), crosshair !important;
}

.nebula-node {
    cursor: pointer;
    transition: filter 0.2s;
}

.nebula-node:hover {
    filter: drop-shadow(0 0 8px var(--wizm-primary));
}

.nebula-node.selected {
    filter: drop-shadow(0 0 12px var(--wizm-primary));
}

/* Mobile Drawer Handle */
@media (max-width: 768px) {
    .wizm-player-sidebar::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #e2e8f0;
        border-radius: 2px;
    }
}

/* --- Zen App Layout --- */
.wizm-lesson-player-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: #f8fafc;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.wizm-player-app-shell {
    display: flex;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* --- App Header (Glassmorphic) --- */
.wizm-app-header {
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: relative;
    z-index: 10010;
}

.wizm-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wizm-back-course {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.wizm-back-course:hover {
    background: var(--wizm-primary);
    color: #fff;
    transform: translateX(-3px);
}

.wizm-header-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
}

.wizm-course-info {
    display: flex;
    flex-direction: column;
}

.wizm-course-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--wizm-primary);
    letter-spacing: 0.1em;
}

.wizm-course-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.wizm-header-right {
    display: flex;
    align-items: center;
}

/* --- Student Profile & Neural Dropdown --- */
.wizm-user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
    padding: 8px 12px;
    border-radius: 15px;
    transition: all 0.2s;
}

.wizm-user-profile:hover {
    background: #f1f5f9;
}

.wizm-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wizm-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.wizm-user-status {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.wizm-user-profile img {
    border-radius: 12px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.wizm-profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 220px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid #f1f5f9;
    padding: 10px;
    display: none;
    flex-direction: column;
    z-index: 10015;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizm-profile-dropdown.active {
    display: flex;
    transform: translateY(0);
}

.wizm-profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.wizm-profile-dropdown a:hover {
    background: #f8fafc;
    color: var(--wizm-primary);
}

.wizm-profile-dropdown a .dashicons {
    color: #94a3b8;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.wizm-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 0;
}

.wizm-logout-link:hover {
    background: #fff1f2 !important;
    color: #ef4444 !important;
}

/* --- Layout Fine-tuning --- */
.wizm-player-sidebar {
    width: var(--l-sidebar-width, 320px);
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    position: relative;
}

.wizm-nebula-workspace {
    flex: 1;
    height: 100%;
    position: relative;
}

.nebula-node text {
    user-select: none;
    -webkit-user-select: none;
}

/* Fullscreen Studio Tweaks */
.wizm-nebula-workspace:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.wizm-nebula-workspace:fullscreen .wizm-nebula-tools {
    top: 40px;
    padding: 12px 24px;
}

/* --- Lesson Player Layout Engine --- */
:root {
    --l-sidebar-width: 340px;
    --l-sidebar-bg: #f8f9fc;
    --l-border: #e2e8f0;
}

.wizm-lesson-player-body {
    margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif;
    background: #fff; color: #333; overflow: hidden; height: 100vh;
}

.wizm-player-sidebar {
    width: var(--l-sidebar-width);
    height: 100vh;
    background: var(--l-sidebar-bg);
    border-right: 1px solid var(--l-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.4s;
    z-index: 1000;
}

.wizm-sidebar-collapsed .wizm-player-sidebar {
    margin-left: calc(-1 * var(--l-sidebar-width));
}

.wizm-player-content {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    background: #fff;
    transition: width 0.4s;
}

/* Sidebar Toggle Button */
.wizm-sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: #fff;
    border: 1px solid var(--l-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    z-index: 1001;
    transition: right 0.4s;
}

.wizm-sidebar-collapsed .wizm-sidebar-toggle {
    right: -45px;
    border-left: 1px solid var(--l-border);
    border-radius: 8px;
}

.wizm-sidebar-toggle::after {
    content: '‹';
    font-size: 24px;
    color: #94a3b8;
    transition: transform 0.4s;
}

.wizm-sidebar-collapsed .wizm-sidebar-toggle::after {
    transform: rotate(180deg);
}

/* Mobile Bottom Drawer Optimization */
@media (max-width: 768px) {
    .wizm-lesson-player-body {
        flex-direction: column;
        overflow: hidden; /* Prevent body scroll */
    }

    .wizm-app-header {
        padding: 0 15px; /* Tighter padding on mobile */
    }

    .wizm-course-name {
        font-size: 14px;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wizm-player-app-shell {
        height: calc(100vh - 70px);
        flex-direction: column;
    }

    .wizm-player-sidebar {
        width: 100%;
        height: 75vh;
        position: fixed;
        bottom: 0;
        left: 0;
        margin-left: 0 !important;
        border-right: none;
        border-top: 1px solid var(--l-border);
        border-radius: 30px 30px 0 0;
        box-shadow: 0 -15px 50px rgba(0,0,0,0.15);
        transform: translateY(calc(75vh - 60px)); /* Minimized by default */
        z-index: 10020;
    }

    .wizm-player-sidebar.drawer-open {
        transform: translateY(0);
    }

    .wizm-sidebar-toggle {
        top: -20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(90deg);
        width: 35px;
        height: 55px;
        border-radius: 10px 10px 0 0;
        background: var(--wizm-primary);
        border: none;
    }

    .wizm-sidebar-toggle::after {
        color: #fff;
    }

    .wizm-player-content {
        height: 100%;
        padding-bottom: 80px; /* Space for the drawer handle */
    }

    .wizm-lesson-main {
        padding: 30px 20px !important;
    }

    .wizm-lesson-title {
        font-size: 1.8rem !important;
    }
}

/* Internal Player Components */
.wizm-sidebar-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--l-border); }
.wizm-sidebar-tab { flex: 1; padding: 12px; font-size: 11px; text-transform: uppercase; font-weight: 800; color: #64748b; text-align: center; cursor: pointer; border-bottom: 2px solid transparent; }
.wizm-sidebar-tab.active { color: var(--wizm-primary); border-color: var(--wizm-primary); background: #f0fdf4; }
.wizm-sidebar-content { flex-grow: 1; overflow-y: auto; padding: 20px; display: none; }
.wizm-sidebar-content.active { display: block; }
.wizm-notes-area { width: 100%; height: 300px; border: none; background: #fff; padding: 15px; font-family: inherit; font-size: 14px; border-radius: 8px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); resize: none; outline: none; }
.wizm-notes-status { font-size: 11px; color: #94a3b8; margin-top: 5px; text-align: right; }
.wizm-player-header { padding: 20px; background: #fff; border-bottom: 1px solid var(--l-border); }
.wizm-player-header h1 { margin: 0; font-size: 16px; color: var(--wizm-primary); font-weight: 800; cursor: pointer; }

.wizm-lesson-main { max-width: 800px; margin: 0 auto; padding: 60px 40px; }
.wizm-lesson-title { font-size: 2.5rem; font-weight: 800; color: #111; margin-bottom: 40px; letter-spacing: -1px; line-height: 1.2; }
.wizm-lesson-body { font-size: 1.15rem; line-height: 1.8; color: #444; }
.wizm-lesson-body p { margin-bottom: 25px; }
.wizm-lesson-body img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin: 30px 0; }
.wizm-nav-bar { display: flex; justify-content: space-between; padding: 20px 40px; background: #fff; border-top: 1px solid var(--l-border); position: sticky; bottom: 0; max-width: 800px; margin: 0 auto; }

.wizm-btn { padding: 12px 24px; border-radius: 6px; font-weight: 700; text-decoration: none; cursor: pointer; transition: all 0.2s ease; display: inline-block; }
.wizm-btn-outline { border: 2px solid var(--l-border); color: #555; background: transparent; }
.wizm-btn-outline:hover { border-color: var(--wizm-primary); color: var(--wizm-primary); }
.wizm-btn-primary { background: var(--wizm-primary); color: white; border: 2px solid var(--wizm-primary); }
.wizm-btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,153,87,0.3); }

.wizm-media-stage { margin-bottom: 40px; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.wizm-video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.wizm-video-wrapper iframe, .wizm-video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0; }
.wizm-audio-wrapper { padding: 40px; background: #f1f5f9; text-align: center; }
