/* Container - keeps it isolated */
.code-panel-wrapper {
    width: 100%;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
}

/* Main Window */
.code-panel-container {
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    /* Clips the inner content to radius */
    display: flex;
    flex-direction: column;
    margin: 0px;
    padding: 0px;
}

/* Top Bar */
.code-panel-header {
    background: #181825;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-panel-dots {
    display: flex;
    gap: 6px;
    margin-right: 15px;
}

.code-panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-r {
    background: #ff5f56;
}

.dot-y {
    background: #ffbd2e;
}

.dot-g {
    background: #27c93f;
}

.code-panel-filename {
    color: #9494b8;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Layout Body */
.code-panel-body {
    display: flex;
    height: 350px;
    /* Fixed height for scroll control */
}

/* Explanation Sidebar */
.code-panel-sidebar {
    width: 30%;
    background: #252539;
    padding: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.code-panel-sidebar h5 {
    color: #61afef;
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.code-panel-sidebar p {
    color: #d1d1e0;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Code Area */
.code-panel-content {
    flex: 1;
    padding: 0 15px;
    background: #1e1e2e;
    overflow: auto;
    display: block;
    text-align: left !important;
    white-space: normal;
    line-height: 1.4;
    margin: 0px;
}

/* Code Text Styling (using <p> classes) */
.code-p {
    display: inline;
    margin: 0 !important;
    padding: 0;
    font-size: 14px;
    gap: 0px;
    margin: 0px;
    text-align: left;
}

.code-p.comment {
    color: #5c6370;
    font-style: italic;
}

.code-p.keyword {
    color: #c678dd;
}

.code-p.function {
    color: #61afef;
}

.code-p.string {
    color: #98c379;
}

.code-p.variable {
    color: #e06c75;
}

/* Responsive Adjustments */
@media (max-width: 650px) {
    .code-panel-body {
        flex-direction: column;
        height: auto;
    }

    .code-panel-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 120px;
    }

    .code-panel-content {
        max-height: 250px;
        /* Limits scroll on mobile */
    }
}