/* ==========================================================================
   535WEAR ATELIER TÊXTIL — ESTILOS VISUAIS & ENGENHARIA DE SIMULAÇÃO
   Design System: #22212e | #1c1b26 | #282637 | #f07d00 | #06b6d4 | #22c55e
   ========================================================================== */

/* Tipografia Técnica & Kerning Respirado */
.font-asap-condensed,
h1, h2, h3, h4, h5, h6 {
    font-family: 'Asap Condensed', sans-serif !important;
    letter-spacing: 0.035em !important;
}

/* Blueprint de Bancada Têxtil (Grelha Milimétrica Neutra) */
.atelier-blueprint-grid {
    background-color: #171620;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(240, 125, 0, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 125, 0, 0.06) 1px, transparent 1px);
    background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
    background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}

/* Silhueta e Modelo de Vestuário */
.garment-svg-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.garment-svg-wrapper svg {
    width: 100%;
    height: 100%;
    max-width: 540px;
    max-height: 540px;
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.7));
    transition: filter 0.3s ease;
}

/* Camada Base com Transição Suave de Cor de Tecido */
.garment-model .layer-base {
    transition: fill 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Área de Estampagem Permitida (Print Area Boundary) & Zonas Clicáveis */
.print-area-rect {
    fill: rgba(6, 182, 212, 0.03);
    stroke: rgba(6, 182, 212, 0.45);
    stroke-width: 1.5;
    stroke-dasharray: 4, 4;
    transition: stroke 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

.print-area-rect.snap-active {
    stroke: #22c55e;
    stroke-width: 2;
    fill: rgba(34, 197, 94, 0.06);
}

/* Zonas de Estampagem Clicáveis na Peça (Bolso, Centro Tórax, A3 Total) */
.print-zone-target {
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}

.print-zone-target rect {
    fill: rgba(6, 182, 212, 0.03);
    stroke: rgba(6, 182, 212, 0.3);
    stroke-width: 1.2;
    stroke-dasharray: 3, 3;
    transition: all 0.2s ease;
}

.print-zone-target:hover rect {
    fill: rgba(240, 125, 0, 0.12);
    stroke: #f07d00;
    stroke-width: 2;
    stroke-dasharray: 4, 2;
    filter: drop-shadow(0 0 8px rgba(240, 125, 0, 0.4));
}

.print-zone-target text {
    fill: rgba(6, 182, 212, 0.7);
    font-family: 'Asap Condensed', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    pointer-events: none;
    transition: fill 0.2s ease;
}

.print-zone-target:hover text {
    fill: #f07d00;
    font-weight: 800;
}

/* Grafismo Interativo e Caixa Bounding Box */
.interactive-art-group {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.interactive-art-group:active,
.interactive-art-group.is-dragging {
    cursor: grabbing;
}

.art-bounding-box {
    fill: rgba(6, 182, 212, 0.02);
    stroke: #06b6d4;
    stroke-width: 1.5;
    stroke-dasharray: 4, 3;
    pointer-events: none;
    opacity: 0.95;
    filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.5));
    transition: stroke 0.2s ease;
}

.interactive-art-group.is-dragging .art-bounding-box {
    stroke: #f07d00;
    stroke-dasharray: none;
    filter: drop-shadow(0 0 8px rgba(240, 125, 0, 0.7));
}

/* 4 Alças de Canto para Redimensionamento Multidirecional Proporcional */
.art-corner-handle {
    fill: #f07d00;
    stroke: #ffffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(240, 125, 0, 0.9));
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.15s ease;
    pointer-events: none;
}

.art-corner-hitarea {
    fill: transparent;
    cursor: pointer;
    pointer-events: all;
}

.art-corner-hitarea[data-handle="nw"],
.art-corner-hitarea[data-handle="se"] {
    cursor: nwse-resize !important;
}

.art-corner-hitarea[data-handle="ne"],
.art-corner-hitarea[data-handle="sw"] {
    cursor: nesw-resize !important;
}

.art-corner-hitarea:hover + .art-corner-handle,
.art-corner-handle.is-active {
    transform: scale(1.4);
    fill: #ff9d33;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 10px rgba(240, 125, 0, 1));
}

/* Guias Magnéticas de Alinhamento Central (#22c55e Verde Néon) */
.alignment-guide-line {
    stroke: #22c55e;
    stroke-width: 1.5;
    stroke-dasharray: 4, 3;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.8));
    pointer-events: none;
    animation: guideGlow 1.5s infinite ease-in-out;
}

