/* 
 * 3D Scene Styles 
 * Inherits variables from ../site_style/main.css
 */

body {
    overflow-x: hidden;
    overflow-y: auto;
    /* Bio-Digital Mars Theme: Deep Void Black */
    background-color: #0a0a12;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 77, 77, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 157, 0.05), transparent 30%);
    font-family: 'Inter', sans-serif;
    color: #A0A0C0;
    /* Silver Code */

    /* Theme Variables */
    --color-mars-red: #FF4D4D;
    --color-healing-green: #00FF9D;
    --color-void-black: #0a0a12;
    --color-code-silver: #A0A0C0;

    /* Overrides */
    --color-sun-gold: var(--color-healing-green);
    /* Re-map for existing components */
    --color-sun-silver: var(--color-code-silver);
    --primary-color: var(--color-mars-red);
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display,
.site-header .logo span {
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: -0.02em;
}

#scene-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    /* Base layer */
    display: block;
    pointer-events: auto;
    /* Explicitly allow events */
}

/* Ensure overlays don't block unless active */
#voice-control-overlay,

/* Dark overlay for text readability when background image is set */
#loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

#loading-overlay.hidden,
#voice-player-overlay:not(.active) {
    pointer-events: none !important;
}

/* OVERRIDES for layout integration */

/* Allow clicks to pass through the main content wrapper */
#main-content {
    pointer-events: none;
}

/* Re-enable interactions for specific content areas */
.site-header {
    pointer-events: none;
}

.site-header .container {
    pointer-events: auto;
}

.site-header nav,
.site-header .nav-menu,
.site-header .nav-link {
    pointer-events: auto;
}


.section {
    pointer-events: auto;
}

.site-footer {
    pointer-events: auto;
}

/* Make header transparent and floating */
.site-header {
    background: transparent !important;
    backdrop-filter: none !important;
    border-bottom: none !important;
    position: fixed !important;
    /* Ensure it stays fixed on top */
    width: 100%;
}

/* Ensure links are white/visible against space background */
.site-header .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: var(--color-sun-gold);
    background: rgba(255, 255, 255, 0.1);
}

/* 
 * Hero Section Optimization for 3D View
 * Push content down to reveal the 3D scene at the top 
 */
.hero-section {
    min-height: 100vh;
    /* Full viewport height */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Align content to bottom */
    padding-bottom: 15vh;
    /* Space from bottom */
    background: transparent !important;
    /* No background to see stars */
    pointer-events: none;
    /* Let clicks pass through to 3D scene where possible */
}

/* Restoring pointer events for interactive elements in hero */
.hero-section .container {
    pointer-events: none;
}

.hero-section .container>* {
    pointer-events: auto;
}

/* Rest of the styles... */

/* Video Controls */
#video-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    color: white;
    z-index: 100;
}

#video-controls.hidden {
    display: none;
}

#video-controls h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: var(--primary-color);
}

.controls-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#video-controls button {
    background: #333;
    border: 1px solid #555;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

#video-controls button:hover {
    background: #444;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    text-align: center;
    color: var(--color-sun-gold);
}

.loader p {
    margin-top: 20px;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--color-sun-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Info Panel */
#info-panel {
    display: none;
    /* Hiding original info panel in favor of new layout */
    /*
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-tux-white);
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
    */
}

#info-panel h1 {
    font-size: 1.5rem;
    color: var(--color-sun-gold);
    margin-bottom: 5px;
    font-family: var(--font-display);
}

#info-panel p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Chat Bubble */
.chat-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-gray-900);
    padding: 10px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    font-family: var(--font-primary);
    font-size: 14px;
    pointer-events: none;
    transform: translate(-50%, -100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: -20px;
}

.chat-bubble.visible {
    opacity: 1;
}

/* Controls Info */
#controls-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-tux-white);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
    font-family: var(--font-primary);
    z-index: 90;
    pointer-events: none;
}

#controls-info h3 {
    color: var(--color-sun-gold);
    margin-bottom: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-display);
}

#controls-info p {
    font-size: 0.85rem;
    margin-bottom: 4px;
    opacity: 0.9;
}

#controls-info em {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
    font-family: var(--font-secondary);
}

/* Chat Input Interface */
#chat-input-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 91;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

#chat-input {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-tux-white);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1rem;
    width: 300px;
    outline: none;
    transition: background 0.2s;
    font-family: var(--font-primary);
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.2);
}

#chat-send {
    background: var(--color-sun-gold);
    color: var(--color-gray-900);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: var(--font-primary);
}

