﻿:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #151520;
  --bg-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #b8b8c8;
  --accent-primary: #00d4ff;
  --accent-secondary: #ff6b6b;
  --border-color: rgba(0, 212, 255, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --glow-color: rgba(0, 212, 255, 0.6);
}

[data-theme="light"] {
  /* Light theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-glass: rgba(0, 0, 0, 0.05);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-primary: #0ea5e9;
  --accent-secondary: #ef4444;
  --border-color: rgba(14, 165, 233, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --glow-color: rgba(14, 165, 233, 0.5);
}

/* Performance optimizations */
@font-face {
  font-family: 'Segoe UI';
  font-display: swap;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Reset and accessibility improvements */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Improved typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75em;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.25em;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Focus management for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Image optimization */
img {
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: optimize-quality;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 120px;
  left: 20px;
  z-index: 1002;
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  font-size: 16px;
  box-shadow: 0 4px 20px var(--shadow-color);
  font-family: inherit;
}

.theme-toggle:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--glow-color);
}

header {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
  min-height: 80px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-container img {
  height: 75px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 15px var(--accent-primary));
  transition: transform 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.05);
}

.logo-container h1 {
  color: var(--accent-primary);
  font-size: 2.4rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 16px;
  position: relative;
  letter-spacing: 0.01em;
}

nav a:hover,
nav a.active {
  background: var(--bg-glass);
  color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary);
  transform: translateY(-1px);
}

main {
  padding: 120px 20px 60px;
  max-width: 1200px;
  margin: auto;
}

.hero {
  text-align: center;
  margin-bottom: 80px;
  padding: 40px 0;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.3rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.section {
  margin-bottom: 80px;
}

.section h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  text-align: center;
  color: var(--text-primary);
  font-weight: 700;
}

.card {
  background: var(--bg-glass);
  border-radius: 20px;
  padding: 40px;
  margin: 30px 0;
  box-shadow: 0 8px 32px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px var(--shadow-color), 0 0 30px var(--glow-color);
  border-color: var(--accent-primary);
}

.card h3 {
  color: var(--accent-primary);
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 600;
}

.card img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
  transition: all 0.4s ease;
  object-fit: cover;
  aspect-ratio: 16/10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.card:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5em;
}

/* Grid layout for service cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

footer {
  text-align: center;
  padding: 50px 20px;
  font-size: 1rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
}

/* LMP Calculator styles */
.lmp-calculator {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 25px;
  min-width: 320px;
  transform: translateX(350px);
  transition: transform 0.3s ease;
  color: var(--text-primary);
  box-shadow: 0 8px 30px var(--shadow-color);
}

.lmp-calculator.show {
  transform: translateX(0);
}

.lmp-toggle {
  position: fixed;
  top: 170px;
  right: 20px;
  z-index: 1001;
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--shadow-color);
  font-family: inherit;
}

.lmp-toggle:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 25px var(--glow-color);
}

.lmp-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  margin: 10px 0;
  font-size: 14px;
  font-family: inherit;
}

.lmp-result {
  margin-top: 15px;
  padding: 15px;
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  font-size: 1rem;
}

/* Error handling */
.error-message {
  background: var(--accent-secondary);
  color: white;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  display: none;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Print styles */
@media print {
  .theme-toggle,
  .lmp-calculator,
  .lmp-toggle {
    display: none !important;
  }
  
  header {
    position: static;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive Design Improvements */
@media (max-width: 1200px) {
  .theme-toggle {
    top: 110px;
    left: 15px;
    font-size: 14px;
    padding: 10px 16px;
  }
  
  .lmp-toggle {
    top: 160px;
    right: 15px;
  }
  
  header {
    padding: 15px 30px;
  }
  
  .logo-container h1 {
    font-size: 1.8rem;
  }
  
  main {
    padding: 90px 30px 40px;
    max-width: 1200px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .theme-toggle {
    top: 90px;
    left: 15px;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .lmp-toggle {
    top: 15px;
    right: 15px;
    font-size: 12px;
    padding: 8px 12px;
    z-index: 1002;
  }
  
  .lmp-calculator {
    top: 70px;
    right: 10px;
    left: 10px;
    min-width: auto;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
  }
  
  .lmp-calculator.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  header {
    padding: 15px 20px;
    min-height: 70px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }
  
  .logo-container {
    flex: 1;
    justify-content: flex-start;
    gap: 15px;
  }
  
  .logo-container h1 {
    font-size: 1.8rem;
  }
  
  .logo-container img {
    height: 60px;
  }
  
  .mobile-menu-toggle {
    display: block;
    order: 3;
  }
  
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    flex-direction: column;
    padding: 20px;
    gap: 10px;
  }
  
  nav.active,
  nav.show {
    display: flex;
  }
  
  nav a {
    padding: 12px 20px;
    text-align: center;
    width: 100%;
    margin: 5px 0;
    font-size: 16px;
    border-radius: 10px;
  }
  
  main {
    padding: 100px 15px 40px;
  }
  
  .hero h2 {
    font-size: 2.2rem;
    line-height: 1.3;
  }
  
  .hero p {
    font-size: 1.1rem;
    padding: 0 10px;
  }

  .section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }
  
  .card {
    padding: 25px;
    margin: 20px 0;
    border-radius: 16px;
  }

  .card h3 {
    font-size: 1.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Improve grid layouts on mobile */
  .card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.35rem; }
  h4 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .theme-toggle {
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .lmp-toggle {
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 6px 10px;
  }
  
  header {
    padding: 10px 15px;
  }
  
  .logo-container h1 {
    font-size: 1.3rem;
  }
  
  .logo-container img {
    height: 35px;
  }
  
  nav a {
    font-size: 14px;
    padding: 12px;
  }
  
  main {
    padding: 90px 10px 30px;
  }
  
  .hero h2 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }
  
  .card {
    padding: 20px;
    margin: 10px 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* High DPI and Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Enhanced button styles */
.btn {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
  text-align: center;
  letter-spacing: 0.5px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0);
}

/* Loading states and skeleton screens */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, rgba(255,255,255,0.1) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Improved form styles */
input, textarea, select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  outline: none;
}

/* Enhanced accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Enhanced focus indicators */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Better text selection */
::selection {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

::-moz-selection {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-large {
  margin-bottom: 40px;
}

.glow {
  box-shadow: 0 0 20px var(--glow-color);
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
/* Scroll lock when mobile menu is open */
body.menu-open {
  overflow: hidden;
}
/* Mobile nav fix: support 'show' class toggled by JS */
@media (max-width: 768px) { nav.show { display: flex; } }
