:root {
    --bg: #1c2130ff;
    --fg: #ffffffff;
    --menu: #383b40ff;
    --hil: #3b82f6;
    --hil2: #c2a523ff;
    --hil3: #806c17ff;
}

[x-cloak] { display: none !important; }

.clickable {
    cursor: pointer;
    color: var(--hil);
    transition: color 0.3s ease-in-out;
}

.clickable:hover {
    color: var(--hil2);
}

.clickable:active {
    color: var(--hil3);
}

body {
    background-color: var(--bg);
    color: var(--fg);
    background-image:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.08), transparent 55%),
        radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.08), transparent 55%);
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.clickbutton {
    cursor: pointer;
    background-color: var(--hil);
    transition: background-color 0.15s ease-in-out;
}

.clickbutton:hover {
    filter: brightness(1.1);
}

.clickbutton:active {
    filter: brightness(0.9);
}

#output {
    display: flex;
    flex-direction: column;
}

#terminal {
    flex: 1;
    min-height: 0;
    background-color: var(--bg);
}

#terminal .terminal {
    height: 100% !important;
    --background: var(--bg) !important;
    --color: var(--fg) !important;
    background-color: var(--bg) !important;
}

.pane {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(55, 65, 81, 0.5);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

#toolbar-left,
#toolbar-right {
    background-color: var(--menu) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.pane-divider {
    width: 6px;
    cursor: col-resize;
    background: rgba(75, 85, 99, 0.5);
    margin: 0 4px;
    border-radius: 999px;
}

.pane-divider:hover {
    background: var(--hil);
}

@media (max-width: 900px) {
    #doublepanel {
        flex-direction: column;
    }

    #left-pane,
    #output {
        width: 100% !important;
        height: 50%;
    }

    .pane-divider {
        display: none;
    }
}

.CodeMirror {
    height: 100% !important;
    background-color: var(--bg) !important;
    color: var(--fg) !important;
}

#editor {
    overflow: hidden !important;
    background-color: var(--bg);
}

#left-pane {
    display: flex;
    flex-direction: column;
}

#editor {
    flex: 1;
    min-height: 0; 
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Tab bar horizontal scroll */
.tab-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tab-scroll::-webkit-scrollbar {
    display: none;
}

/* Fix DaisyUI select dropdown text in dark mode */
.select option {
    background: #1f2937;
    color: #f3f4f6;
}

/* ===== Custom Toggle Switch (replaces broken DaisyUI v5 toggle) ===== */
/* DaisyUI v5 @layer nesting conflicts with Tailwind browser runtime, */
/* so we implement our own toggle CSS from scratch.                    */
input.toggle {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 3rem !important;
    height: 1.5rem !important;
    border-radius: 9999px !important;
    background-color: #374151 !important;
    position: relative !important;
    display: inline-block !important;
    vertical-align: middle !important;
    border: 2px solid transparent !important;
    transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
    flex-shrink: 0 !important;
}

input.toggle::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: calc(1.5rem - 8px) !important;
    height: calc(1.5rem - 8px) !important;
    border-radius: 9999px !important;
    background-color: #9ca3af !important;
    transition: transform 0.2s ease, background-color 0.2s ease !important;
    display: block !important;
}

input.toggle:checked {
    background-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
}

input.toggle:checked::after {
    transform: translateX(calc(3rem - 1.5rem)) !important;
    background-color: white !important;
}

input.toggle:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

/* Toggle color variants */
input.toggle-primary:checked {
    background-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
}

input.toggle-success:checked {
    background-color: #22c55e !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3) !important;
}

input.toggle-warning:checked {
    background-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
}

input.toggle-error:checked {
    background-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

/* ===== Custom Range Slider ===== */
input[type="range"].range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.5rem;
    border-radius: 9999px;
    background: #374151;
    outline: none;
}

input[type="range"].range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid #1f2937;
}

input[type="range"].range::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid #1f2937;
}
