/* Modern Editor CSS - Enhanced & Fully Responsive (Light Theme) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --primary-color: #6d5ef0;
    --secondary-color: #06966d;
    --dark-bg: #f7f7fb;
    --card-bg: #ffffff;
    --card-bg2: #f2f1f8;
    --card-bg3: #e8e6f2;
    --text-primary: #17151f;
    --text-secondary: #5d5a76;
    --text-muted: #9793ac;
    --success: #06966d;
    --warning: #b5690f;
    --danger: #c81157;
    --accent: #c81157;
    --border: rgba(23, 21, 31, 0.08);
    --border-hi: rgba(109, 94, 240, 0.35);
    --pri-glow: rgba(109, 94, 240, 0.22);
    --sec-glow: rgba(6, 150, 109, 0.2);
    --border-radius: 16px;
    --shadow-sm: 0 4px 12px rgba(23, 21, 31, 0.06);
    --shadow-md: 0 8px 24px rgba(23, 21, 31, 0.08);
    --shadow-lg: 0 16px 40px rgba(23, 21, 31, 0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 140px;
    --toolbar-height: 60px;

}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--card-bg3);
    border-radius: 99px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── BODY & BACKGROUND ─── */
body {
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    height: 100vh;
    line-height: 1.6;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(109, 94, 240, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(109, 94, 240, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Ambient glow top-right */
body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(109, 94, 240, 0.08) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    z-index: 0;
    pointer-events: none;
}

/* Ensure all direct children are above pseudo-elements */
body>* {
    position: relative;
    z-index: 1;
}

/* ─── SETTINGS TOGGLE ─── */
.settings {
    width: 280px;
    background: var(--card-bg2);
    padding: 15px;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    border: 1px solid var(--border);
    margin: 10px;
}

.setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
    margin: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background-color: var(--card-bg3);
    border-radius: 22px;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid var(--border);
}

.slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(23, 21, 31, 0.25);
    border-radius: 50%;
    transition: 0.3s;
}

input:checked+.slider {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

input:checked+.slider::before {
    transform: translateX(20px);
    background-color: #fff;
}

/* ─── HEADING ─── */
.editor-heading {
    text-align: center;
    padding: 20px 15px 10px;
    flex-shrink: 0;
    animation: fadeInDown 0.7s ease-out both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }

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

.editor-heading h2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    line-height: 1.2;
}

.gradient-text {
    font-size: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(135deg, #17151f 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-bottom: 12px;
    animation: gradientShift 6s ease infinite;
    transition: transform 0.3s ease, filter 0.3s ease;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.gradient-text:hover {
    transform: translateY(-2px) scale(1.01);
    filter: drop-shadow(0 8px 20px var(--pri-glow));
}

.gradient-text::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.editor-heading h2:hover .gradient-text::after {
    width: 100px;
}

.by-text {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── TOOLBAR ─── */
.toolbar {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-hi);
    border-bottom: 1px solid var(--border);
}

/* ─── BUTTONS ─── */
button {
    padding: 8px 16px;
    font-size: clamp(11px, 1.4vw, 13px);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    letter-spacing: 0.4px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 34px;
    touch-action: manipulation;
}

/* Shimmer overlay on hover */
button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

button:hover::after {
    opacity: 1;
}

/* Ripple on active */
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

button:active::before {
    width: 280px;
    height: 280px;
    opacity: 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: scale(0.97);
}

button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

#format {
    background: linear-gradient(135deg, #6d5ef0, #5847d6);
    color: #fff;
    box-shadow: 0 2px 12px var(--pri-glow);
}

#format:hover {
    box-shadow: 0 6px 24px var(--pri-glow);
}

#run {
    background: linear-gradient(135deg, #06966d, #067a5a);
    color: #fff;
    box-shadow: 0 2px 12px var(--sec-glow);
}

#run:hover {
    box-shadow: 0 6px 24px var(--sec-glow);
}

#addfile {
    background: var(--card-bg3);
    color: var(--text-primary);
    border-color: var(--border-hi);
}

#addfile:hover {
    background: #ddd9f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#clear {
    background: rgba(200, 17, 87, 0.08);
    color: var(--danger);
    border-color: rgba(200, 17, 87, 0.25);
}