#chat-send:hover {
    transform: scale(1.05);
}

/* Card Image Styles */
.card-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin: -20px -20px 15px -20px;
    /* Counteract padding of parent */
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.info-card:hover .card-image {
    transform: scale(1.1);
}

.card-content {
    position: relative;
    z-index: 2;
}

.badge-success {
    background-color: var(--color-healing-green);
    color: black;
    box-shadow: 0 0 5px var(--color-healing-green);
}

.badge-warning {
    background-color: var(--color-code-silver);
    color: black;
    border: 1px solid var(--color-healing-green);
}

.badge-danger {
    background-color: var(--color-mars-red);
    color: white;
    box-shadow: 0 0 5px var(--color-mars-red);
}

/* Fix Card Text Color for 3D Scene Page */
.info-card,
.info-card h3,
.info-card p,
.info-card .text-sm,
.info-card .card-content {
    color: var(--color-gray-900, #111827) !important;
    text-shadow: none !important;
}

section[style*="background-color: var(--color-bg-light)"] .text-gray-900 {
    color: #111827 !important;
}

/* Enhanced Video Controls - Updated from 2025-12-29 */
#video-controls {
    position: fixed !important;
    bottom: 60px;
    left: 10px;
    background: rgba(26, 26, 46, 0.92) !important;
    backdrop-filter: blur(8px) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 77, 77, 0.3) !important;
    color: #A0A0C0 !important;
    z-index: 200 !important;
    min-width: 280px !important;
    max-width: 320px !important;
    cursor: default !important;
    user-select: none !important;
}

#video-controls .drag-handle {
    cursor: grab;
    padding: 4px 12px;
    margin: -8px -12px 6px -12px;
    background: rgba(255, 77, 77, 0.15);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#video-controls .drag-handle:active {
    cursor: grabbing;
}

#video-controls .drag-handle h3 {
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-mars-red);
    letter-spacing: 0.5px;
}

#video-controls .drag-handle a {
    color: var(--color-mars-red);
    text-decoration: none;
    font-size: 0.75rem;
    margin-left: 8px;
}

#video-controls .drag-handle a:hover {
    color: #ff8c5a;
}

#video-controls .drag-dots {
    color: rgba(255, 77, 77, 0.5);
    font-size: 0.7rem;
    letter-spacing: 2px;
}

#video-controls .controls-row {
    margin-bottom: 6px !important;
    gap: 6px !important;
}

#video-controls .controls-row:last-child {
    margin-bottom: 0 !important;
}

#video-controls button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #c0c0c0 !important;
    padding: 3px 8px !important;
    font-size: 0.7rem !important;
    transition: all 0.2s ease !important;
}

#video-controls button:hover {
    background: rgba(255, 77, 77, 0.3) !important;
    border-color: var(--color-mars-red) !important;
}

#video-controls input[type="range"] {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    min-width: 60px;
}

#video-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--color-mars-red);
    border-radius: 50%;
    cursor: pointer;
}

#video-controls input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--color-mars-red);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#video-controls label {
    font-size: 0.7rem !important;
    color: rgba(192, 192, 192, 0.8) !important;
}

#video-time {
    font-size: 0.7rem !important;
    color: #87ceeb !important;
    font-family: monospace !important;
}

/* Generic Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: rgba(10, 10, 18, 0.95);
    border: 1px solid var(--color-mars-red);
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.1);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    color: var(--color-code-silver);
    position: relative;
}

.modal-card h2 {
    color: var(--color-mars-red);
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
}

.modal-card textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(160, 160, 192, 0.2);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.modal-card .btn-primary {
    background: var(--color-mars-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
}

.modal-card .btn-primary:hover {
    background: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

/* Story Grid Styles (Imported and Themed) */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.story-card {
    background: rgba(10, 10, 18, 0.6);
    border: 1px solid var(--color-code-silver);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-mars-red), transparent);
    opacity: 0;
    transition: all 0.4s;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.1);
    background: rgba(10, 10, 18, 0.9);
    border-color: var(--color-mars-red);
}

.story-card:hover::before {
    opacity: 1;
}

.card-number {
    font-size: 0.8rem;
    color: var(--color-code-silver);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.card-content {
    font-size: 1rem;
    color: #e0e5eb;
    margin-bottom: 20px;
}

.btn-add-cart {
    background: transparent;
    border: 1px solid var(--color-healing-green);
    color: var(--color-healing-green);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-add-cart:hover {
    background: var(--color-healing-green);
    color: black;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
}