:root {
  --primary: #0066ff;
  --primary-light: #0099ff;
  --primary-dark: #0044cc;
  --primary-ultralight: #f0f8ff;
  --primary-gradient: linear-gradient(135deg, #0066ff, #00ccff);

  --secondary: #ff3366;
  --secondary-light: #ff6699;
  --secondary-dark: #ff0044;
  --secondary-gradient: linear-gradient(135deg, #ff3366, #ff66cc);

  --accent: #00ff99;
  --accent-light: #66ffcc;
  --accent-dark: #00cc66;
  --accent-gradient: linear-gradient(135deg, #00ff99, #00ffcc);

  --success: #00ff88;
  --warning: #d88200;
  --error: #ff3366;
  --info: #0099ff;

  --bg: #ffffff;
  --bg-dark: #f8f9ff;
  --bg-light: #f0f4ff;
  --bg-card: #ffffff;
  --bg-toggle: #dbdee7;

  --text: #0a0a12;
  --text-light: #4a4a6a;
  --text-lighter: #7a7a9a;

  --border: #e0e4ff;
  --border-light: #f0f4ff;
  --border-dark: #d0d4f0;

  --border-glow: 0 0 8px rgba(0, 102, 255, 0.2);

  --shadow: 0 4px 20px rgba(0, 102, 255, 0.1);
  --shadow-sm: 0 2px 10px rgba(0, 102, 255, 0.08);
  --shadow-md: 0 6px 25px rgba(0, 102, 255, 0.15);
  --shadow-lg: 0 10px 35px rgba(0, 102, 255, 0.2);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: #0066ff;
  --primary-light: #0099ff;
  --primary-dark: #0044cc;
  --primary-ultralight: #e6f2ff;
  --primary-gradient: linear-gradient(135deg, #0066ff, #00ccff);
  --primary-glow: 0 0 15px rgba(0, 102, 255, 0.4);

  --secondary: #ff3366;
  --secondary-light: #ff6699;
  --secondary-dark: #ff0044;
  --secondary-gradient: linear-gradient(135deg, #ff3366, #ff66cc);
  --secondary-glow: 0 0 15px rgba(255, 51, 102, 0.4);

  --accent: #00ff99;
  --accent-light: #66ffcc;
  --accent-dark: #00cc66;
  --accent-gradient: linear-gradient(135deg, #00ff99, #00ffcc);
  --accent-glow: 0 0 15px rgba(0, 255, 153, 0.4);

  --success: #00ff88;
  --warning: #ffcc00;
  --error: #ff3366;
  --info: #0099ff;

  --bg: #0a0a12;
  --bg-dark: #12121f;
  --bg-light: #1a1a2e;
  --bg-card: #1a1a2e;
  --bg-toggle: #3e3e60;

  --text: #ffffff;
  --text-light: #a0a0c0;
  --text-lighter: #6a6a8a;

  --border: #2a2a4a;
  --border-light: #3a3a5a;
  --border-dark: #1a1a3a;

  --border-glow: 0 0 8px rgba(0, 102, 255, 0.3);

  --shadow: 0 4px 20px rgba(0, 102, 255, 0.2);
  --shadow-sm: 0 2px 10px rgba(0, 102, 255, 0.15);
  --shadow-md: 0 6px 25px rgba(0, 102, 255, 0.25);
  --shadow-lg: 0 10px 35px rgba(0, 102, 255, 0.3);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(0, 102, 255, 0.05) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 51, 102, 0.05) 0%, transparent 25%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Навигация */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  transition: background-color 0.3s ease;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}

.logo a {
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shine 3s infinite linear;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

/* Переключатель темы */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-toggle);
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
  background-color: var(--primary);
  color: white;
}

/* Переключатель языка */
.language-switch {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-toggle);
  border-radius: 34px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border: 1px solid var(--border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  transition: var(--transition);
  z-index: 2;
}

input:checked+.slider:before {
  transform: translateX(38px);
}

.lang-text {
  font-size: 0.7rem;
  font-weight: 600;
  transition: var(--transition);
  z-index: 1;
}

.lang-text.ru {
  color: var(--text);
  opacity: 1;
}

.lang-text.en {
  color: var(--text);
  opacity: 1;
}

input:checked+.slider .lang-text.ru {
  color: var(--text);
  opacity: 1;
}

input:checked+.slider .lang-text.en {
  color: white;
  opacity: 1;
}

.btn {
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Стили для блога */
.blog-hero {
  padding: 80px 0 40px;
  text-align: center;
}

.blog-hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 40px;
}

.blog-filters {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
  margin-bottom: 60px;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.blog-card-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.blog-card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-date {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.blog-card-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.4;
}

.blog-card-excerpt {
  color: var(--text-light);
  margin-bottom: 20px;
  flex-grow: 1;
}

.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.blog-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.blog-card-author a {
  text-decoration: none;
  color: var(--text-light);
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-card-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.blog-card-link:hover {
  gap: 8px;
}

.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 80px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn.active,
.pagination-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.newsletter-section {
  background: var(--bg-light);
  padding: 60px 0;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 80px;
}

.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-content h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--text);
}

.newsletter-content p {
  color: var(--text-light);
  margin-bottom: 32px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex-grow: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Футер */
footer {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg));
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0.3;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-size: 0.9rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

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

/* Модалное окно*/
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--error);
}

.modal-body {
  padding: 32px;
  text-align: center;
}

.modal-icon {
  margin-bottom: 20px;
}

.modal-body p {
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 24px;
  border-top: 1px solid var(--border);
}


/* Адаптивность */
@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2.2rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .nav-link {
    display: none;
  }

  .modal-content {
    width: 95%;
    margin: 20px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-body {
    padding: 24px;
  }
}