/**
 * Samir Manglam Portfolio - 3D Scene Styles
 * Path: /assets/css/3d.css
 */

/* =====================================================
   3D Container
   ===================================================== */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(ellipse at center, #0a1628 0%, #000000 100%);
}

#scene-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* =====================================================
   3D UI Overlay
   ===================================================== */
.scene-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

.scene-overlay > * {
    pointer-events: auto;
}

/* =====================================================
   Interactive Hotspots
   ===================================================== */
.hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    animation: hotspotPulse 2s infinite;
}

.hotspot::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    animation: hotspotRipple 2s infinite;
}

.hotspot:hover {
    background: rgba(0, 212, 255, 0.4);
    transform: scale(1.2);
}

.hotspot i {
    color: var(--primary);
    font-size: 1rem;
}

@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(0, 212, 255, 0); }
}

@keyframes hotspotRipple {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* =====================================================
   Object Labels
   ===================================================== */
.object-label {
    position: absolute;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 10px 15px;
    font-size: 0.85rem;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.object-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--primary) transparent transparent;
}

.object-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.object-label .label-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 3px;
}

.object-label .label-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* =====================================================
   3D Navigation Menu
   ===================================================== */
.nav-3d {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 200;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    padding: 15px 25px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-3d-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-3d-item:hover,
.nav-3d-item.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary);
}

.nav-3d-item i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.nav-3d-item:hover i,
.nav-3d-item.active i {
    color: var(--primary);
}

.nav-3d-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-3d-item:hover span,
.nav-3d-item.active span {
    color: var(--text-primary);
}

/* =====================================================
   Loading Screen for 3D
   ===================================================== */
.loading-3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-3d.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-3d .loader-cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 2s infinite linear;
}

.loading-3d .loader-cube div {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--primary);
    background: rgba(0, 212, 255, 0.1);
}

.loading-3d .loader-cube .front  { transform: translateZ(30px); }
.loading-3d .loader-cube .back   { transform: rotateY(180deg) translateZ(30px); }
.loading-3d .loader-cube .right  { transform: rotateY(90deg) translateZ(30px); }
.loading-3d .loader-cube .left   { transform: rotateY(-90deg) translateZ(30px); }
.loading-3d .loader-cube .top    { transform: rotateX(90deg) translateZ(30px); }
.loading-3d .loader-cube .bottom { transform: rotateX(-90deg) translateZ(30px); }

@keyframes rotateCube {
    0% { transform: rotateX(0) rotateY(0); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.loading-3d .loading-text {
    margin-top: 30px;
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.9rem;
}

.loading-3d .loading-progress {
    width: 200px;
    height: 3px;
    background: var(--bg-lighter);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-3d .loading-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* =====================================================
   Controls Info
   ===================================================== */
.controls-info {
    position: fixed;
    bottom: 120px;
    right: 30px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 150;
    max-width: 250px;
}

.controls-info h4 {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.controls-info ul {
    list-style: none;
    font-size: 0.8rem;
}

.controls-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.controls-info li i {
    color: var(--primary);
    width: 20px;
}

/* =====================================================
   Fallback 2D Mode
   ===================================================== */
.fallback-2d {
    display: none;
    min-height: 100vh;
    background: var(--bg-dark);
}

body.no-webgl .fallback-2d {
    display: block;
}

body.no-webgl #scene-container {
    display: none !important;
}

.fallback-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 20px;
}

.fallback-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 0, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.fallback-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 60px auto 0;
}

.fallback-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px 20px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
    text-decoration: none;
}

.fallback-nav-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-primary);
}

.fallback-nav-item i {
    font-size: 2rem;
    color: var(--primary);
}

.fallback-nav-item span {
    color: var(--text-primary);
    font-weight: 600;
}

/* =====================================================
   Responsive 3D
   ===================================================== */
@media (max-width: 768px) {
    .nav-3d {
        bottom: 20px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-3d-item {
        padding: 8px 10px;
    }
    
    .nav-3d-item span {
        display: none;
    }
    
    .controls-info {
        display: none;
    }
    
    .hotspot {
        width: 35px;
        height: 35px;
    }
    
    .hotspot::before {
        width: 50px;
        height: 50px;
    }
}

/* =====================================================
   Page Transition Overlay
   ===================================================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

.page-transition .transition-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--primary);
    animation: typing 1s steps(20) infinite;
}

@keyframes typing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =====================================================
   Neon Sign Effect
   ===================================================== */
.neon-sign {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary),
        0 0 80px var(--primary);
    animation: neonFlicker 3s infinite alternate;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px var(--primary),
            0 0 10px var(--primary),
            0 0 20px var(--primary),
            0 0 40px var(--primary),
            0 0 80px var(--primary);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}
