/* Code Explanation — kod editörü ile aynı koyu uzay mavisi */
.code-explanation-modern {
    margin: var(--spacing-2xl) 0;
    position: relative;
}

.explanation-panel {
    background: linear-gradient(165deg, #132337 0%, #0c1628 42%, #070f1c 100%);
    border: 1px solid rgba(56, 139, 253, 0.14);
    border-radius: 14px;
    box-shadow:
        0 18px 48px rgba(0, 4, 18, 0.6),
        0 0 40px rgba(20, 60, 120, 0.14),
        0 0 0 1px rgba(0, 0, 0, 0.4) inset;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.explanation-panel:hover {
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(0, 0, 0, 0.35) inset;
    border-color: rgba(49, 130, 206, 0.22);
}

/* Panel Header */
.explanation-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(180deg, #162a42 0%, #101f33 55%, #0c1828 100%);
    border-bottom: 1px solid rgba(56, 139, 253, 0.1);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.explanation-panel-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0;
    letter-spacing: -0.02em;
}

.explanation-panel-title i {
    color: #58a6ff;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    filter: none;
}

/* Tabs Container */
.explanation-tabs-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.explanation-tabs {
    display: flex;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
}

.explanation-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(240, 246, 252, 0.06);
    border: 1px solid rgba(240, 246, 252, 0.08);
    border-radius: 10px;
    color: rgba(240, 246, 252, 0.55);
    font-size: 0.8125rem;
    font-family: var(--font-mono), ui-monospace, monospace;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.explanation-tab i {
    font-size: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    display: inline-block;
}

.explanation-tab span {
    position: relative;
    z-index: 1;
}

.explanation-tab:hover {
    background: rgba(240, 246, 252, 0.1);
    border-color: rgba(49, 130, 206, 0.25);
    color: #f0f6fc;
}

/* HTML Tab */
.explanation-tab[data-target*='html'] {
    border-color: rgba(248, 113, 113, 0.28);
    color: #94a3b8;
}

.explanation-tab[data-target*='html'] i {
    color: #fb923c;
    transition: all 0.3s ease;
}

.explanation-tab[data-target*='html']:hover {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.45);
    color: #fef3c7;
}

.explanation-tab[data-target*='html']:hover i {
    color: #fdba74;
    transform: scale(1.1);
}

.explanation-tab[data-target*='html'].active {
    background: #0b121f;
    border-color: rgba(49, 130, 206, 0.4);
    border-width: 1px;
    color: #f0f6fc;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #3182ce;
}

.explanation-tab[data-target*='html'].active i {
    color: #58a6ff;
}

/* CSS Tab */
.explanation-tab[data-target*='css'] {
    border-color: rgba(56, 189, 248, 0.28);
    color: #94a3b8;
}

.explanation-tab[data-target*='css'] i {
    color: #38bdf8;
    transition: all 0.3s ease;
}

.explanation-tab[data-target*='css']:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
}

.explanation-tab[data-target*='css']:hover i {
    color: #7dd3fc;
    transform: scale(1.1);
}

.explanation-tab[data-target*='css'].active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.5);
    border-width: 1.5px;
    color: #e0f2fe;
    font-weight: 600;
}

.explanation-tab[data-target*='css'].active i {
    color: #7dd3fc;
}

/* JavaScript Tab */
.explanation-tab[data-target*='js'] {
    border-color: rgba(251, 191, 36, 0.28);
    color: #94a3b8;
}

.explanation-tab[data-target*='js'] i {
    color: #fbbf24;
    transition: all 0.3s ease;
}

.explanation-tab[data-target*='js']:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.45);
    color: #fffbeb;
}

.explanation-tab[data-target*='js']:hover i {
    color: #fcd34d;
    transform: scale(1.1);
}

.explanation-tab[data-target*='js'].active {
    background: #0b121f;
    border-color: rgba(49, 130, 206, 0.4);
    border-width: 1px;
    color: #f0f6fc;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #3182ce;
}

.explanation-tab[data-target*='js'].active i {
    color: #58a6ff;
}

/* Mobile Dropdown */
.explanation-tabs-dropdown {
    display: none;
    position: relative;
}

.explanation-tabs-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 0.45rem 0.85rem;
    background: #21262d;
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 10px;
    color: #f0f6fc;
    font-size: 0.8125rem;
    font-family: var(--font-mono), ui-monospace, monospace;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.explanation-tabs-dropdown-trigger:hover {
    background: #30363d;
    border-color: rgba(49, 130, 206, 0.35);
    color: #f0f6fc;
}

