/* Estilos customizados e regras de layout responsivo (Mobile & Desktop) */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    -webkit-tap-highlight-color: transparent;
}

#canvas-3d-container {
    width: 100%;
    height: 100%;
    touch-action: none;
    position: relative;
    background: #0f172a;
}

/* Regras essenciais para funcionamento mesmo sem Tailwind CDN */
.hidden {
    display: none !important;
}

.tab-panel {
    transition: opacity 0.2s ease-in-out;
}

/* Customização de controles deslizantes (Sliders de dobra) */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #334155;
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #0284c7;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    border: 2px solid #ffffff;
}

/* Scrollbars customizadas */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

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

/* Painel retrátil mobile */
@media (max-width: 768px) {
    #app-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 88%;
        max-width: 380px;
        z-index: 50;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 25px rgba(0, 0, 0, 0.5);
    }

    #app-sidebar.translate-x-full {
        transform: translateX(100%);
    }

    #app-sidebar.mobile-open {
        transform: translateX(0);
    }
}

/* Modo de Impressão para a Oficina / Serralheria */
@media print {
    body {
        overflow: auto;
        background: white !important;
        color: black !important;
    }

    #canvas-3d-container,
    #app-sidebar,
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}
