/* ===== 3D SCENE STYLES ===== */

/* WebGL Canvas */
.webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease-out;
}

.webgl-canvas.loaded {
  opacity: 1;
}

.webgl-canvas.interactive {
  pointer-events: auto;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  color: #ffffff;
}

.loading-logo {
  font-family: var(--font-primary);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

.loading-progress {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  margin: 0 auto 1rem;
  overflow: hidden;
  opacity: 0;
  animation: fadeInUp 1s ease-out 1s forwards;
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffffff 0%, #888888 100%);
  border-radius: 1px;
  transition: width 0.3s ease-out;
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #888888;
  opacity: 0;
  animation: fadeInUp 1s ease-out 1.5s forwards;
}

/* 3D Controls */
.nav__3d-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 1rem;
}

.nav__3d-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.nav__3d-toggle.active {
  background: #000000;
  border-color: #000000;
}

.nav__3d-icon {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: #000000;
  transition: color 0.3s ease;
}

.nav__3d-toggle.active .nav__3d-icon {
  color: #ffffff;
}

.nav__controls {
  display: flex;
  align-items: center;
}

/* Scene Info Overlay */
.hero__3d-overlay {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 10;
  pointer-events: none;
}

.scene-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  opacity: 0;
  transform: translateX(2rem);
  transition: all 0.5s ease-out;
}

.scene-info.visible {
  opacity: 1;
  transform: translateX(0);
}

.scene-info__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.scene-info__label {
  color: #888888;
}

.scene-info__value {
  color: #ffffff;
  font-weight: 500;
}

/* 3D Containers */
.about__3d-container,
.work__3d-gallery {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.work__3d-gallery {
  height: 500px;
}

/* 3D Scene Interaction States */
.scene-container {
  position: relative;
  cursor: grab;
  transition: all 0.3s ease;
}

.scene-container:active {
  cursor: grabbing;
}

.scene-container.loading::after {
  content: 'Loading 3D Scene...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #888888;
  z-index: 10;
}

/* Performance Indicators */
.performance-indicator {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #ffffff;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.performance-indicator.visible {
  opacity: 1;
}

.fps-good { color: #4ade80; }
.fps-warning { color: #fbbf24; }
.fps-critical { color: #f87171; }

/* WebGL Error States */
.webgl-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.webgl-error__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #dc2626;
}

.webgl-error__message {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.webgl-error__fallback {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.webgl-error__fallback:hover {
  background: #e5e7eb;
}

/* Mobile 3D Adaptations */
@media (max-width: 768px) {
  .hero__3d-overlay {
    display: none;
  }
  
  .nav__3d-toggle {
    width: 2rem;
    height: 2rem;
    margin-right: 0.5rem;
  }
  
  .nav__3d-icon {
    font-size: 0.625rem;
  }
  
  .about__3d-container,
  .work__3d-gallery {
    height: 300px;
  }
  
  .webgl-canvas {
    pointer-events: none !important;
  }
  
  .performance-indicator {
    display: none;
  }
}

/* High Performance Mode */
.high-performance .webgl-canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: crisp-edges;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .webgl-canvas,
  .scene-container {
    display: none;
  }
  
  .about__3d-container,
  .work__3d-gallery {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
  }
  
  .about__3d-container::after,
  .work__3d-gallery::after {
    content: '3D Scene (Disabled for Accessibility)';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
  }
}

/* VR/AR Ready Styles */
@media (display-mode: fullscreen) {
  .nav,
  .scene-info,
  .performance-indicator {
    display: none;
  }
  
  .webgl-canvas {
    cursor: none;
  }
}

/* Animation Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse3d {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes rotate3d {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* WebGL Support Detection */
.no-webgl .webgl-canvas {
  display: none;
}

.no-webgl .about__3d-container::after {
  content: 'WebGL not supported';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.875rem;
  color: #dc2626;
}

/* 3D Scene Transitions */
.scene-transition {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 5;
}

.scene-transition.active {
  opacity: 1;
}