/* ============================================
   AppMaven Studio - Main Stylesheet v2.0
   "Precision Tech Studio" Aesthetic
   ============================================ */

/* ==========================================
   BASE & RESET
   ========================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  background: var(--color-bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==========================================
   BACKGROUND PATTERNS
   ========================================== */

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--pattern-grid);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
  z-index: var(--z-below);
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top,
      rgba(26, 117, 255, 0.08) 0%,
      transparent 60%);
  pointer-events: none;
  z-index: var(--z-below);
}

.cosmic-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-bg-radial);
  z-index: var(--z-below);
  pointer-events: none;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: var(--font-bold);
}

h3 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  color: var(--color-blue-400);
}

strong,
b {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

em,
i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--glass-bg);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--color-cyan-400);
  border: 1px solid var(--glass-border);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
  border: 1px solid var(--glass-border);
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

/* ==========================================
   LISTS
   ========================================== */

ul,
ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* ==========================================
   FORMS
   ========================================== */

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-sm));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-smooth);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  background: var(--glass-bg-hover);
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 3px rgba(26, 117, 255, 0.15);
  transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

input[type="checkbox"],
input[type="radio"] {
  width: var(--space-5);
  height: var(--space-5);
  margin-right: var(--space-2);
  cursor: pointer;
  accent-color: var(--color-blue-500);
}

fieldset {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

legend {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  padding: 0 var(--space-2);
}

/* ==========================================
   LAYOUT UTILITIES
   ========================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}

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

@media (max-width: 768px) {
  .section {
    padding: var(--space-16) 0;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

/* ==========================================
   GRID SYSTEM
   ========================================== */

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {

  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s var(--ease-smooth) forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s var(--ease-smooth) forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.8s var(--ease-smooth) forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s var(--ease-smooth) forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.6s var(--ease-bounce) forwards;
}

.animate-delay-100 {
  animation-delay: 100ms;
}

.animate-delay-200 {
  animation-delay: 200ms;
}

.animate-delay-300 {
  animation-delay: 300ms;
}

.animate-delay-400 {
  animation-delay: 400ms;
}

.animate-delay-500 {
  animation-delay: 500ms;
}

.animate-delay-600 {
  animation-delay: 600ms;
}

.animate-delay-700 {
  animation-delay: 700ms;
}

.animate-delay-800 {
  animation-delay: 800ms;
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.skip-to-main {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-blue-500);
  color: white;
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: var(--z-tooltip);
  font-weight: var(--font-semibold);
}

.skip-to-main:focus {
  top: 0;
}

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

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-blue);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-cyan);
  box-shadow: var(--glow-blue);
}

/* ==========================================
   SELECTION
   ========================================== */

::selection {
  background: var(--color-blue-500);
  color: white;
}

::-moz-selection {
  background: var(--color-blue-500);
  color: white;
}

/* ==========================================
   IMAGES
   ========================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  opacity: 1;
  /* Fixed: Changed from 0 to 1 to ensure visibility */
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* ==========================================
   FOCUS STYLES
   ========================================== */

*:focus {
  outline: 2px solid var(--color-blue-500);
  outline-offset: 2px;
}

button:focus,
a:focus {
  outline-offset: 4px;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--color-text-primary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.font-bold {
  font-weight: var(--font-bold);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-8 {
  margin-top: var(--space-8);
}