/* Output Pane Specifics */
.placeholder-text {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.loading-spinner {
    color: #0077b6;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

/* Header Styles */
.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.exp-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    color: #333;
}

.download-btn {
    background-color: #ef5350;
    /* Reddish like image */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(239, 83, 80, 0.3);
    transition: transform 0.1s, background-color 0.2s;
}

.download-btn:hover {
    background-color: #e53935;
    transform: translateY(-1px);
}

.download-btn:active {
    transform: translateY(1px);
}


.output-text {
    margin-bottom: 5px;
    line-height: 1.4;
}

.output-success {
    color: #89a0ed;
    font-weight: bold;
    margin-top: 5px;
}

/* Scoped style for code box to keep variables/comments black */
.code-box .output-success {
    color: #333;
    font-weight: normal;
}

.output-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #000;
}

/* Syntax Highlighting (Simulated) */
.kw {
    color: #d63384;
    font-weight: bold;
}

/* Keywords like import, def */
.func {
    color: #0077b6;
}

/* Functions like print */

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 8px 5px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: break-word;
    /* Wraps at word boundaries */
    word-break: normal;
    /* Prevents mid-word breaking */
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 700;
}

.stats-table th {
    background-color: #e9ecef;
}

/* Interactive Plot Container */
.interactive-plot-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.dropdown-label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-family: inherit;
    margin-bottom: 15px;
    width: 180px;
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: #ffffff;
    color: #333;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.container {
    width: 98%;
    max-width: 1600px;
    height: 98vh;
    display: flex;
    flex-direction: column;
}

.main-layout {
    display: flex;
    height: 100%;
    gap: 5px;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    margin-right: 5px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    padding-left: 0;
    width: fit-content;
    /* Ensure it wraps the content for right alignment */
}

.sidebar-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    padding-left: 30px;
    padding-right: 30px;
    /* Identical gaps for both triangles */
    text-transform: uppercase;
    position: relative;
    /* Anchor for pseudo-element */
}

/* Bottom-Right Corner Triangle */
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 22px solid #000;
    border-left: 22px solid transparent;
}

/* Decorative corner triangle for "STEPS" label */
.corner-triangle-top-left {
    position: absolute;
    top: 5px;
    left: 0;
    width: 0;
    height: 0;
    border-top: 22px solid #000;
    border-right: 22px solid transparent;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-btn {
    appearance: none;
    border: none;
    background-color: #5FA8E4;
    /* Pastel Blue - default for unlocked */
    color: white;
    padding: 14px 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    /* Align text left for list look */
    transition: transform 0.1s ease, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(255, 107, 107, 0.2);
    position: relative;
}

.step-btn:hover {
    background-color: #ff6b6b;
    transform: translateY(-2px);
}

.step-btn.active {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #fff;
    outline: 2px solid #333;
    /* Darker outline for active step */
    z-index: 5;
}

.step-btn.disabled {
    background-color: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.step-btn.completed {
    background-color: #A6CE63;
    box-shadow: 0 4px 6px rgba(166, 206, 99, 0.3);
}

.step-btn.in-progress {
    background-color: #F57C2A;
    /* Orange */
    box-shadow: 0 4px 6px rgba(245, 124, 42, 0.3);
    color: #fff;
}

/* Content Area Styles */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Increased gap */
    padding: 10px;
    /* Add margin/padding to all sides */
    padding-bottom: 80px;
    /* Sufficient padding to ensure bottom border visibility */
    height: 100%;
    /* Ensure it fills container */
    overflow-y: auto;
    /* Allow scrolling for the entire input/output area */
    overflow-x: hidden;
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar for IE/Edge */
}

/* Hide scrollbar for Chrome, Safari, and newer versions of Edge */
.content-area::-webkit-scrollbar {
    display: none;
}

.pane {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    /* Take up necessary space based on content */
    display: flex;
    flex-direction: column;
}

/* Top Pane (Code) */
.top-pane {
    flex: 0 0 auto;
    /* Stop it from growing/shrinking unexpectedly */
}

.code-box-container {
    /* Fixed height for top pane to allow bottom pane to expand */
    position: relative;
    background-color: white;
    border: 2px solid #5994d3;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 32vh;
    /* Fixed smaller height */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.code-header-bar {
    background-color: #94cefb;
    /* Swapped: Light Blue */
    color: #1d3557;
    /* Darker text for contrast */
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid #5994d3;
    min-height: 45px;
    box-sizing: border-box;
    display: none;
    width: 100%;
    /* Hidden by default, shown when comment exists */
}

.code-box {
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    padding: 20px;
    padding-right: 85px;
    box-sizing: border-box;
}

.code-box pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    color: #333;
    white-space: pre-wrap;
    width: 100%;
}

.run-button {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: #F57C2A;
    /* Orange-ish default */
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 10px rgba(247, 160, 114, 0.4);
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    z-index: 10;
}

.run-button:hover {
    background-color: #f63c3c;
    transform: translateY(-50%) scale(1.1);
}

.run-button:active {
    transform: translateY(-50%) scale(0.95);
}

.run-button.completed {
    background-color: #A6CE63;
    /* Green */
}

/* Bottom Pane (Output) */
.bottom-pane {
    background-color: #f0f0f0;
    /* Default Grey */
    border-radius: 30px;
    border: 2px solid #545151;
    /* Hidden by default */
    padding: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow-y: visible;
    overflow-x: auto;
    /* Allow X scrolling for wide tables locally */
    box-sizing: border-box;
    transition: background-color 0.5s ease;
    min-height: 62vh;
    /* Auto-expand based on content */
    height: auto;
    margin-bottom: 20px;
    /* Space below output to show border and avoid clipping */
}

/* Active Output State */
.bottom-pane.active-output {
    background-color: #d6e1f0;
    border: 3px solid #78ad1c;
}

.output-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    color: #1d3557;
    /* white-space: pre-wrap; */
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .steps-container {
        flex-direction: row;
    }

    .step-btn {
        min-width: 150px;
    }
}