/* VARIÁVEIS DE TEMA */
:root{
--color-primary:#92400e;
--color-primary-light:#fcd34d;
--color-primary-dark:#451a03;
--color-primary-glow:rgba(146,64,14,.5);
--bg-gradient-start:#0c0704;
--bg-gradient-end:#1f1209;
--bg-gradient-endop:#92400e12;
--bg-overlay:rgba(12,7,4,.96);
--bg-card:rgba(12,7,4,.75);
--status-online:#22c55e;
--status-warning:#f59e0b;
--status-maintenance:#78716c;
--status-offline:#0c0704;
--text-primary:#fff7ed;
--text-secondary:#fcd34d;
--text-muted:#a8a29e;
--color-gold:#fde047;
--color-border:#92400e;
--color-grid:#fcd34d45;
--shadow-glow:0 0 10px var(--color-primary-glow);
--shadow-card:0 6px 20px rgba(146,64,14,.35);
--shadow-large:0 12px 32px rgba(0,0,0,.9),0 0 26px var(--color-primary-glow);
--color-shadow:#92400e33;
--hud-padding:15px 30px;
--border-radius:8px;
--border-radius-large:12px;
--transition-fast:.2s ease;
--transition-normal:.3s ease;
--transition-slow:.5s ease;
}
/* ============================================ */
/* RESET E BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*::-webkit-scrollbar {
    display: none;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--color-primary);
    line-height: 1.5;
}
/* ============================================ */
/* LAYOUT PRINCIPAL */
.container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}
/* ============================================ */
/* HUD SUPERIOR */
.hud-top {
    background: linear-gradient(180deg, var(--bg-gradient-end) 0%, var(--bg-overlay) 100%);
    padding: var(--hud-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
    z-index: 100;
    flex-wrap: wrap;
    gap: 5px;
}
.hud-section {
    display: flex;
    align-items: center;
    gap: 5px;
}
/* ============================================ */
/* STAT BOXES */
.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 8px 15px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 0 15px var(--color-shadow);
    transition: transform var(--transition-fast);
}
.stat-box:hover {
    transform: translateY(-2px);
}
.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-value {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: var(--shadow-glow);
}
/* ============================================ */
/* INFORMAÇÕES DO USUÁRIO */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-avatar {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform var(--transition-fast);
}
.user-avatar:hover {
    transform: scale(1.1)
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.user-name {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
}
/*==============================================*/
/* MENU GLOBAL MAPA */
#uiActions{
  position:absolute;
  bottom:5px;
  right:5px;
  display:flex;
  gap:5px;
  z-index:1;
}
#uiActions button{
  width:36px;
  height:36px;
  border:none;
  border-radius:8px;
  background:#fff1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .25s ease;
}
#uiActions svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:#fff5;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#iconCompress{display:none;}
body.fullscreen #iconExpand{display:none;}
body.fullscreen #iconCompress{display:block;}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#reloadPage svg.spin {
  stroke:#fff;
  animation: spin .7s linear infinite;
}
/* ============================================ */
/* CONTAINER DO MAPA */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, var(--bg-gradient-endop) 0%, var(--bg-gradient-start) 90%);
    border: 2px solid var(--color-primary);
    border-radius: 16px;
    margin: 0 5px;
}
.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(var(--color-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}
/* ============================================ */
/* CANVAS DO MAPA */
canvas {
    display: block;
    cursor: grab;
    position: relative;
    z-index: 1;
    animation: slideUpi 0.5s ease-out;
}
@keyframes slideUpi {
    from {
        transform: scale(0.1) translateY(200%);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
canvas.dragging {
    cursor: grabbing;
}
/* ============================================ */
/* DECORAÇÕES ROTATIVAS */
.iconegirado,
.iconegirado01,
.iconegirado02 {
    position: absolute;
    animation: rotate infinite linear;
    pointer-events: none;
    opacity: 0.2;
}
.iconegirado {
    width: 810px;
    bottom: -450px;
    right: -450px;
    animation-duration: 180s;
    z-index: 0;
}
.iconegirado01 {
    width: 810px;
    top: -450px;
    left: -450px;
    animation-duration: 180s;
    z-index: 0;
}
.iconegirado02 {
    width: 120px;
    top: -60px;
    right: -60px;
    animation-duration: 10s;
    z-index: -1;
}
.iconelogo {
    position: absolute;
    width: 200px;
    bottom: 20px;
    left: 20px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}
.iconelogoo {
    width: 200px;
    pointer-events: none;
}
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
/* ============================================ */
/* TOOLTIP */
.tooltip {
    position: fixed;
    background: linear-gradient(135deg, var(--bg-gradient-end), var(--bg-gradient-start));
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-large);
    padding: 15px;
    min-width: 260px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--shadow-large);
    opacity: 0;
    transition: opacity var(--transition-fast);
    overflow: hidden;
}
.tooltip.active {
    opacity: 1;
}
.tooltip-header {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-size: 12px;
}
.tooltip-label {
    color: var(--text-secondary);
}
.tooltip-value {
    color: var(--text-primary);
    font-weight: bold;
}
/* ============================================ */
/* BARRAS DE PROGRESSO */
.efficiency-bar,
.modal-progress-bar {
    width: 100%;
    height: 6px;
    background: #000c;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
    border: 1px solid var(--color-border);
}
.modal-progress-bar {
    height: 20px;
    border-radius: 10px;
    position: relative;
}
.efficiency-fill,
.modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    transition: width var(--transition-normal);
}
.modal-progress-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: bold;
}
/* ============================================ */
/* HUD INFERIOR */
.hud-bottom {
    background: linear-gradient(0deg, var(--bg-gradient-end) 0%, var(--bg-overlay) 100%);
    padding: var(--hud-padding);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px var(--color-shadow);
    z-index: 100;
    flex-wrap: wrap;
    gap: 15px;
}
.global-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform var(--transition-fast);
}
.global-stat:hover {
    transform: translateY(-3px);
}
.global-stat-icon {
    width: 40px;
    height: 40px;
    background: var(--color-shadow);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.global-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: var(--shadow-glow);
}
.global-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
/* ============================================ */
/* CONTROLES DE ZOOM */
.zoom-controls {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}
.zoom-btn {
    width: 40px;
    height: 40px;
    background: var(--color-primary-dark);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(5px);
}
.zoom-btn:hover {
    background: var(--color-border);
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}
/* ============================================ */
/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0007;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(5px);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-panel {
    position: fixed;
    top: 0;
    left: -500px;
    width: 450px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-end) 0%, var(--bg-gradient-start) 100%);
    border-right: 2px solid var(--color-border);
    box-shadow: 5px 0 30px #000e;
    z-index: 600;
    overflow-y: auto;
    transition: left var(--transition-normal);
}
.modal-panel.active {
    left: 0;
}
.modal-header {
    background: var(--color-shadow);
    padding: 20px;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}