#clear:hover {
    background: rgba(200, 17, 87, 0.15);
    border-color: rgba(200, 17, 87, 0.4);
    box-shadow: 0 4px 16px rgba(200, 17, 87, 0.15);
}

#download {
    background: var(--card-bg3);
    color: var(--text-primary);
    border-color: var(--border);
}

#download:hover {
    border-color: rgba(6, 150, 109, 0.4);
    color: var(--secondary-color);
}

.layout-btn {
    background: var(--card-bg3);
    color: var(--text-secondary);
    border-color: var(--border);
}

.layout-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hi);
}

.layout-btn.active {
    background: var(--card-bg3);
    color: var(--primary-color);
    border-color: var(--border-hi);
    box-shadow: 0 0 16px var(--pri-glow);
}

/* ─── WORKSPACE ─── */
.workspace {
    flex: 1;
    display: flex;
    padding: 12px 16px 16px;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

/* ─── CONTAINER ─── */
.container {
    display: flex;
    flex-direction: row;
    gap: 14px;
    flex: 1;
    min-height: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.5s ease-out both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.container.column-layout {
    flex-direction: column;
}

/* ─── EDITOR ─── */
#editor {
    flex: 2;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: clamp(14px, 2vw, 20px);
    font-size: clamp(13px, 1.4vw, 15px);
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
    border: 1px solid var(--border);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: auto;
    min-height: 0;
    height: 100%;
    caret-color: var(--primary-color);
    color: var(--text-primary);
    line-height: 1.75;
}

/* Animated top accent bar */
#editor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

#editor:hover::before,
#editor:focus-within::before {
    opacity: 1;
}

#editor:hover {
    border-color: rgba(109, 94, 240, 0.3);
    box-shadow: 0 0 0 1px rgba(109, 94, 240, 0.3), var(--shadow-lg);
}

#editor:focus-within {
    border-color: var(--border-hi);
    box-shadow: 0 0 0 3px rgba(109, 94, 240, 0.12), var(--shadow-lg);
}

/* ─── OUTPUT CONTAINER ─── */
.output-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.output-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: var(--shadow-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 0;
    overflow: hidden;
}

.output-section:hover {
    border-color: rgba(23, 21, 31, 0.14);
    box-shadow: var(--shadow-md);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg2);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    flex-shrink: 0;
}

.output-header h4 {
    font-size: clamp(10px, 1.3vw, 12px);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Colored dot before console/output headers */
.output-header h4::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary-color);
    box-shadow: 0 0 6px var(--sec-glow);
}

