@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CRITICAL OVERRIDES (Top Priority) --- */

/* 1. Hide LearnPress Curriculum/Sidebar */
#learn-press-course-curriculum,
.course-curriculum,
.lp-sidebar,
#secondary,
#sidebar,
.sidebar,
aside.widget-area,
.bloghash-sidebar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* 2. Force Black Title */
.entry-title,
h1.entry-title,
.fs-lesson-title h1,
h1 {
    color: #000000 !important;
}

/* App Container Wrapper */
.fs-app-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    /* Clip inner content */
    margin: 2rem 0;
}

.fs-lesson-wrapper {
    font-family: 'Inter', sans-serif;
    color: #334155;
    display: flex;
    min-height: auto;
    /* Allow content to dictate height */
    /* Ensure height for sticky sidebar */
    position: relative;
    max-width: 100%;
    background-color: #fff;
    font-size: 18px;
    /* Increased font size */
    line-height: 1.7;
    /* Better readability */
}

/* Sidebar Styles */
.fs-sidebar {
    width: 14rem;
    /* Optimized Width */
    background: #fff;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
}

.fs-sidebar.collapsed {
    width: 3.5rem;
    /* Slightly smaller collapsed state */
}

.fs-sidebar-content {
    width: 14rem;
    /* Match sidebar width */
    padding: 1.5rem;
}

/* Enhanced Toggle Button */
.fs-toggle-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    /* Larger */
    height: 2.5rem;
    /* Larger */
    border-radius: 0.5rem;
    border: 1px solid #2563eb;
    /* Blue border */
    background: #3b82f6;
    /* Blue background */
    color: #ffffff;
    /* White icon */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Shadow */
    transition: all 0.2s;
}