.explanation-tabs-dropdown-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.explanation-tabs-dropdown.open .explanation-tabs-dropdown-icon {
    transform: rotate(180deg);
}

.explanation-tabs-dropdown-menu {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    left: 0;
    right: 0;
    background: #161b22;
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
}

.explanation-tabs-dropdown.open .explanation-tabs-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.explanation-tabs-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.explanation-tabs-dropdown-item:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #f8fafc;
}

.explanation-tabs-dropdown-item.active {
    background: rgba(129, 140, 248, 0.15);
    color: #e0e7ff;
    font-weight: 600;
}

.explanation-tabs-dropdown-item i {
    font-size: 0.75rem;
    display: inline-block;
}

/* HTML Dropdown Item */
.explanation-tabs-dropdown-item[data-target*="html"] i {
    color: #e34c26;
    transition: all 0.3s ease;
}

.explanation-tabs-dropdown-item[data-target*="html"]:hover i {
    color: #f16529;
    transform: scale(1.1);
}

.explanation-tabs-dropdown-item[data-target*="html"].active {
    background: rgba(227, 76, 38, 0.08);
    color: #e34c26;
}

.explanation-tabs-dropdown-item[data-target*="html"].active i {
    color: #e34c26;
}

/* CSS Dropdown Item */
.explanation-tabs-dropdown-item[data-target*="css"] i {
    color: #264de4;
    transition: all 0.3s ease;
}

.explanation-tabs-dropdown-item[data-target*="css"]:hover i {
    color: #2965f1;
    transform: scale(1.1);
}

.explanation-tabs-dropdown-item[data-target*="css"].active {
    background: rgba(21, 114, 182, 0.08);
    color: #264de4;
}

.explanation-tabs-dropdown-item[data-target*="css"].active i {
    color: #264de4;
}

/* JavaScript Dropdown Item */
.explanation-tabs-dropdown-item[data-target*="js"] i {
    color: #f7df1e;
    transition: all 0.3s ease;
}

.explanation-tabs-dropdown-item[data-target*="js"]:hover i {
    color: #f0db4f;
    transform: scale(1.1);
}

.explanation-tabs-dropdown-item[data-target*="js"].active {
    background: rgba(247, 223, 30, 0.08);
    color: #323330;
}

.explanation-tabs-dropdown-item[data-target*="js"].active i {
    color: #f7df1e;
}

