/**
 * Clean Responsive Fixes
 * Minimal approach to fix overlaps and improve mobile experience
 */

/* =========================================
   Canvas Background Fix
   ========================================= */

.canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Ensure canvas stays behind everything */
  pointer-events: none;
}

#mainCanvas {
  pointer-events: auto;
}

/* =========================================
   Navigation Mobile Fixes
   ========================================= */

@media (max-width: 768px) {
  /* Keep the logo but make it smaller */
  .logo-cube-alive {
    transform: scale(0.8);
  }
  
  /* Fix logo and text overlap */
  .nav-logo {
    gap: 0.75rem;
    flex-wrap: nowrap;
    align-items: center;
  }
  
  .logo-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
  }
  
  .logo-text {
    flex-shrink: 1;
    min-width: 0;
  }
  
  .logo-main {
    font-size: 1rem;
    letter-spacing: 0.2em;
  }
  
  /* Hide nav elements that cause clutter */
  .nav-divider,
  .nav-status,
  .nav-menu {
    display: none;
  }
  
  /* Simplify nav layout */
  .nav-content {
    padding: 0 1rem;
    justify-content: space-between;
  }
  
  /* Keep only essential nav items */
  .nav-right .btn-icon {
    display: none;
  }
  
  .btn-primary-nav {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* =========================================
   Hero Section Responsive
   ========================================= */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 100px; /* Account for fixed nav */
}

@media (max-width: 768px) {
  .hero {
    padding-top: 80px;
  }
  
  .hero-content {
    padding: 0 1rem;
  }
  
  /* Hide decorative elements */
  .hero-meta,
  .hero-badge {
    display: none;
  }
  
  /* Responsive typography */
  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-description {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }
  
  /* Stack buttons */
  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn-hero {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    font-size: 0.875rem;
  }
  
  /* Hide stats on mobile - Agents Deployed and Aura */
  .hero-stats {
    display: none;
  }
}

/* =========================================
   Section Spacing
   ========================================= */

section {
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }
  
  .section-content {
    padding: 0 1rem;
  }
}

/* =========================================
   Feature Cards Mobile
   ========================================= */

@media (max-width: 768px) {
  .feature-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .card-title {
    font-size: 1.125rem;
  }
  
  .card-description {
    font-size: 0.875rem;
  }
}

/* =========================================
   Reduce Visual Complexity on Mobile
   ========================================= */

@media (max-width: 768px) {
  /* Make canvas more subtle */
  #mainCanvas {
    opacity: 0.5;
  }
  
  /* Hide scroll indicator */
  .scroll-indicator {
    display: none;
  }
  
  /* Simplify loading screen */
  .loading-cube-container {
    transform: scale(0.7);
  }
}

/* =========================================
   Extra Small Screen Fixes (phones in portrait)
   ========================================= */

@media (max-width: 480px) {
  /* Further reduce logo size on very small screens */
  .nav-logo {
    gap: 0.5rem;
  }
  
  .logo-cube-alive {
    transform: scale(0.7);
  }
  
  .logo-mark {
    width: 18px;
    height: 18px;
  }
  
  .logo-main {
    font-size: 0.875rem;
    letter-spacing: 0.15em;
  }
  
  /* Adjust navigation padding */
  .nav-content {
    padding: 0 0.75rem;
  }
  
  /* Make REQUEST ACCESS button smaller */
  .btn-primary-nav {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* =========================================
   Z-Index Management
   ========================================= */

/* Ensure proper stacking order */
.ui-overlay { z-index: 1; }
.nav { z-index: 1000; }
.hero-content { z-index: 2; }
section { z-index: 1; }

/* =========================================
   Performance Optimizations
   ========================================= */

@media (max-width: 768px) and (hover: none) {
  /* Disable hover effects on touch devices */
  .feature-card:hover {
    transform: none;
  }
  
  .nav-link:hover {
    color: inherit;
  }
}

/* =========================================
   Text Overflow Prevention
   ========================================= */

.hero-title,
.section-title,
.card-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* =========================================
   Form Elements Mobile
   ========================================= */

@media (max-width: 768px) {
  .access-form-container {
    padding: 1.5rem;
    margin: 0 1rem;
  }
  
  .field-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* =========================================
   Platform Section Mobile
   ========================================= */

@media (max-width: 768px) {
  .platform-features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  
  .feature-item {
    text-align: center;
  }
  
  .feature-icon {
    margin: 0 auto 1rem;
  }
}