﻿/* ===================================
   BASE.CSS - Foundation Styles
   =================================== */

/* CSS Variables */
:root {
  /* Colors */
  --color-primary: #3B6EFF;
  --color-primary-dark: #2952CC;
  --color-primary-light: #5A84FF;
  --color-secondary: #8B9DC3;
  --color-accent: #FF6B9D;
  
  /* Backgrounds */
  --bg-body: #0B0D12;
  --bg-surface: #14171F;
  --bg-surface-hover: #1C1F2B;
  --bg-card: #1A1D27;
  
  /* Text */
  --text-primary: #E8EAED;
  --text-secondary: #B8BFC8;
  --text-muted: #6B7280;
  
  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(59, 110, 255, 0.3);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 110, 255, 0.3);
  
  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Container */
  --container-max: 1280px;
  --container-padding: 1.5rem;
}

/* Reset & Base */
*, *::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;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover, a:focus {
  color: var(--color-primary-light);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Beautiful Lists Styling (No Classes) */
ul, ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
  color: var(--text-secondary);
}

ul li, ol li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  padding-left: 0.5rem;
}

ul li::marker {
  color: var(--color-primary);
  font-size: 1.2em;
}

ol li::marker {
  color: var(--color-primary);
  font-weight: 600;
}

ul ul, ol ol, ul ol, ol ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

/* Beautiful Tables Styling (No Classes) */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

thead tr th {
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover, tbody tr:focus-within {
  background: var(--bg-surface-hover);
}

tbody tr td {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tbody tr:first-child td {
  border-top: none;
}

tbody tr td:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 10000;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid white;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

picture {
  display: block;
}

/* Selection */
::selection {
  background: var(--color-primary);
  color: white;
}

::-moz-selection {
  background: var(--color-primary);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 6px;
  border: 3px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light);
}

/* Responsive Typography */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  :root {
    --container-padding: 1rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }
}

/* Utility: Screen Reader Only */
.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;
}
/* ===== MOBILE MENU ===== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Скрываем обычное меню на мобилках */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80%;
    background: rgba(15, 17, 25, 0.98);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .main-nav .nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }

  .main-nav .nav-list a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
  }

  .main-nav .header-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
  }

  .main-nav .btn {
    width: 160px;
    text-align: center;
  }
}
/* === MOBILE MENU TOGGLE === */
.mobile-menu-toggle {
  display: none; /* скрыто по умолчанию */
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Показываем бургер и скрываем меню на мобильных */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80%;
    background: rgba(15, 17, 25, 0.98);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .main-nav .nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }

  .main-nav .header-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
  }
}
