/* ==========================================================================
   TUTORIAL THRE-COLUMN LAYOUT SYSTEM
   ========================================================================== */
:root {
    --sb-bg: #1e293b;            
    --sb-text: #94a3b8;          
    --sb-hover-bg: #334155;      
    --sb-hover-text: #f8fafc;    
    --sb-active-bg: #ef4444;     
    --sb-active-text: #ffffff;
    
    --canvas-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    /* Code Blue Mock Palette */
    --code-bg: #f8fafc;
    --code-border: #38bdf8;
}

.tutorial-page-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    width: 100% !important;
    align-items: flex-start !important;
    box-sizing: border-box !important;
    padding: 20px !important;
}

/* LEFT COLUMN RULES */
/* ==========================================================================
   PREMIUM SIDEBAR SYSTEM (UI/UX RESTORATION & OVERHAUL)
   ========================================================================== */
.tutorial-sidebar {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    background: #0f172a !important;       /* Deep high-end slate background */
    border: 1px solid #1e293b !important;   /* Subtle divider border */
    border-radius: 12px !important;
    padding: 24px 16px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;     /* Locks vertical stack structure */
    gap: 20px !important;
}

/* Brand Header Area */
.sidebar-brand-wrapper {
    padding: 0 8px 16px 8px !important;
    border-bottom: 1px solid #1e293b !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.sidebar-brand-wrapper h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #f8fafc !important;             /* Clear crisp brand name visibility */
    margin: 0 !important;
    letter-spacing: -0.5px !important;
}

.sidebar-brand-subtext {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #64748b !important;             /* Clean tech-slate description style */
    margin: 0 !important;
}

/* Navigation Element Structures */
.sidebar-navigation-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    width: 100% !important;
}

.sidebar-menu-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
}

/* Premium Category Header Block */
.sidebar-group-heading {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;             /* Clean, readable category color */
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    user-select: none !important;
}

.heading-status-icon {
    font-size: 11px !important;
    color: #38bdf8 !important;             /* Beautiful focused Cyan engineering color */
}

/* Subitem Lists */
.sidebar-subitem-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;     /* Forces vertical stacked drop down items */
    gap: 4px !important;
    width: 100% !important;
}

.sidebar-subitem-node {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Modern Navigation Interactive Link Anchors */
.sidebar-navigation-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    color: #94a3b8 !important;             /* Easily readable slate item links */
    font-size: 13.5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.navigation-link-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.dynamic-link-arrow {
    font-size: 12px !important;
    opacity: 0 !important;
    transform: translateX(-4px) !important;
    transition: all 0.2s ease !important;
    color: #38bdf8 !important;
}

/* Hover Interactive Mechanics */
.sidebar-navigation-link:hover {
    background: #1e293b !important;        /* Clean highlight background layer on hover */
    color: #f1f5f9 !important;
    transform: translateX(2px) !important;
}

/* Modern Focused Engineering Active State Styles */
.sidebar-navigation-link.active {
    background: rgba(56, 189, 248, 0.08) !important; /* Premium code blue glow effect tint */
    border-color: rgba(56, 189, 248, 0.2) !important;
    color: #38bdf8 !important;                       /* Vibrant high-contrast cyan highlight */
    font-weight: 600 !important;
}

.sidebar-navigation-link.active .dynamic-link-arrow {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Empty State Fallbacks */
.sidebar-empty-fallback {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 8px !important;
    color: #64748b !important;
    text-align: center !important;
}
.sidebar-empty-fallback i { font-size: 20px !important; margin-bottom: 6px !important; }
.sidebar-empty-fallback p { font-size: 12px !important; margin: 0 !important; }

/* CENTER COLUMN: CANVAS WORKBENCH */
.tutorial-main-canvas {
    flex: 1 !important;
    min-width: 0 !important;
    background: var(--canvas-bg) !important;
    border-radius: 12px !important;
    padding: 32px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01) !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   CODE SECTION DISPLAY ARCHITECTURE (As per image_ad6368.png)
   ========================================================================== */
.tutorial-code-section {
    width: 100% !important;
    margin: 24px 0 32px 0 !important;
    border-left: 4px solid var(--code-border) !important;
    border-radius: 4px 8px 8px 4px !important;
    background: var(--code-bg) !important;
    border-top: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
}

.code-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
}

.copy-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
}
.copy-btn:hover { background: #0f172a !important; color: #ffffff !important; }

.code-block-wrapper pre {
    margin: 0 !important;
    padding: 16px !important;
    overflow-x: auto !important;
}

.code-block-wrapper code {
    font-family: 'Consolas', 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #0f172a !important;
    white-space: pre !important;
}

/* ==========================================================================
   RIGHT COLUMN: POPULAR ARTICLES SIDEBAR
   ========================================================================== */
.tutorial-right-sidebar {
    width: 300px !important;
    min-width: 300px !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 24px 16px !important;
    box-sizing: border-box !important;
}

.right-sidebar-header h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 0 16px 0 !important;
    border-bottom: 2px solid #f1f5f9 !important;
    padding-bottom: 10px !important;
}