.clear-btn {
    background: rgba(200, 17, 87, 0.08);
    color: var(--danger);
    border: 1px solid rgba(200, 17, 87, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(9px, 1.2vw, 11px);
    font-weight: 600;
    transition: var(--transition);
    min-height: 26px;
}

.clear-btn:hover {
    background: rgba(200, 17, 87, 0.16);
    border-color: rgba(200, 17, 87, 0.4);
    transform: none;
}

.output-content {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    line-height: 1.65;
    font-size: clamp(11px, 1.2vw, 13px);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px;
    min-height: 0;
}

/* ─── LOG ENTRIES ─── */
.log-entry {
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    border-left: 2px solid;
    background: rgba(23, 21, 31, 0.03);
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: logIn 0.2s ease;
}

@keyframes logIn {
    from {
        opacity: 0;
        transform: translateX(6px);
    }

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

.log-entry.log {
    border-left-color: var(--secondary-color);
    color: var(--secondary-color);
}

.log-entry.error {
    border-left-color: var(--danger);
    color: var(--danger);
}

.log-entry.warn {
    border-left-color: var(--warning);
    color: var(--warning);
}

.log-entry.info {
    border-left-color: #1d70b8;
    color: #1d70b8;
}

.log-timestamp {
    font-size: clamp(9px, 1vw, 10px);
    opacity: 0.6;
    margin-bottom: 3px;
}

/* ─── OBJECT INSPECTOR ─── */
.object-inspector {
    margin: 6px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(11px, 1.2vw, 12px);
}

.object-tree {
    margin-left: 16px;
}

.object-key {
    color: #b5690f;
    font-weight: 600;
}

.object-value {
    color: var(--secondary-color);
}

.object-string {
    color: #a8790a;
}

.object-number {
    color: #1d70b8;
}

.object-boolean {
    color: #6653e0;
}

.object-null,
.object-undefined {
    color: var(--text-muted);
    font-style: italic;
}

.prototype-section {
    background: transparent;
    border: 0;
    border-left: 2px solid #6c5ce7;
    border-radius: 0;
    padding: 2px 0 2px 10px;
    margin: 6px 0 2px;
}

.prototype-header {
    color: var(--primary-color);
    font-weight: 600;
    font-size: clamp(11px, 1.1vw, 12px);
    margin-bottom: 2px;
    cursor: pointer;
    display: block;
}

.prototype-content {
    margin-left: 4px;
    font-size: clamp(11px, 1.1vw, 12px);
    line-height: 1.55;
    max-height: none;
    overflow: visible;
}

.prototype-content > div {
    margin: 1px 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.expandable {
    cursor: pointer;
    user-select: none;
}

.expandable::before {
    content: "▶";
    margin-right: 5px;
    font-size: 9px;
    transition: transform 0.2s ease;
    display: inline-block;
    opacity: 0.7;
}

.expandable.expanded::before {
    transform: rotate(90deg);
}

.collapsed {
    display: none;
}

/* ─── LANGUAGE PANEL ─── */
.language-panel {
    width: 175px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.language-title {
    padding: 13px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

#languageList {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 6px 0;
}

#languageList li {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 2px solid transparent;
}

#languageList li:hover {
    background: rgba(109, 94, 240, 0.08);
    color: var(--text-primary);
    border-left-color: rgba(109, 94, 240, 0.4);
}

#languageList li.active {
    background: rgba(109, 94, 240, 0.12);
    color: var(--secondary-color);
    font-weight: 700;
    border-left-color: var(--secondary-color);
}

/* ─── LANGUAGE AD ─── */
.language-ad {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(6, 150, 109, 0.12), rgba(109, 94, 240, 0.12));
    padding: 16px;
    min-height: 80px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ─── CUSTOM ALERT ─── */
.alert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(23, 21, 31, 0.45);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.alert-overlay.show {
    display: flex;
}

.custom-alert {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.75);
    background: var(--card-bg2);
    padding: 36px 28px 28px;
    border-radius: 20px;
    border: 1px solid var(--border-hi);
    box-shadow: 0 0 60px var(--pri-glow), var(--shadow-lg);
    z-index: 10000;
    max-width: 380px;
    width: 92%;
    text-align: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-alert.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.alert-icon {
    font-size: 42px;
    margin-bottom: 18px;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.1);
    }

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

.alert-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.65;
    font-weight: 500;
}

.alert-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    padding: 11px 36px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 18px var(--pri-glow);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--pri-glow);
}

.alert-btn:active {
    transform: scale(0.97);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
    .language-panel {
        width: 155px;
    }
}

@media (max-width: 992px) {
    .workspace {
        flex-direction: column;
    }

    .container {
        flex-direction: column !important;
    }

    .language-panel {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-radius: var(--border-radius);
    }

    .language-title {
        border-bottom: none;
        border-right: 1px solid var(--border);
        writing-mode: initial;
    }

    #languageList {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
    }

    #languageList li {
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    #languageList li:hover {
        border-left-color: transparent;
        border-bottom-color: rgba(109, 94, 240, 0.4);
    }

    #languageList li.active {
        border-left-color: transparent;
        border-bottom-color: var(--secondary-color);
    }

    .language-ad {
        display: none;
    }
}

