/* ============================================================================
   SHARED STYLES - AI Accelerator 4 All
   Common components used across all pages
   ============================================================================ */

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Geologica", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-background);
  color: var(--color-text-primary);
  line-height: var(--line-height-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   KEYFRAME ANIMATIONS
   ============================================================================ */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateZ(0);
  }
  50% {
    transform: translateY(-20px) translateZ(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glow {
  0%, 100% {
    box-shadow: var(--glow-primary);
  }
  50% {
    box-shadow:
      0 0 35px rgba(147, 51, 234, 0.6),
      0 0 70px rgba(0, 213, 255, 0.4);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(20deg); }
  100% { transform: translateX(200%) rotate(20deg); }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================================
   SCROLL PROGRESS INDICATOR
   ============================================================================ */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: var(--z-tooltip);
  transition: width var(--duration-fast);
  will-change: width;
}

/* ============================================================================
   AI PARTICLES SYSTEM
   ============================================================================ */
.ai-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-base);
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(0, 213, 255, 0.7);
  border-radius: 50%;
  filter: drop-shadow(0 0 12px rgba(0, 213, 255, 0.9));
  animation: float 6s infinite ease-in-out;
  will-change: transform;
  /* Force GPU acceleration for better performance */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(20, 29, 48, 0.98);
  backdrop-filter: blur(20px);
  padding: 1.25rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  z-index: var(--z-fixed);
  border-bottom: 1px solid var(--glass-border-default);
  transition: all var(--duration-base);
}

.navbar.scrolled {
  padding: 0.75rem 0;
  background: rgba(20, 29, 48, 1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-12);
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-decoration: none;
  transition: transform var(--duration-base);
}

.navbar .logo:hover {
  transform: scale(1.05);
}

.navbar .logo img {
  height: 40px;
  filter: drop-shadow(0 0 12px rgba(147, 51, 234, 0.6));
  transition: filter var(--duration-base);
}

.navbar .logo:hover img {
  filter: drop-shadow(0 0 20px rgba(147, 51, 234, 1));
}

.navbar nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.navbar a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: all var(--duration-base);
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width var(--duration-base);
}

.navbar a:hover::after {
  width: 100%;
}

.navbar a:hover {
  color: var(--color-accent);
}

.navbar .btn-calc {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  transition: all var(--duration-base);
  animation: glow 3s infinite;
}

.navbar .btn-calc:hover {
  transform: translateY(-2px) scale(1.05);
  color: var(--brand-white);
}

.navbar .btn-calc::after {
  display: none;
}

/* Hamburger menu button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: var(--z-fixed);
  position: relative;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-smooth);
}

/* Hamburger animation when open */
.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================================
   LAYOUT CONTAINERS
   ============================================================================ */
.container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-12);
}

section {
  padding: var(--space-16) 0;
  position: relative;
  opacity: 1;
  transform: none;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
  margin-bottom: 1rem;
}

p {
  font-size: var(--text-body);
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: 1.0625rem;
  text-decoration: none;
  transition: all var(--duration-base);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 350px;
  height: 350px;
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--brand-white);
  box-shadow: 0 6px 25px rgba(147, 51, 234, 0.4);
}

.btn-primary:hover {
  background: #7c2abf;
  transform: translateY(-4px);
  box-shadow: 0 10px 35px rgba(147, 51, 234, 0.6);
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-surface);
  box-shadow: 0 6px 25px rgba(0, 213, 255, 0.4);
}

.btn-secondary:hover {
  background: #00b8e0;
  transform: translateY(-4px);
  box-shadow: 0 10px 35px rgba(0, 213, 255, 0.6);
}

/* Loading state for buttons */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--brand-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading span {
  opacity: 0;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
footer {
  background: rgba(0, 0, 0, 0.5);
  padding: 3.5rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border-default);
}

footer p {
  margin-bottom: 0.75rem;
}

/* ============================================================================
   FOCUS STATES (Accessibility)
   ============================================================================ */

/* Skip to main content link - appears only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-tooltip);
  background: var(--color-accent);
  color: var(--brand-navy-base);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transition: top var(--duration-base) var(--ease-smooth);
  box-shadow: var(--shadow-elevated);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 3px solid var(--brand-navy-base);
  outline-offset: 2px;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
  box-shadow:
    0 0 0 6px rgba(0, 213, 255, 0.2),
    0 6px 25px rgba(147, 51, 234, 0.4);
}

.navbar a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Card focus states */
.card:focus-visible,
a.card:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  transform: translateY(-4px);
}

/* Input focus states */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip to content on focus */
a[href^="#"]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Small phones landscape (480px+) */
@media (min-width: 480px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* Large phones (640px+) */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-10);
  }
}

/* Tablets portrait (768px+) */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-12);
  }

  section {
    padding: var(--space-12) 0;
  }
}

/* Tablets landscape (900px+) */
@media (min-width: 900px) {
  .navbar nav {
    flex-wrap: nowrap;
  }
}

/* Small laptops (1024px+) */
@media (min-width: 1024px) {
  section {
    padding: var(--space-16) 0;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .navbar a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Desktop-only breakpoints for backwards compatibility */
@media (max-width: 899px) {
  .navbar .container {
    padding: 0 var(--space-6);
  }

  /* Show hamburger menu on mobile */
  .nav-toggle {
    display: block;
  }

  .navbar nav {
    position: fixed;
    right: -100%;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(20, 29, 48, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 2rem;
    justify-content: flex-start;
    align-items: stretch;
    transition: right var(--duration-base) var(--ease-smooth);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: var(--z-sticky);
  }

  .navbar nav[aria-hidden="false"] {
    right: 0;
  }

  .navbar nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: left;
  }

  .navbar nav a::after {
    display: none;
  }

  .navbar nav a:hover {
    background: rgba(0, 213, 255, 0.1);
  }

  .navbar .btn-calc {
    border-radius: var(--radius-md);
    text-align: center;
  }

  .container {
    padding: 0 var(--space-6);
  }

  section {
    padding: var(--space-12) 0;
  }
}

/* Overlay for mobile menu */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  transition: opacity var(--duration-base);
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}