.right-sidebar-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.popular-mini-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

.mini-card-content {
    padding: 16px !important;
}

.mini-tag {
    font-size: 10px !important;
    background: #e2e8f0 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-weight: 600;
    color: #334155;
}

.popular-mini-card h4 {
    font-size: 15px !important;
    margin: 8px 0 4px 0 !important;
    color: var(--text-main) !important;
}

.popular-mini-card p {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.4 !important;
}

.mini-card-link {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--sb-active-bg) !important;
    text-decoration: none !important;
}

/* VIDEO WRAPPER CONTROLS */
.video-wrapper {
    position: relative !important; padding-bottom: 56.25% !important; border-radius: 10px !important;
    overflow: hidden !important; background: #000000 !important; height: 0 !important; width: 100% !important;
}
.video-wrapper iframe { position: absolute !important; width: 100% !important; height: 100% !important; top: 0 !important; left: 0 !important; border: 0 !important; }

.tutorial-nav-buttons { display: flex !important; justify-content: space-between !important; margin-top: 20px !important; }
.nav-btn {
    padding: 10px 20px !important; border-radius: 6px !important; font-size: 14px !important; font-weight: 600 !important;
    border: none !important; cursor: pointer !important; color: #fff !important; background: #e11d48 !important;
}

/* RESPONSIVE RE-FLOW ENGINE */
@media(max-width: 1200px) {
    .tutorial-page-container { flex-direction: column !important; }
    .tutorial-sidebar, .tutorial-right-sidebar { width: 100% !important; min-width: 100% !important; }
}

/* Dual Navigation Alignment Adjustments */
.tutorial-nav-buttons.top-nav-layout {
    margin-bottom: 24px !important;
    margin-top: 0 !important;
}

.tutorial-nav-buttons.bottom-nav-layout {
    margin-top: 32px !important;
    margin-bottom: 0 !important;
}

/* Right Sidebar Cards Image Styling */
.mini-card-image-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 140px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #0f172a !important;
    margin-bottom: 12px !important;
}

.mini-card-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Beautiful custom code backup styling if base path fails to load asset */
.mini-card-fallback-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 18px !important;
}

.mini-tag-overlay {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    font-size: 10px !important;
    background: rgba(239, 68, 68, 0.9) !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   DYNAMIC OUTPUT SECTION ARCHITECTURE
   ========================================================================== */
.tutorial-output-section {
    width: 100% !important;
    margin: -16px 0 32px 0 !important; /* Combines beautifully directly under the code editor box */
    border-radius: 8px !important;
    background: #0f172a !important; /* Sleek terminal dark color */
    border: 1px solid #1e293b !important;
    overflow: hidden !important;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.output-header {
    padding: 8px 16px !important;
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #38bdf8 !important; /* Cool console blue label text */
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.output-block-wrapper pre {
    margin: 0 !important;
    padding: 16px !important;
    overflow-x: auto !important;
}

.output-block-wrapper code {
    font-family: 'Consolas', 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #f8fafc !important; /* High contrast terminal text output */
    white-space: pre-wrap !important; /* Preserves explicit line breaks */
}

/* Sidebar Header/Subheading Layout */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-group-heading {
    padding: 14px 16px 6px 16px;
    font-size: 15px;
    font-weight: 800;
    color: #94a3b8; /* Subtle clean muted grey text */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    user-select: none;
}

.menu-subitem a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 24px; /* Slightly indented left padding for clean hierarchy */
    font-size: 14px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.menu-subitem a:hover, 
.menu-subitem a.active {
    background: #1e293b;
    color: #38bdf8;
}