/* Explanation Panes */
.explanation-pane {
    display: none;
    padding: var(--spacing-xl);
    background: linear-gradient(185deg, #0a1524 0%, #060f1c 50%, #030812 100%);
    animation: fadeIn 0.3s ease;
}

.explanation-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Explanation Items */
.explanation-modern-item {
    margin-bottom: var(--spacing-2xl);
    padding: 0;
    background: transparent;
    border: none;
    transition: none;
}

.explanation-modern-item:last-child {
    margin-bottom: 0;
}

.explanation-modern-item:hover {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

.explanation-modern-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.3px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, rgba(124, 156, 255, 0.06) 0%, rgba(196, 181, 253, 0.06) 100%);
    border: 1px solid rgba(124, 156, 255, 0.15);
    border-left: 4px solid var(--color-primary);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.explanation-modern-title:hover {
    background: linear-gradient(135deg, rgba(124, 156, 255, 0.1) 0%, rgba(196, 181, 253, 0.1) 100%);
    border-color: rgba(124, 156, 255, 0.25);
    box-shadow: 0 2px 8px rgba(124, 156, 255, 0.12);
    transform: translateX(2px);
}

.explanation-modern-title i {
    color: white;
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(124, 156, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.explanation-modern-title:hover i {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(124, 156, 255, 0.35);
}

.explanation-modern-title span {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.explanation-modern-title:hover span {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.explanation-modern-code {
    margin: var(--spacing-md) 0 var(--spacing-xl) 0;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.96) 50%, rgba(15, 23, 42, 0.98) 100%),
        radial-gradient(circle at 20% 50%, rgba(30, 58, 138, 0.25) 0%, transparent 50%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: var(--spacing-md);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: none;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.explanation-modern-code::before {
    display: none;
}

.explanation-modern-code:hover {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 1) 0%, rgba(30, 41, 59, 0.98) 50%, rgba(15, 23, 42, 1) 100%),
        radial-gradient(circle at 20% 50%, rgba(30, 58, 138, 0.3) 0%, transparent 50%);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: none;
    transform: none;
}


.explanation-modern-code pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
    background: transparent;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

/* Webkit scrollbar stilleri - köşelerin dışarı çıkmaması için */
.explanation-modern-code pre::-webkit-scrollbar {
    height: 8px;
}

.explanation-modern-code pre::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 0 6px 6px;
}

.explanation-modern-code pre::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.explanation-modern-code pre::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.explanation-modern-code code {
    font-family: inherit;
    background: transparent;
    color: #e2e8f0;
}

/* editor-simple.js syntax highlighting renkleri - koyu tema için optimize */
.explanation-modern-code code .keyword {
    color: #c084fc;
    font-style: italic;
    font-weight: 500;
}

.explanation-modern-code code .variable-decl {
    color: #34d399;
    font-weight: 500;
}

.explanation-modern-code code .variable {
    color: #60a5fa;
}

.explanation-modern-code code .object-key {
    color: #fbbf24;
    font-weight: 500;
}

.explanation-modern-code code .string {
    color: #fbbf24;
}

.explanation-modern-code code .number {
    color: #fb7185;
}

.explanation-modern-code code .comment {
    color: #94a3b8;
    font-style: italic;
}

.explanation-modern-code code .operator {
    color: #34d399;
}

.explanation-modern-code code .function {
    color: #f472b6;
    font-weight: 500;
}

.explanation-modern-code code .builtin {
    color: #60a5fa;
    font-style: italic;
}

.explanation-modern-code code .template {
    color: #fbbf24;
}

.explanation-modern-code code .punctuation {
    color: #cbd5e1;
    opacity: 0.9;
}

/* HTML syntax highlighting */
.explanation-modern-code code .tag {
    color: #60a5fa;
    font-weight: 500;
}

.explanation-modern-code code .tag-name {
    color: #60a5fa;
    font-weight: 500;
}

.explanation-modern-code code .tag-bracket {
    color: #60a5fa;
    font-weight: 500;
}

.explanation-modern-code code .attribute {
    color: #34d399;
    font-weight: 500;
}

.explanation-modern-code code .doctype {
    color: #c084fc;
    font-weight: 500;
}

/* CSS syntax highlighting */
.explanation-modern-code code .selector {
    color: #c084fc;
    font-weight: 500;
}

.explanation-modern-code code .property {
    color: #60a5fa;
    font-weight: 500;
}

.explanation-modern-code code .selector-char {
    color: #fb7185;
}

.explanation-modern-code code .selector-name {
    color: #34d399;
    font-weight: 500;
}

.explanation-modern-code code .color {
    color: #fb7185;
}

.explanation-modern-text {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(8, 10, 22, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(129, 140, 248, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: none;
}

.explanation-modern-text p {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-secondary, #cbd5e1);
    margin-bottom: var(--spacing-md);
    position: relative;
    padding-left: 1.75rem;
    padding-top: var(--spacing-xs);
    transition: none;
    max-width: 100%;
    width: 100%;
}

.explanation-modern-text p:last-child {
    margin-bottom: 0;
}

.explanation-marker {
    position: absolute;
    left: 0;
    top: 0.8em;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
            rgba(5, 23, 39, 0.9) 0%,
            rgba(3, 42, 81, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(64, 224, 208, 0.5);
    border-radius: 5px;
    transform: rotate(45deg);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    background: linear-gradient(135deg, #40e0d0 0%, #48d1cc 100%);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(64, 224, 208, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 5px rgba(64, 224, 208, 0.6);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 8px rgba(64, 224, 208, 0.8);
    }
}

.explanation-modern-text p:hover .explanation-marker::before,
.explanation-modern-text:hover .explanation-marker::before {
    background: linear-gradient(135deg, #4A90E2 0%, #5BC0DE 100%);
    box-shadow: 0 0 12px rgba(124, 156, 255, 0.8), 0 0 20px rgba(124, 156, 255, 0.4);
    transform: translate(-50%, -50%) scale(1.2);
    animation: markerPulseHover 1.5s ease-in-out infinite;
}

@keyframes markerPulseHover {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 12px rgba(124, 156, 255, 0.8), 0 0 20px rgba(124, 156, 255, 0.4);
    }

    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 16px rgba(124, 156, 255, 1), 0 0 28px rgba(124, 156, 255, 0.6);
    }
}

.explanation-modern-text strong {
    color: var(--text-primary, #f1f5f9);
    font-weight: 600;
}

.mark-html-tag {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1px solid rgba(129, 140, 248, 0.2);
}

/* Açıklama kutusu içindeki dil badge'leri */
.explanation-modern-code .lang-badge-wrapper {
    position: absolute;
    top: 12px;
    right: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 2;
}

.explanation-modern-code .lang-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: rgba(10, 12, 26, 0.92);
    border: 1px solid rgba(129, 140, 248, 0.28);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.explanation-modern-code .lang-icon i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

/* JavaScript icon */
.explanation-modern-code .lang-icon i.fa-js,
.explanation-modern-code .lang-icon i.fab.fa-js {
    color: #f7df1e;
    filter: none;
}

/* HTML icon */
.explanation-modern-code .lang-icon i.fa-html5 {
    color: #e34c26;
    filter: none;
}

/* CSS icon */
.explanation-modern-code .lang-icon i.fa-css3-alt {
    color: #264de4;
    filter: none;
}

.explanation-modern-code:hover .lang-icon {
    background: rgba(18, 20, 38, 0.95);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    transform: none;
}

.explanation-modern-code:hover .lang-icon i.fa-js,
.explanation-modern-code:hover .lang-icon i.fab.fa-js {
    filter: none;
    transform: scale(1.05);
}

.explanation-modern-code:hover .lang-icon i.fa-html5 {
    filter: none;
    transform: scale(1.05);
}

.explanation-modern-code:hover .lang-icon i.fa-css3-alt {
    filter: none;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .code-explanation-modern {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .explanation-panel {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .explanation-panel-header {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-md);
    }

    .explanation-tabs {
        display: none;
    }

    .explanation-tabs-dropdown {
        display: block;
        width: 100%;
    }

    .explanation-tabs-dropdown-trigger {
        width: 100%;
    }

    .explanation-pane {
        padding: var(--spacing-md);
    }

    .explanation-modern-item {
        margin-bottom: var(--spacing-xl);
    }

    .explanation-modern-title {
        font-size: 1rem;
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .explanation-modern-title i {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .explanation-modern-code {
        padding: var(--spacing-sm);
        border-radius: 6px;
    }

    .explanation-modern-code pre::-webkit-scrollbar-track {
        border-radius: 0 0 6px 6px;
    }

    .explanation-modern-code .lang-badge-wrapper {
        right: 8px;
        top: 12px;
    }

    .explanation-modern-code::before {
        display: none;
    }

    .explanation-modern-code pre {
        font-size: 0.8125rem;
    }

    .explanation-modern-text {
        padding: var(--spacing-sm);
    }

    .explanation-modern-text p {
        font-size: 1rem;
        padding-left: var(--spacing-lg);
    }
}

@media (max-width: 640px) {
    .code-explanation-modern {
        margin: var(--spacing-lg) 0;
        padding: 0 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .explanation-panel {
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .explanation-panel-header {
        padding: var(--spacing-sm) 0.5rem;
    }

    .explanation-pane {
        padding: var(--spacing-sm) 0.5rem;
    }

    .explanation-modern-item {
        margin-bottom: var(--spacing-lg);
    }

    .explanation-modern-title {
        padding: var(--spacing-xs) 0.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .explanation-modern-code {
        padding: 0.5rem;
        padding-top: 0.5rem;
        margin: var(--spacing-sm) 0 var(--spacing-md) 0;
        border-radius: 6px;
    }

    .explanation-modern-code pre::-webkit-scrollbar-track {
        border-radius: 0 0 6px 6px;
    }

    .explanation-modern-code::before {
        display: none;
    }

    .explanation-modern-text {
        padding: 0.5rem;
        margin-top: var(--spacing-sm);
    }

    .explanation-modern-text p {
        padding-left: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }

    .explanation-modern-code .lang-badge-wrapper {
        right: 8px;
        top: 12px;
    }

    .explanation-modern-code .lang-icon {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
        border-color: rgba(129, 140, 248, 0.25);
    }

    .explanation-modern-code .lang-icon i {
        font-size: 0.95rem;
        filter: none;
    }
}