/* ===============================
   ROOT CONTAINER
================================ */
#models-app {
    position: relative;
    font-family: Inter, system-ui, Arial, sans-serif;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    touch-action: pan-y;
}

/* ===============================
   VIEWER CORE
================================ */

#models-app #root {
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* wrapper for image + arrows */
#models-app .relative {
    position: relative;
}

#models-app .min-h-60 {
    min-height: 15rem;
}

/* prev / next buttons */
#models-app .btn.prev,
#models-app .btn.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

#models-app .btn.next {
    right: 8px;
}

#models-app .btn.prev {
    left: 8px;
}

#models-app .btn.prev:hover,
#models-app .btn.next:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #94a3b8;
}

/* image wrapper */
#models-app .max-w-\[1000px\] {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

#models-app .max-h-\[80\%\] {
    max-width: 100%;
    height: auto;
}

/* ===============================
   RANGE SLIDER
================================ */

#models-app .range-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
}

#models-app .range-slider__progress {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #3b82f6;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}

#models-app input[type="range"] {
    width: 100%;
    height: 4px;
    appearance: none;
    background: #e5e7eb;
    position: relative;
    z-index: 2;
    border-radius: 2px;
    max-width: 100%;
    outline: none;
}

#models-app input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

#models-app input[type="range"]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

#models-app input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
}

#models-app input[type="range"]::-moz-range-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
}

#models-app .scale-values {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* ===============================
   FORM ELEMENTS
================================ */

#models-app .form-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

#models-app .label {
    font-size: 12px;
}

#models-app .label-text {
    color: #475569;
}

#models-app .select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    background: #fff;
    font-size: 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    appearance: auto;
}

#models-app .select-bordered {
    border: 1px solid #cbd5f5;
}

/* ===============================
   BUTTON (viewer only)
================================ */

#models-app .btn {
    padding: 6px 10px;
    border-radius: 6px;
    background: #e2e8f0;
    border: 1px solid transparent;
    cursor: pointer;
}

#models-app .btn:hover {
    background: #cbd5f5;
}

/* ===============================
   LOADING SPINNER
================================ */

#models-app .loading {
    display: inline-block;
}

#models-app .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #cbd5f5;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#models-app .loading-md {
    width: 32px;
    height: 32px;
}

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

/* ===============================
   LAYOUT UTILITIES
================================ */

#models-app .flex {
    display: flex;
}

#models-app .flex-col {
    flex-direction: column;
}

#models-app .flex-wrap {
    flex-wrap: wrap;
}

#models-app .items-center {
    align-items: center;
}

#models-app .justify-center {
    justify-content: center;
}

#models-app .justify-between {
    justify-content: space-between;
}

#models-app .grid {
    display: grid;
}

#models-app .grid > * {
    min-width: 0;
}

#models-app .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

#models-app .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#models-app .gap-1 {
    gap: 4px;
}

#models-app .gap-3 {
    gap: 12px;
}

#models-app .space-y-3 > * + * {
    margin-top: 12px;
}

#models-app .w-full {
    width: 100%;
}

#models-app .max-w-5xl {
    max-width: 64rem;
    margin: 0 auto;
}

#models-app .hidden {
    display: none;
}

#models-app .text-sm {
    font-size: 14px;
}

#models-app .text-slate-500 {
    color: #64748b;
}

#models-app .text-slate-900 {
    color: #0f172a;
}

#models-app .text-white {
    color: #ffffff;
}

#models-app .bg-blue-500 {
    background-color: #3b82f6;
}

#models-app .mt-8 {
    margin-top: 2rem;
}

#models-app .mb-10 {
    margin-bottom: 2.5rem;
}

#models-app .pt-2 {
    padding-top: 0.5rem;
}

#models-app .py-0 {
    padding-top: 0;
    padding-bottom: 0;
}

#models-app .px-1 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

#models-app .w-9 {
    width: 2.25rem;
}

/* ===============================
   IMAGE HANDLING
================================ */

#models-app img {
    max-width: 100%;
    height: auto !important;
    display: block;
}

#models-app .h-full {
    max-width: 100%;
    height: auto !important;
}

/* ===============================
   MOBILE FIXES
================================ */

@media (max-width: 575.98px) {
    #models-app .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #models-app .btn.prev,
    #models-app .btn.next {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    #models-app .btn.prev {
        left: 6px;
    }

    #models-app .btn.next {
        right: 6px;
    }

    #models-app .max-w-\[1000px\] {
        max-width: 100%;
    }

    #models-app .scale-values {
        font-size: 11px;
    }
}

/* ===============================
   TABLET / DESKTOP
================================ */

@media (min-width: 576px) {
    #models-app .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #models-app .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}