@media (max-width: 768px) {
    .editor-heading {
        padding: 14px 12px 6px;
    }

    .toolbar {
        padding: 8px 12px;
        gap: 7px;
    }

    button {
        padding: 7px 12px;
        min-height: 32px;
    }

    .workspace {
        padding: 0 10px 10px;
        gap: 10px;
    }

    .container {
        gap: 10px;
    }

    #editor {
        padding: 12px;
        border-radius: 12px;
    }

    .output-section {
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .gradient-text {
        font-size: 1.3rem;
    }

    .by-text {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    button {
        font-size: 10px;
        padding: 7px 11px;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .workspace {
        padding: 0 8px 8px;
    }

    .container {
        gap: 8px;
    }

    #editor {
        font-size: 12px;
        padding: 10px;
    }

    .output-content {
        font-size: 11px;
        padding: 9px 11px;
    }

    button {
        padding: 6px 10px;
        font-size: 9px;
    }

    .log-entry {
        padding: 7px 9px;
    }
}

/* ─── ACCESSIBILITY ─── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── PRINT ─── */
@media print {
    body {
        background: white;
        color: black;
    }

    button {
        display: none;
    }

    .output-section {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ===== Tab Bar Container ===== */
/* ===== Tab Bar Container ===== */
.tab-bar {
    display: flex;
    align-items: flex-end;
   
    padding: 8px 8px 0 8px;
    gap: 4px;
    position: relative;
    height: 46px;

}

.tab-list {
    display: flex;
    align-items: flex-end;
    flex: 1;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #4a4a6a transparent;
    padding-bottom: 0;
}

.tab-list::-webkit-scrollbar {
    height: 5px;
}

.tab-list::-webkit-scrollbar-track {
    background: transparent;
}

.tab-list::-webkit-scrollbar-thumb {
    background: #4a4a6a;
    border-radius: 10px;
}

.tab-list::-webkit-scrollbar-thumb:hover {
    background: #6c6c96;
}

/* ===== Individual Tab — rounded top like a browser tab ===== */
.tab {
    display: flex;
    align-items: center;
    gap: px;
    padding: 10px 14px;
    min-width: 120px;
    max-width: 190px;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    color: #f4f4f9;
    background: #23dca8;
    border-radius: 10px 10px 0 0;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    transform: translateY(0);
}

.tab:hover:not(.active) {
    background: #30304e;
    color: #ffffff;
    transform: translateY(-1px);
}

.tab.active {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
color: #000016;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

/* Glowing gradient bar on top of the active tab */
.tab.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #00d9a3, #de5506, #20bf6b);
}

/* Rounded "notch" effect connecting active tab smoothly to editor below */
.tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 6px;
    background: #fafafa;
}

.tab-icon {
    font-size: 13px;
    opacity: 0.8;
    flex-shrink: 0;
    filter: drop-shadow(0 0 2px rgba(255, 214, 0, 0.4));
}

.tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    letter-spacing: 0.2px;
}

.tab.unsaved .tab-name::after {
    content: " ●";
    font-size: 8px;
    color: #ff7675;
    vertical-align: middle;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: inherit;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 0.6;
    transform: scale(1);
}

.tab-close:hover {
    opacity: 1 !important;
    background: rgba(214, 48, 49, 0.15);
    color: #d63031 !important;
    transform: scale(1.15) !important;
}

/* ===== New Tab Button ===== */
.new-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 34px;
    flex-shrink: 0;

    border: none;

    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #00d9a3, #00b894);
   
}

.new-tab-btn:hover {
    
    color: #ffffff;

}

.new-tab-btn:active {
    
}

/* ===== Font Size Control (pill/segmented style) ===== */
.font-size-control {
    display: inline-flex;
    align-items: center;
    background: #26263e;
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.font-size-control button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9a9ab8;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
  
}

.font-size-control button:hover {
    background: linear-gradient(135deg, #00d9a3, #00b894);
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.4);
}

.font-size-control button:active {
    transform: scale(0.92);
}

#fontSizeLabel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #e0e0f0;
    letter-spacing: 0.3px;
    user-select: none;
}

.object-tree.collapsed,
.prototype-content.collapsed {
    display: none;
}
.expandable {
    cursor: pointer;
    user-select: none;
}
.expandable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 16px;
}

.expandable::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #6c5ce7;
    transform: translateY(-50%);
    transition: transform 0.15s ease;
}

.expandable.expanded::before {
    transform: translateY(-50%) rotate(90deg);
}
.prototype-section {
    margin-top: 6px;
    border-left: 2px solid #6c5ce7;
    padding-left: 10px;
}