/* ========== GLOBAL RESET & VARIABLES ========== */
:root {
  /* Colors */
  --clr-bg: #fafafa;
  --clr-surface: #ffffff;
  --clr-primary: #10b981;
  --clr-primary-dark: #059669;
  --clr-primary-light: #34d399;
  --clr-secondary: #3b82f6;
  --clr-secondary-dark: #2563eb;
  --clr-secondary-light: #60a5fa;
  --clr-accent: #8b5cf6;
  --clr-accent-dark: #7c3aed;
  --clr-accent-light: #a78bfa;
  
  /* Text colors */
  --clr-text: #1f2937;
  --clr-text-light: #6b7280;
  --clr-text-lighter: #9ca3af;
  --clr-text-on-primary: #ffffff;
  
  /* Border colors */
  --clr-border: #e5e7eb;
  --clr-border-light: #f3f4f6;
  --clr-border-dark: #d1d5db;
  
  /* Status colors */
  --clr-success: #10b981;
  --clr-success-light: #dcfce7;
  --clr-warning: #f59e0b;
  --clr-warning-light: #fef3c7;
  --clr-error: #ef4444;
  --clr-error-light: #fee2e2;
  --clr-info: #3b82f6;
  --clr-info-light: #dbeafe;
  
  /* Border radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Layout */
  --max-width: 1280px;
  --header-height: 80px;
  --footer-height: 120px;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  
  /* Font sizes */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  
  /* Line heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* Font weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Transitions */
  --transition: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}

/* ========== CSS RESET ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space);
  color: var(--clr-text);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

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

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

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--space);
  line-height: var(--line-height-relaxed);
}

.lead {
  font-size: var(--font-size-lg);
  color: var(--clr-text-light);
  line-height: var(--line-height-relaxed);
}

.small {
  font-size: var(--font-size-sm);
  color: var(--clr-text-light);
}

.x-small {
  font-size: var(--font-size-xs);
  color: var(--clr-text-lighter);
}

/* ========== LINKS ========== */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:not([class]) {
  color: var(--clr-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:not([class]):hover {
  color: var(--clr-primary-dark);
  text-decoration-thickness: 2px;
}

/* ========== IMAGES ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
}

img[width][height] {
  aspect-ratio: attr(width) / attr(height);
}

/* ========== BUTTONS & INTERACTIVE ELEMENTS ========== */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  transition: var(--transition);
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space);
  transition: var(--transition);
  background: var(--clr-surface);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ========== FOCUS MANAGEMENT ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus for mouse users */
@media (hover: hover) {
  *:focus:not(:focus-visible) {
    outline: none;
  }
}

/* ========== LISTS ========== */
ul, ol {
  margin-bottom: var(--space);
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-xs);
  line-height: var(--line-height-relaxed);
}

/* ========== HORIZONTAL RULE ========== */
hr {
  border: none;
  height: 1px;
  background: var(--clr-border);
  margin: var(--space-xl) 0;
}

/* ========== SELECTION ========== */
::selection {
  background: rgba(16, 185, 129, 0.2);
  color: var(--clr-text);
}

::-moz-selection {
  background: rgba(16, 185, 129, 0.2);
  color: var(--clr-text);
}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--clr-border-light);
}

::-webkit-scrollbar-thumb {
  background: var(--clr-border-dark);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--clr-text-lighter);
}

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

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

/* ========== VISUALLY HIDDEN ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== SKIP LINK ========== */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space);
  background: var(--clr-primary);
  color: white;
  padding: var(--space-sm) var(--space);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: var(--z-skip-link);
  transition: var(--transition);
}

.skip-link:focus {
  top: var(--space);
}

/* ========== PRINT STYLES ========== */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a, a:visited {
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
  
  .no-print {
    display: none !important;
  }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
  :root {
    --clr-border: #000000;
    --clr-text-light: #000000;
    --clr-text-lighter: #000000;
  }
}

/* ========== DARK MODE SUPPORT (готовность) ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --clr-bg: #111827;
    --clr-surface: #1f2937;
    --clr-text: #f9fafb;
    --clr-text-light: #d1d5db;
    --clr-text-lighter: #9ca3af;
    --clr-border: #374151;
    --clr-border-light: #4b5563;
  }
}

/* ========== RESPONSIVE BREAKPOINTS ========== */
/* Используются в медиа-запросах компонентов */
/* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px */

/* ========== BASE LAYOUT STYLES ========== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Responsive container padding */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

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

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

/* Main content area */
.main {
  flex: 1;
  width: 100%;
}

/* Ensure full width for specific sections if needed */
.full-width {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}