/* Improved Responsive Styles */

:root {
  --bg: #0b0e12;
  --panel: #12161c;
  --text: #e5f0ff;
  --muted: #9fb3c8;
  --primary: #ffffff;
  --accent: #6d28d9;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #1f2430;
}

* { 
  box-sizing: border-box; 
}

html, body { 
  margin: 0; 
  padding: 0; 
  background: var(--bg); 
  color: var(--text); 
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden; /* Prevent accidental horizontal scroll at the root */
  width: 100%;
}

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0 20px; /* Changed to 0 20px to keep horizontal padding consistent */
  width: 100%;
}

/* Header Improvements */
.site-header { 
  position: sticky; 
  top: 0; 
  z-index: 20; 
  background: rgba(18,22,28,0.9); 
  backdrop-filter: blur(6px); 
  border-bottom: 1px solid var(--border); 
  width: 100%;
}

.site-header .container { 
  display: flex; /* Changed from grid to flex for better mobile control */
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand { 
  color: var(--text); 
  text-decoration: none; 
  font-weight: 800; 
  font-size: 1.2rem; 
  letter-spacing: 0.3px; 
  flex-shrink: 0;
}

.main-nav { 
  display: none; 
  gap: 14px; 
}

.main-nav a { 
  color: var(--muted); 
  text-decoration: none; 
  font-size: 0.95rem; 
}

.actions { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
  justify-content: flex-end;
}

/* Hero Section Improvements */
.hero { 
  padding: 60px 0; 
  text-align: center; 
  width: 100%;
}

.hero-title { 
  font-size: clamp(2rem, 8vw, 4rem); 
  font-weight: 900; 
  line-height: 1.1; 
  letter-spacing: 0.5px; 
  margin: 0 0 16px; 
  padding: 0 10px;
}

.hero-subtitle { 
  color: var(--muted); 
  max-width: 820px; 
  margin: 0 auto 24px; 
  font-size: 1.05rem; 
  padding: 0 20px;
}

/* Visual Elements - Fixed for Mobile */
.hero-visual { 
  position: relative; 
  height: 200px; /* Reduced height for mobile */
  margin-top: 24px; 
  width: 100%;
  overflow: hidden; /* Contain absolute elements */
}

.hero-visual .cube { 
  position: absolute; 
  width: 100px; /* Smaller cubes for mobile */
  height: 80px; 
  left: 50%; 
  top: 50%; 
  transform: translate(-50%, -50%); 
  border-radius: 12px; 
  background: linear-gradient(135deg, #1b2030, #0f1318); 
  border: 1px solid var(--border); 
}

.hero-visual .cube.gold { 
  left: 15%; /* Percentage based for responsiveness */
  transform: translate(0, -50%);
}

.hero-visual .cube.purple { 
  right: 15%; 
  left: auto;
  transform: translate(0, -50%);
}

/* Section Layouts - Grid to Stack */
.about-split, .calc-split, .register-split { 
  display: flex;
  flex-direction: column;
  gap: 30px; 
  align-items: center; 
}

.about-image, .calc-image, .register-image, .login-image { 
  width: 100%; 
  max-width: 500px;
  height: 280px; 
  margin-top: 0 !important;
}



/* Advantages Grid */
.adv-grid { 
  display: grid; 
  grid-template-columns: 1fr; /* Stack on mobile */
  gap: 16px; 
}

/* Table Responsiveness */
.tx-table-wrap { 
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px; /* Bleed to edges on mobile */
  padding: 0 20px;
}

.tx-table { 
  min-width: 600px; /* Ensure table doesn't squish too much */
}

/* Footer Improvements */
.footer-columns { 
  display: grid; 
  grid-template-columns: 1fr; /* Stack footer columns */
  gap: 30px; 
}

/* Media Queries for Larger Screens */
@media (min-width: 768px) {
  .about-split, .calc-split, .register-split { 
    flex-direction: row;
    text-align: left;
  }
  
  .adv-grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
  
  .footer-columns { 
    grid-template-columns: repeat(2, 1fr); 
  }
  
  .hero-visual {
    height: 280px;
  }
  
  .hero-visual .cube {
    width: 140px;
    height: 100px;
  }
}

@media (min-width: 980px) {
  .main-nav { 
    display: flex; 
  }
  
  .adv-grid { 
    grid-template-columns: repeat(4, 1fr); 
  }
  
  .footer-columns { 
    grid-template-columns: repeat(4, 1fr); 
  }
}
