:root {
    --primary: #D4AF37;
    /* Gold */
    --accent: #00f3ff;
    /* Cyber Blue */
    --bg-dark: #0a0a0c;
    --text-main: #f0f0f5;
    --text-dim: #a0a0b0;
    --glass-bg: rgba(25, 25, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-neon: 0 0 15px rgba(212, 175, 55, 0.3);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
}

#app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* HEADER */
#main-header {
    position: absolute;
    top: calc(20px + var(--safe-top));
    left: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-container {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 20px;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#store-search {
    background: none;
    border: none;
    color: #fff;
    width: 100%;
    font-size: 1rem;
    outline: none;
}

#btn-map-filter,
#btn-detect-mall,
#btn-scan-qr {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
}

#btn-detect-mall:hover,
#btn-scan-qr:hover {
    color: var(--accent);
}

#mall-identity {
    align-self: flex-start;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.4);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* VIEWPORT & MAP */
#viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map-canvas {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a25 0%, #0a0a0c 100%);
    cursor: grab;
}

.map-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.floor-selector {
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
}

.floor-btn {
    width: 45px;
    height: 45px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.floor-btn.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

.action-dock {
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    padding: 8px;
    gap: 8px;
}

.action-btn {
    width: 60px;
    min-height: 60px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: 0.3s;
    border-radius: 12px;
    padding: 5px;
}

.action-btn i {
    font-size: 1.2rem;
}

.action-btn span {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* BOTTOM NAV */
#bottom-nav {
    position: absolute;
    bottom: calc(20px + var(--safe-bottom));
    left: 20px;
    right: 20px;
    height: 75px;
    border-radius: 25px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 100;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px var(--primary));
}

/* ISOMETRIC GRID BASE */
#mall-grid {
    width: 2000px;
    height: 2000px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotateX(60deg) rotateZ(45deg);
    border: 2px solid rgba(212, 175, 55, 0.1);
    transform-style: preserve-3d;
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

.map-layer {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.store-block {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.store-block:hover {
    transform: translateZ(30px);
    background: var(--primary) !important;
    border-color: #fff;
    box-shadow: 0 0 30px var(--primary);
}

.store-block .store-label {
    transform: rotateZ(-45deg) rotateX(-60deg);
    pointer-events: none;
    text-align: center;
    position: relative;
    z-index: 5;
}

.store-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* OVERLAYS & CARDS */
#overlay-container {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    pointer-events: none;
}

#overlay-container.hidden {
    display: none;
}

.store-card,
.view-panel {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 30px;
    padding: 25px;
    pointer-events: all;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.view-panel {
    height: 70vh;
    border-radius: 40px 40px 0 0;
    margin-bottom: -20px;
}

.animate-up {
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.category-tag {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.btn-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-route-go {
    width: 100%;
    margin-top: 20px;
    padding: 18px;
    border-radius: 15px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #b8860b);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.glass-input {
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    margin: 15px 0;
    outline: none;
}

.saved-spot {
    text-align: center;
    padding: 20px 0;
}

.saved-spot h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 10px 0;
}

.pay-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 15px;
    transition: 0.3s;
}

.pay-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pay-option i {
    font-size: 1.8rem;
    color: var(--primary);
}

/* SPLASH SCREEN */
#splash-screen {
    position: fixed;
    inset: 0;
    background: #0a0a0c;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease-out, visibility 1s;
}

.splash-content {
    text-align: center;
}

.premium-logo {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 3rem;
    letter-spacing: 5px;
    margin: 0;
}

.premium-sub {
    color: #fff;
    font-size: 0.7rem;
    letter-spacing: 3px;
    opacity: 0.6;
}

.splash-loader {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.splash-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold);
    animation: loadingSplash 1.5s infinite;
}

@keyframes loadingSplash {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* NOTIFICATIONS */
#promo-toaster {
    position: fixed;
    top: calc(100px + var(--safe-top));
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.promo-card {
    background: rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.4);
    padding: 15px 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-card i {
    color: var(--accent);
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* VIEWPORT HACK FOR SPLASH */
#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* AR & JARVIS */
#btn-jarvis {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jarvis-pulse {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: jarvisPulse 2s infinite ease-in-out;
}

@keyframes jarvisPulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px var(--accent);
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
        box-shadow: 0 0 25px var(--accent);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px var(--accent);
    }
}

#ar-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80');
    /* Luxury Hall Background */
    background-size: cover;
    background-position: center;
}

.ar-overlay {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 100px 20px 150px 20px;
}

.ar-compass {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--accent);
    animation: floatingArrow 3s infinite ease-in-out;
}

.ar-compass i {
    font-size: 5rem;
    text-shadow: 0 0 30px var(--accent);
}

.ar-compass span {
    font-weight: 800;
    letter-spacing: 5px;
    font-size: 1.2rem;
}

#ar-target-card {
    padding: 20px 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0, 243, 255, 0.4);
}

.btn-ar-exit {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes floatingArrow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* FLOOR TRANSITION */
.isometric-grid {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.floor-switching .isometric-grid {
    opacity: 0.5;
    transform: scale(0.9) rotateX(45deg) rotateZ(-45deg) translateY(100px);
}

/* SCANNER & SUCCESS */
.scanner-view .scanner-target {
    height: 250px;
    border: 2px dashed var(--accent);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
    0% {
        top: 10%;
    }

    50% {
        top: 90%;
    }

    100% {
        top: 10%;
    }
}

.success-view {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 5rem;
    color: #4CAF50;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.4));
}

.ticket-info {
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.ticket-info h2 {
    font-size: 3rem;
    color: var(--primary);
}

.hidden {
    display: none;
}

/* NAVIGATION ELEMENTS */
.route-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

.route-line {
    stroke-dasharray: 12;
    animation: flow 1s linear infinite;
}

@keyframes flow {
    from {
        stroke-dashoffset: 24;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.user-marker {
    position: absolute;
    z-index: 10;
    color: var(--accent);
    font-size: 2rem;
    transform: translate(-50%, -100%) rotateZ(-45deg) rotateX(-60deg);
    filter: drop-shadow(0 0 10px var(--accent));
}

/* Categorias */
.store-block.tech {
    background: rgba(0, 243, 255, 0.2);
}

.store-block.food {
    background: rgba(255, 60, 60, 0.2);
}

.store-block.fashion {
    background: rgba(255, 255, 255, 0.1);
}

.store-block.parking {
    background: rgba(100, 100, 110, 0.5);
}

.store-block.service {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 50%;
}

.hidden {
    display: none;
}