/* Badge Flutuante SVG com Medida ao Redimensionar */
.live-resize-pill rect {
    fill: #15141e;
    stroke: #f07d00;
    stroke-width: 1.2;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

.live-resize-pill text {
    fill: #ffffff;
    font-family: 'Asap Condensed', monospace, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Linhas de Cota de Engenharia Têxtil (Cyan Néon #06b6d4) */
.cota-line-h {
    stroke: #06b6d4;
    stroke-width: 1.5;
    marker-start: url(#arrow-cyan-start);
    marker-end: url(#arrow-cyan-end);
    pointer-events: none;
}

.cota-line-v {
    stroke: #06b6d4;
    stroke-width: 1.5;
    marker-start: url(#arrow-cyan-start);
    marker-end: url(#arrow-cyan-end);
    pointer-events: none;
}

.cota-badge {
    position: absolute;
    background: rgba(21, 20, 30, 0.92);
    border: 1px solid rgba(6, 182, 212, 0.6);
    color: #06b6d4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 25;
}

/* Swatches de Cor do Tecido com Feedback Háptico Visual */
.fabric-swatch {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.fabric-swatch:hover {
    transform: scale(1.15);
}

.fabric-swatch.active {
    transform: scale(1.2);
    border-color: #f07d00;
    box-shadow: 0 0 14px rgba(240, 125, 0, 0.65), 0 0 0 2px #1c1b26;
}

.fabric-swatch.active::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 9999px;
    border: 2px solid #ffffff;
}

/* Sliders de Precisão 535 */
input[type="range"].atelier-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #15141e;
    border-radius: 9999px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

input[type="range"].atelier-slider:hover {
    border-color: rgba(240, 125, 0, 0.4);
}

input[type="range"].atelier-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f07d00;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(240, 125, 0, 0.6);
    border: 2px solid #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"].atelier-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(240, 125, 0, 0.9);
}

/* Grelha de Tamanhos com Animação de Foco */
.size-qty-input {
    background: #15141e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.size-qty-input:focus {
    border-color: #f07d00;
    box-shadow: 0 0 10px rgba(240, 125, 0, 0.3);
    outline: none;
    background: #1c1b26;
}

/* Botões de Presets de Oficina */
.preset-pos-btn {
    transition: all 0.2s ease;
}

.preset-pos-btn.active {
    background: #f07d00 !important;
    color: #ffffff !important;
    border-color: #f07d00 !important;
    box-shadow: 0 0 12px rgba(240, 125, 0, 0.45);
}

/* Modal de Folha de Produção & Conversão */
.atelier-modal-backdrop {
    backdrop-filter: blur(8px);
    background: rgba(15, 14, 23, 0.85);
}

.atelier-modal-card {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.atelier-modal-card.entering {
    transform: scale(0.95) translateY(15px);
    opacity: 0;
}

.atelier-modal-card.entered {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Animações e Micro-Interações */
@keyframes techPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.tech-snap-glow {
    animation: techPulse 1.2s infinite ease-in-out;
}

/* ==========================================================================
   BARRA FLUTUANTE DE AÇÕES RÁPIDAS (STAGE HUD) & D-PAD TÁTIL NO MANEQUIM
   ========================================================================== */
.stage-floating-hud {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 9999px;
    background: rgba(28, 27, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(6, 182, 212, 0.15);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-floating-hud.hidden-hud {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
}

.hud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-family: 'Asap Condensed', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.hud-btn:active {
    transform: translateY(1px);
}

.hud-btn-primary {
    background: rgba(240, 125, 0, 0.2);
    border-color: rgba(240, 125, 0, 0.5);
    color: #f07d00;
}

.hud-btn-primary:hover {
    background: #f07d00;
    color: #ffffff;
    border-color: #f07d00;
    box-shadow: 0 0 12px rgba(240, 125, 0, 0.5);
}

.hud-size-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    color: #06b6d4;
    padding: 0 6px;
}

/* Nudge Pad / D-Pad de Precisão no Palco */
.stage-dpad {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(28, 27, 38, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.dpad-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.dpad-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}

.dpad-btn:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #06b6d4;
    transform: scale(1.08);
}

.dpad-btn:active {
    transform: scale(0.92);
    background: #06b6d4;
    color: #ffffff;
}

.dpad-btn-center {
    background: rgba(240, 125, 0, 0.15);
    border-color: rgba(240, 125, 0, 0.4);
    color: #f07d00;
}

.dpad-btn-center:hover {
    background: #f07d00;
    color: #ffffff;
    border-color: #f07d00;
    box-shadow: 0 0 10px rgba(240, 125, 0, 0.5);
}

/* Multi-Graphic / Camadas de Estampas Têxteis */
.layer-card-item {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.layer-card-item:hover {
    border-color: rgba(240, 125, 0, 0.4);
    background-color: rgba(255, 255, 255, 0.04);
}

.layer-card-item.is-active {
    border-color: #f07d00 !important;
    background-color: rgba(240, 125, 0, 0.09) !important;
    box-shadow: 0 0 15px rgba(240, 125, 0, 0.2);
}

.layer-card-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #f07d00;
    border-radius: 4px 0 0 4px;
}

.interactive-art-group.is-inactive {
    cursor: pointer !important;
    opacity: 0.88;
    transition: opacity 0.2s ease;
}

.interactive-art-group.is-inactive:hover {
    opacity: 1;
}

.interactive-art-group.is-inactive .art-bounding-box {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-dasharray: 2, 2;
    fill: transparent;
}

.interactive-art-group.is-inactive:hover .art-bounding-box {
    stroke: rgba(240, 125, 0, 0.65);
    stroke-dasharray: 3, 3;
    fill: rgba(240, 125, 0, 0.04);
}

