/* Alpine.js cloak utility */
[x-cloak] {
    display: none !important;
}

/* Loader animation */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Fade transitions */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Admin config editor */
.config-editor-shell {
    display: flex;
    height: 70vh;
    min-height: 520px;
    max-height: calc(100vh - 220px);
    overflow: hidden;
    background: #020617;
}

.config-line-gutter {
    flex: 0 0 3.5rem;
    width: 3.5rem;
    height: 100%;
    overflow: hidden;
    user-select: none;
    border-right: 1px solid #1f2937;
    background: #111827;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.5rem;
}

.config-line-number {
    height: 1.5rem;
    padding: 0 0.5rem;
    text-align: right;
    line-height: 1.5rem;
}

.config-line-number-error {
    background: rgba(127, 29, 29, 0.7);
    color: #fee2e2;
}

.config-code-editor {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    resize: none;
    overflow: auto;
    border: 0;
    background: #020617;
    color: #f3f4f6;
    padding: 0.75rem 1rem;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.5rem;
    tab-size: 2;
}

.config-code-editor:focus {
    box-shadow: inset 0 0 0 1px #38bdf8;
}

@media (max-width: 640px) {
    .config-editor-shell {
        height: 65vh;
        min-height: 420px;
        max-height: none;
    }
}