.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: var(--shadow-glow);
}
.modal-close {
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.modal-content {
    padding: 10px;
}
.modal-section {
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-large);
    padding: 10px;
}
model-viewer {
    width: 100%;
    height: 400px;
    border-radius: 6px;
}
.modal-section-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.modal-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    padding: 8px 0;
}
.modal-stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}
.modal-stat-value {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 15px;
}

/* ============================================ */
/* COMPARAÇÕES */
.modal-comparison {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
}
.comparison-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 10px;
    text-align: center;
    transition: transform var(--transition-fast);
}
.comparison-card:hover {
    transform: translateY(-2px);
}
.comparison-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 5px;
}
.comparison-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}
.comparison-diff {
    font-size: 11px;
    margin-top: 5px;
}
.comparison-diff.positive {
    color: var(--status-online);
}
.comparison-diff.negative {
    color: var(--status-offline);
}

.comparison-diff.neutral {
    color: var(--status-maintenance);
}
/* ============================================ */
/* INDICADORES DE STATUS */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.status-online {
    background: var(--status-online);
    box-shadow: 0 0 10px var(--status-online);
}
.status-warning {
    background: var(--status-warning);
    box-shadow: 0 0 10px var(--status-warning);
}
.status-maintenance {
    background: var(--status-maintenance);
    box-shadow: 0 0 10px var(--status-maintenance);
}
.status-offline {
    background: var(--status-offline);
    box-shadow: 0 0 10px var(--status-offline);
}
/* ============================================ */
/* CRÉDITOS */
.credits-display {
    color: var(--color-gold);
    text-shadow: 0 0 10px var(--color-gold);
}
/* ============================================ */
/* RESPONSIVIDADE */
@media (max-width: 768px) {
    :root {
        --hud-padding: 10px 15px;
    }
    .hud-top,
    .hud-bottom {
        padding: 10px 5px;
    }
    .hud-section {
        min-width: 100%;
        justify-content: space-between;
    }
    .stat-box {
        padding: 5px;
    }
    .stat-value {
        font-size: 14px;
    }
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    .user-name {
        font-size: 18px;
        margin-bottom:-5px;
    }
    .user-details {
        margin-bottom:-5px;
    }
    .xp-bar {
        width: 100px;
    }
    .tooltip {
        min-width: 200px;
        padding: 10px;
        font-size: 11px;
    }
    .global-stat-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    .global-stat-value {
        font-size: 16px;
    }
    .modal-panel {
        width: 100%;
        left: -100%;
    }
    .zoom-controls {
        right: 10px;
    }
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}
/* ============================================ */
/* UTILITÁRIOS */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}