/* ==========================================================================
   535 DESIGN • SIMULADOR DE FROTAS COMERCIAIS & CAR WRAPPING
   Estúdio de Engenharia Visual 2D • Design System Oficial
   Cores: #22212e | #1c1b26 | #282637 | #f07d00 | #06b6d4 | #22c55e
   ========================================================================== */

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

/* Blueprint de Estúdio de Frotas (Grelha Milimétrica Técnica) */
.frotas-blueprint-grid {
    background-color: #171620;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
    background-size: 15px 15px, 15px 15px, 75px 75px, 75px 75px;
    background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}

/* Stage de Visualização da Viatura */
.vehicle-stage-wrapper {
    position: relative;
    width: 100%;
    min-height: 440px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    overflow: hidden;
}

.vehicle-stage-wrapper svg {
    width: 100%;
    height: 100%;
    max-height: 480px;
    filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.75));
    transition: filter 0.3s ease;
}

/* Camada da Chapa com Transição Suave de Cor */
.vehicle-body-paint {
    transition: fill 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zonas de Vinil Interativas na Viatura (Snap Zones) */
.snap-zone-group {
    cursor: pointer;
    pointer-events: all;
    transition: opacity 0.2s ease;
}

.snap-zone-rect {
    fill: rgba(6, 182, 212, 0.03);
    stroke: rgba(6, 182, 212, 0.35);
    stroke-width: 1.5;
    stroke-dasharray: 5, 4;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: all;
    cursor: pointer;
}

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

.snap-zone-label {
    transition: fill 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    user-select: none;
}

.snap-zone-group:hover .snap-zone-label {
    fill: #f07d00;
    font-weight: 800;
}

.snap-zone-rect.active {
    stroke: #06b6d4;
    fill: rgba(6, 182, 212, 0.1);
    stroke-dasharray: none;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.3));
}

.snap-zone-rect.snap-highlight {
    stroke: #22c55e !important;
    stroke-width: 2.5 !important;
    fill: rgba(34, 197, 94, 0.18) !important;
    filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.8)) !important;
}

/* Bounding Box do Grafismo e Arraste Fluído */
.interactive-logo-group {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

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

.logo-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-logo-group.is-dragging .logo-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;
}

@keyframes guideGlow {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 0.65; }
}

.alignment-guide-badge {
    fill: #15141e;
    stroke: #22c55e;
    stroke-width: 1.2;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}

.alignment-guide-text {
    fill: #22c55e;
    font-family: 'Asap Condensed', monospace, sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-anchor: middle;
    dominant-baseline: central;
}

/* 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 & Réguas Métricas (#06b6d4 Ciano) */
.cota-line {
    stroke: #06b6d4;
    stroke-width: 1.5;
    opacity: 0.9;
}

.cota-guide {
    stroke: rgba(6, 182, 212, 0.4);
    stroke-width: 1;
    stroke-dasharray: 2, 2;
}

.cota-tick {
    stroke: #06b6d4;
    stroke-width: 1.5;
}

.cota-text-badge {
    fill: #171620;
    stroke: #06b6d4;
    stroke-width: 1;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.cota-text {
    font-family: 'Asap Condensed', monospace, sans-serif;
    font-size: 11px;
    font-weight: 700;
    fill: #06b6d4;
    text-anchor: middle;
    dominant-baseline: central;
    letter-spacing: 0.05em;
}

/* Camada de Vinil de Corte (Textos) */
.vinyl-cut-text {
    font-family: 'Asap Condensed', sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
    user-select: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
    pointer-events: none;
}

/* Cartões Técnicos da 535 */
.frotas-card {
    background: #1c1b26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.frotas-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* Botões de Silhueta */
.silhouette-btn {
    background: #282637;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.silhouette-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(240, 125, 0, 0.4);
    transform: translateY(-1px);
}

.silhouette-btn.active {
    background: rgba(240, 125, 0, 0.12);
    border-color: #f07d00;
    box-shadow: 0 0 15px rgba(240, 125, 0, 0.25);
}

.silhouette-btn.active .silhouette-title {
    color: #f07d00;
}

/* Amostras de Cor (Color Swatches) */
.paint-swatch {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paint-swatch::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 9999px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.paint-swatch:hover::after {
    border-color: rgba(240, 125, 0, 0.4);
}

.paint-swatch.active::after {
    border-color: #f07d00;
    box-shadow: 0 0 10px rgba(240, 125, 0, 0.5);
}

/* Botões de Ângulo (Lateral, Traseira, Frente) */
.angle-btn {
    background: #282637;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.2s ease;
}

.angle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.angle-btn.active {
    background: #f07d00;
    border-color: #f07d00;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(240, 125, 0, 0.4);
}

/* Botões de Snap Zone Rápida */
.quick-snap-btn {
    background: #282637;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.quick-snap-btn:hover {
    border-color: #06b6d4;
    color: #ffffff;
    background: rgba(6, 182, 212, 0.1);
}

.quick-snap-btn.active {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Sliders Técnicos Customizados */
input[type="range"].tech-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #282637;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

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

input[type="range"].tech-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

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

/* Micro Animações e Pulso */
@keyframes cotaPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

.cota-pulsing {
    animation: cotaPulse 2s infinite ease-in-out;
}

/* Animação Suave do Modal */
.frotas-modal-backdrop {
    background: rgba(18, 17, 26, 0.88);
    backdrop-filter: blur(8px);
}

.frotas-modal-content {
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   BARRA FLUTUANTE DE AÇÕES RÁPIDAS (STAGE HUD) & D-PAD TÁTIL
   ========================================================================== */
.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 Grafismos 535 */
.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-logo-group.is-inactive {
    cursor: pointer !important;
    opacity: 0.88;
    transition: opacity 0.2s ease;
}

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

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

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