.fs-toggle-btn:hover {
    background: #2563eb;
    /* Darker blue */
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.fs-sidebar.collapsed .fs-toggle-btn {
    right: 50%;
    transform: translateX(50%);
    background: #f8fafc;
    /* Ghost styling when collapsed to not be distracting */
    border-color: #e2e8f0;
    color: #64748b;
    box-shadow: none;
}

.fs-sidebar.collapsed .fs-toggle-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Hide text in collapsed mode */
.fs-sidebar.collapsed .fs-nav-text,
.fs-sidebar.collapsed .fs-sidebar-header {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.fs-sidebar-header span {
    font-size: 0.875rem;
    /* 14px was xs */
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #1e293b;
}

h4.fs-sidebar-header {
    font-size: 0.75rem;
    /* 12px was 10px */
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.fs-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    /* More padding */
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.fs-nav-text {
    font-size: 1rem;
    /* 16px was sm */
    font-weight: 500;
}

.fs-nav-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.fs-nav-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 1rem;
    color: #94a3b8;
}

.fs-nav-item:hover .fs-nav-icon {
    color: #2563eb;
}

/* Collapsible Sections & Main Content */
.fs-content-area {
    flex: 1;
    /* Grow to fill available space */
    padding: 2rem;
    /* Reduced padding from 3rem 4rem to just 2rem all around */
    min-width: 0;
    /* Prevent flex overflow */
    transition: all 0.3s ease;
    /* Smooth transition when sidebar resizes */
    width: 100%;
    /* Ensure it tries to take full width */
}

/* When sidebar is collapsed, content automatically expands because flex: 1 */
/* Ensure container allows full width */
.fs-lesson-wrapper {
    /* Existing styles... */
    width: 100%;
}

.fs-collapsible-header {
    cursor: pointer;
    padding: 1.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.fs-collapsible-header h2 {
    font-size: 1.25rem;
    /* Larger headers */
    font-weight: 700;
    color: #1e293b;
}

.fs-collapsible-header.active {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    margin-bottom: 0;
}

/* Slide Layout */
.fs-slide {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.fs-slide.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Navigation Bar */
.fs-slide-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.fs-slide-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
}

.fs-slide-btn:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}

.fs-slide-btn.primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.fs-slide-btn.primary:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.fs-slide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

/* Progress Indicator */
.fs-progress-container {
    flex-grow: 1;
    margin: 0 2rem;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.fs-progress-bar {
    height: 100%;
    background-color: #2563eb;
    width: 0%;
    transition: width 0.3s ease;
}

/* Interactive Risk Matrix */
.fs-risk-matrix {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    /* Label + 3 Cols */
    grid-template-rows: auto 1fr 1fr 1fr;
    /* Label + 3 Rows */
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.fs-matrix-header {
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.fs-matrix-label-y {
    grid-row: 2 / 5;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    font-weight: bold;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.fs-matrix-cell {
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.fs-matrix-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.fs-matrix-cell span {
    display: block;
    font-size: 0.65rem;
    font-weight: normal;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.risk-low {
    background-color: #10b981;
}

.risk-med {
    background-color: #f59e0b;
}

.risk-high {
    background-color: #ef4444;
}

/* Interactive IPL Stack */
.fs-ipl-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.fs-ipl-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    /* Large rounded corners */
    padding: 1rem 1.5rem;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.fs-ipl-item:hover {
    transform: scale(1.02) translateX(10px);
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.fs-ipl-icon {
    width: 3rem;
    height: 3rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

.fs-ipl-item:hover .fs-ipl-icon {
    background: #3b82f6;
    color: white;
}

.fs-ipl-content h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.fs-ipl-content p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Hover Cards (Terminologies) */
.fs-hover-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    text-align: center;
}

.fs-hover-card:hover {
    background: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    border-color: #cbd5e1;
}

.fs-hover-card-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.fs-hover-card:hover .fs-hover-card-icon {
    background: #0284c7;
    color: white;
    transform: rotate(360deg);
    transition: all 0.5s ease;
}

.fs-slide-counter {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

.fs-section-content {
    display: none;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    border-top: none;
    background: #fff;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    /* Larger body text */
}

.fs-section-content.open {
    display: block;
}

.fs-interactive-diagram img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* CSS Onion Model */
.fs-onion-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-onion-layer {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.fs-onion-layer span {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Layer Sizes & Colors (Outer to Inner) */
.layer-5 {
    width: 300px;
    height: 300px;
    background: #94a3b8;
    z-index: 1;
}

/* Community */
.layer-4 {
    width: 240px;
    height: 240px;
    background: #64748b;
    z-index: 2;
}

/* Mitigation */
.layer-3 {
    width: 180px;
    height: 180px;
    background: #3b82f6;
    z-index: 3;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    animation: pulse-blue 2s infinite;
}

/* SIS */
.layer-2 {
    width: 120px;
    height: 120px;
    background: #475569;
    z-index: 4;
}

/* BPCS */
.layer-1 {
    width: 60px;
    height: 60px;
    background: #1e293b;
    z-index: 5;
    align-items: center;
}

/* Process */

.layer-1 span {
    margin-top: 0;
    font-size: 8px;
    text-align: center;
}

@keyframes pulse-blue {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    }

    100% {
        transform: scale(1);
    }
}

.fs-onion-label-container {
    margin-top: 1rem;
    text-align: center;
}

/* User Custom Styles */
.mono {
    font-family: 'JetBrains Mono', monospace;
}

.standard-box {
    border-left: 4px solid #1d4ed8;
    /* safety-blue */
    background: linear-gradient(to right, #f8fafc, #ffffff);
}

.layer-pill {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-pill:hover {
    transform: translateX(10px);
}

/* Re-style active section header to match user's bold look */
.fs-collapsible-header.active h2,
.fs-collapsible-header h2 {
    color: #1e293b;
}

.fs-collapsible-header:hover {
    background-color: #f1f5f9;
}

/* Global Hide for Comments */
#comments,
.comments-area,
.learn-press-comments,
.respond {
    display: none !important;
}

/* FORCE FULL WIDTH ON LESSON PAGES */
body.single-lp_lesson .bloghash-container,
body.single-lp_lesson .container,
body.single-lp_lesson #content,
body.single-lp_lesson .site-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* Maximizing Real Estate: NUCLEAR OPTION for Sidebars */
body.single-lp_lesson #secondary,
body.single-lp_lesson #sidebar,
body.single-lp_lesson .sidebar,
body.single-lp_lesson .bloghash-sidebar,
body.single-lp_lesson .course-curriculum,
body.single-lp_lesson #learn-press-course-curriculum,
body.single-lp_lesson .lp-sidebar,
body.single-lp_lesson aside[id*="sidebar"] {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
}

/* Ensure our toggle button is ON TOP of everything */
.fs-toggle-btn {
    z-index: 9999 !important;
    border: 2px solid white !important;
    /* Visual Pop */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
}

body.single-lp_lesson #primary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Internal Sidebar Optimization */
.fs-sidebar,
.fs-sidebar-content {
    width: 14rem;
    /* Further reduced from 16rem to 14rem (~220px) */
}

/* Restore Standard Flow (Remove Breakout Hack) */
body.single-lp_lesson .fs-app-container {
    width: 100% !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
}

/* Mobile Adjustments for Full Width */
@media (max-width: 768px) {
    body.single-lp_lesson .fs-app-container {
        border-radius: 0 !important;
        border: none !important;
    }

    body.single-lp_lesson .fs-content-area {
        padding: 1.5rem 1rem !important;
        /* Smaller padding on mobile */
    }
}

/* Ensure the wrapper respects the device width but allows full spacing */
body.single-lp_lesson .entry-content {
    max-width: 100% !important;
    margin: 0 !important;
}