/* style.css - Interface Técnica Profissional SCOUT NDT Workstation */
:root {
    --primary: #0284c7;
    --primary-bright: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --bg-dark: #070a0e;
    --card-surface: #0f151c;
    --border-subtle: #1e293b;
    --border-highlight: rgba(56, 189, 248, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Flash de Câmera */
#camera-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 99;
}

.flash-anim {
    animation: flashEffect 0.25s ease-out forwards;
}

@keyframes flashEffect {
    0% { opacity: 0.75; }
    100% { opacity: 0; }
}

/* ==========================================================================
   MODAL DE ORDEM DE SERVIÇO & LOCAL (DESIGN CORPORATIVO INDUSTRIAL)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 11, 0.94);
    backdrop-filter: blur(14px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mission-card-container {
    background: var(--card-surface);
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    max-width: 1120px;
    width: 100%;
    padding: 28px 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px var(--primary-glow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.finish-container {
    max-width: 580px;
}

.mission-header {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
}

.header-pre-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-badge {
    background: #eab308;
    color: #000;
    font-weight: 800;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 3px;
    letter-spacing: 0.8px;
}

.system-version {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mission-header h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.mission-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.mission-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.mission-card {
    background: #090d12;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.mission-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: #0d131a;
    transform: translateY(-2px);
}

.mission-card.active {
    border-color: var(--primary-bright);
    background: #0e1722;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.card-status-dot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.mission-card.active .card-status-dot {
    background: var(--primary-bright);
    box-shadow: 0 0 8px var(--primary-bright);
}

.card-header-line {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-code {
    font-size: 10px;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary-bright);
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 6px;
    border-radius: 3px;
}

.card-type {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.mission-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.card-desc {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    flex-grow: 1;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.mission-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: #090d12;
    padding: 14px 18px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    background: #05070a;
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12.5px;
    outline: none;
    transition: border 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary-bright);
}

.mission-footer {
    display: flex;
    justify-content: flex-end;
}

.start-mission-btn {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.start-mission-btn:hover {
    background: #0369a1;
    box-shadow: 0 0 16px var(--primary-glow);
}

/* Modal de Conclusão */
.status-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--success);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 6px;
}

.report-summary-box {
    background: #090d12;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
}

.summary-line .lbl {
    color: var(--text-muted);
}

.summary-line .val {
    color: #ffffff;
    font-weight: 600;
}

.code-highlight {
    font-family: monospace;
    color: var(--primary-bright) !important;
}

.count-highlight {
    color: var(--success) !important;
}

.summary-notice {
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 4px;
}

.finish-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finish-secondary-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==========================================================================
   HUD OVERLAY (PROFISSIONAL NDT WORKSTATION)
   ========================================================================== */
#hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 20px;
}

.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    background: rgba(11, 17, 24, 0.88);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    background: #eab308;
    color: #000;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.title-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #cbd5e1;
    font-family: monospace;
}

.telemetry-badges {
    display: flex;
    gap: 8px;
    font-size: 12px;
    font-family: monospace;
}

.status-badge {
    background: #090d12;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.status-badge.active {
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--primary-bright);
}

/* Retículo da Câmera FPV */
.hud-center-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cam-frame {
    width: 300px;
    height: 190px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    position: relative;
    border-radius: 4px;
}

.cam-frame::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border: 1px solid var(--primary-bright);
    border-radius: 50%;
}

.rec-indicator {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: monospace;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rec-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: blinkRec 1s infinite;
}

@keyframes blinkRec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

#hud-notification {
    background: rgba(11, 17, 24, 0.94);
    border: 1px solid var(--primary-bright);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    margin-top: 14px;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-6px);
}

#hud-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Barra Inferior */
.hud-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: auto;
}

.controls-guide-panel {
    background: rgba(11, 17, 24, 0.88);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 340px;
    backdrop-filter: blur(8px);
}

.panel-header-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.actions-group {
    display: flex;
    gap: 8px;
}

.hud-btn {
    background: #0f151c;
    color: #cbd5e1;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-btn:hover {
    background: #1e293b;
    border-color: rgba(56, 189, 248, 0.4);
    color: #ffffff;
}

.hud-btn.secondary-btn {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--border-subtle);
}

.hud-btn.primary {
    background: #0284c7;
    color: #ffffff;
    border-color: #0369a1;
}

.hud-btn.primary:hover {
    background: #0369a1;
}

.hud-btn.success {
    background: #059669;
    color: #ffffff;
    border-color: #047857;
}

.hud-btn.success:hover {
    background: #047857;
}

.hud-btn.voice.recording {
    background: #b91c1c;
    color: #ffffff;
    border-color: #ef4444;
}

#vr-button-slot {
    display: inline-flex;
    align-items: center;
}

#metaquest-vr-btn {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #0369a1 !important;
    padding: 8px 14px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    cursor: pointer !important;
}

.gallery-preview {
    background: rgba(11, 17, 24, 0.88);
    border: 1px solid var(--border-subtle);
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#photo-counter {
    font-size: 10.5px;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary-bright);
}

#last-photo-thumb {
    width: 75px;
    height: 46px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

/* Tela de Carregamento */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #05080c;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.4s ease;
}

.loading-brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tech-tag {
    font-size: 10.5px;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary-bright);
    letter-spacing: 1.5px;
}

.loading-brand h2 {
    font-size: 17px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.loading-brand p {
    font-size: 12px;
    color: var(--text-muted);
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--primary-bright);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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