/* POWERTRONIC — Visor 3D Interactivo Premium Dell OptiPlex */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Orbitron:wght@600;700;800;900&display=swap');

:root {
    --bg-dark: #020617;
    --bg-surface: rgba(15, 23, 42, 0.75);
    --bg-card: rgba(15, 23, 42, 0.85);
    --cyan: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.4);
    --cyan-dim: rgba(0, 240, 255, 0.12);
    --cyan-border: rgba(0, 240, 255, 0.3);
    --blue-accent: #3b82f6;
    --green-whatsapp: #25d366;
    --text-main: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.65);
    --font-heading: 'Orbitron', 'Outfit', sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #ffffff 0%, #e0f2fe 30%, #60a5fa 70%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    user-select: none;
}

/* 3D Canvas Container & Render 360 Container */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    cursor: grab;
    display: none;
}

#canvas-container.active {
    display: block;
    z-index: 5;
}

#canvas-container:active {
    cursor: grabbing;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* 3D Studio Render 360 Container */
#render-360-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #ffffff 0%, #e0f2fe 30%, #60a5fa 70%, #0f172a 100%);
}

#render-360-container.active {
    display: flex;
    z-index: 5;
}

#render-360-container:active {
    cursor: grabbing;
}

#render-360-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(15, 23, 42, 0.45));
    pointer-events: none;
}

#render-360-image {
    display: none;
}

.render-360-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.3) 0%, transparent 65%, rgba(15, 23, 42, 0.4) 100%);
}

.frame-indicator {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--cyan-border);
    backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: 99px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--cyan);
    letter-spacing: 1.5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px var(--cyan-dim);
    z-index: 10;
    pointer-events: none;
}

/* Header Center View Mode Selector */
.header-center-modes {
    pointer-events: auto;
}

.view-mode-selector {
    display: flex;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--cyan-border);
    border-radius: 99px;
    padding: 4px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--cyan-dim);
}

.mode-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 99px;
    cursor: pointer;
    transition: var(--transition);
}

.mode-tab:hover {
    color: #ffffff;
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--cyan), #2563eb);
    color: #020617;
    font-weight: 800;
    box-shadow: 0 0 12px var(--cyan-glow);
}

/* Loading Overlay */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 45%, #ffffff 0%, #e0f2fe 40%, #2563eb 85%, #0f172a 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.loader-logo img {
    height: 48px;
    filter: drop-shadow(0 0 12px var(--cyan-glow));
}

.loader-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0f172a;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.loader-bar-container {
    width: 280px;
    height: 6px;
    background: rgba(15, 23, 42, 0.15);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--cyan-border);
    box-shadow: 0 0 15px var(--cyan-dim);
    margin-bottom: 16px;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00f0ff, #3b82f6);
    box-shadow: 0 0 12px var(--cyan);
    transition: width 0.2s ease;
}

.loader-status {
    font-size: 0.85rem;
    color: #1e3a8a;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Header Navbar */
.app-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--cyan-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.header-brand img {
    height: 36px;
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
}

.brand-info p {
    font-size: 0.72rem;
    color: var(--cyan);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cyan-border);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-icon:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-glow);
    transform: translateY(-2px);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 360 Badge Overlay */
.badge-360 {
    position: absolute;
    top: 90px;
    left: 20px;
    z-index: 10;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cyan-border);
    padding: 10px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { border-color: rgba(0, 240, 255, 0.3); }
    50% { border-color: rgba(0, 240, 255, 0.8); box-shadow: 0 0 18px var(--cyan-glow); }
}

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.badge-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}

.badge-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Camera Angle Presets Toolbar (Top Right) */
.angle-presets {
    position: absolute;
    top: 90px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-preset {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}

.btn-preset:hover, .btn-preset.active {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan-glow);
}

/* Floating Specs Card (Bottom Right / Side Panel) */
.specs-panel {
    position: absolute;
    bottom: 24px;
    right: 20px;
    z-index: 10;
    width: 310px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cyan-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transition: var(--transition);
}

.specs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.specs-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.specs-badge {
    background: var(--cyan-dim);
    border: 1px solid var(--cyan-border);
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}

.spec-label {
    color: var(--text-muted);
}

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

.btn-whatsapp {
    width: 100%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    text-decoration: none;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Bottom Controls Bar */
.controls-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cyan-border);
    padding: 8px 16px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.ctrl-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.ctrl-btn:hover, .ctrl-btn.active {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan-glow);
}

.ctrl-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
}

/* Info & Setup Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-dark);
    border: 1px solid var(--cyan-border);
    border-radius: var(--radius-lg);
    max-width: 620px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--cyan-dim);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--cyan);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--cyan);
    margin-bottom: 16px;
}

.modal-section {
    margin-bottom: 18px;
}

.modal-section h4 {
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 8px;
}

.modal-section p, .modal-section li {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.code-block {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--cyan);
    margin: 8px 0;
    overflow-x: auto;
}

/* Mobile Toggle Hint Indicator */
.mobile-toggle-hint {
    display: none;
}

/* Responsive Media Queries — Vertical Mobile Portrait Optimization */
@media (max-width: 768px) {
    /* Top Header fixed at the ABSOLUTE top edge */
    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding: 6px 12px;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 50;
    }

    .header-brand img {
        width: 28px;
        height: 28px;
    }

    .brand-info h1 {
        font-size: 0.85rem;
    }

    .brand-info p {
        display: none;
    }

    /* Hide mode tab button in mobile header */
    .header-center-modes {
        display: none !important;
    }

    /* 360 Badge: TINY and semi-transparent to NOT obstruct the 3D model */
    .badge-360 {
        position: fixed;
        top: 48px;
        left: 10px;
        z-index: 45;
        padding: 3px 8px;
        background: rgba(2, 6, 23, 0.6);
        border: 1px solid rgba(0, 240, 255, 0.2);
        border-radius: 4px;
    }

    .badge-dot {
        width: 5px;
        height: 5px;
    }

    .badge-text {
        font-size: 0.55rem;
    }

    .badge-sub {
        display: none;
    }

    /* REMOVE ALL ANGLE BUTTONS ON VERTICAL MOBILE (100% Clear Canvas View) */
    .angle-presets {
        display: none !important;
    }

    /* COLLAPSIBLE SPECS CARD ON VERTICAL MOBILE */
    .mobile-toggle-hint {
        display: inline-block;
        font-size: 0.65rem;
        color: var(--cyan);
        font-weight: 700;
        margin-left: 6px;
    }

    .specs-panel {
        display: block !important;
        position: fixed;
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: calc(100% - 24px);
        margin: 0 auto;
        z-index: 45;
        padding: 10px 14px;
        background: rgba(2, 6, 23, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--cyan-border);
        border-radius: var(--radius-md);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .specs-header {
        cursor: pointer;
        user-select: none;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .specs-title {
        font-size: 0.85rem;
    }

    .specs-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    /* Hide specs list and WhatsApp button by default when collapsed on vertical mobile */
    .specs-panel .specs-list,
    .specs-panel .btn-whatsapp {
        display: none;
    }

    /* Expand specs card when user taps the title */
    .specs-panel.expanded .specs-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .specs-panel.expanded .specs-list {
        display: block;
        margin-bottom: 10px;
    }

    .specs-panel.expanded .btn-whatsapp {
        display: flex;
    }
}

@media (max-width: 420px) {
    .badge-360 {
        top: 62px;
        left: 10px;
    }

    .specs-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}
