/* Main toolbox shell styles. Tool-specific styles stay with their modules. */

@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 0.5s ease-in-out;
}

body.has-wallpaper {
    background-color: rgba(241, 245, 249, 0.32);
    background-blend-mode: screen;
}

.app-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
}

:where(button, a, input, select, textarea):focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

button:disabled {
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

mark {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
    transition: all 0.3s ease-in-out;
}

mark.active-highlight {
    outline: 2px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -12px;
    margin-top: -12px;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

#preview-container::-webkit-scrollbar,
.control-panel-scroller::-webkit-scrollbar,
.h5-tool-scroller::-webkit-scrollbar {
    width: 6px;
}

#preview-container::-webkit-scrollbar-track,
.control-panel-scroller::-webkit-scrollbar-track,
.h5-tool-scroller::-webkit-scrollbar-track {
    background: transparent;
}

#preview-container::-webkit-scrollbar-thumb,
.control-panel-scroller::-webkit-scrollbar-thumb,
.h5-tool-scroller::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 10px;
}

#preview-container::-webkit-scrollbar-thumb:hover,
.control-panel-scroller::-webkit-scrollbar-thumb:hover,
.h5-tool-scroller::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

.notification {
    transition: opacity 0.5s, transform 0.5s;
    z-index: 100;
}

.tab-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.tab-btn.active {
    color: #4f46e5;
    background-color: rgba(238, 242, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.24), 0 4px 14px rgba(99, 102, 241, 0.1);
}

.top-tab-list {
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

.top-tab-list::-webkit-scrollbar {
    display: none;
}

.top-tab-list .tab-btn {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.filename-part {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
}

.filename-part:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.filename-part.dragging {
    opacity: 0.5;
    background: #c7d2fe;
    border-style: dashed;
    border-color: #4f46e5;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

body.has-wallpaper .glass-panel {
    background: rgba(255, 255, 255, 0.78);
}

body.has-wallpaper .glass-panel .text-slate-400 {
    color: #64748b;
}

body.has-wallpaper .glass-panel .text-slate-500 {
    color: #475569;
}

@media (min-width: 1024px) {
    /* Keep imported LUCID editor content from increasing the outer grid row height. */
    #tools-right-column {
        contain: size;
    }
}

main {
    overscroll-behavior: contain;
}

body:not(.has-wallpaper) #preview-wrapper {
    background-color: rgba(241, 245, 249, 0.95);
}

body.has-wallpaper #preview-wrapper {
    background-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 639px) {
    .app-nav .container {
        align-content: center;
    }

    .top-tab-list {
        mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
        padding-inline: 10px;
    }
}
