:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1b1e;
  --text-secondary: #6c757d;
  --border-color: #e9ecef;
  --accent-color: #0088CC;
  --error-color: #dc3545;
  --success-color: #28a745;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-primary: #1a1b1e;
  --bg-secondary: #2c2e33;
  --text-primary: #ffffff;
  --text-secondary: #ced4da;
  --border-color: #373a40;
  --accent-color: #3498db;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Добавляем полупрозрачный паттерн */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/static/img/bg1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

/* Добавляем класс для плавного перехода при переключении темы */
body.theme-transitioning * {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* Main Content */
.site-content {
  flex: 1;
  padding-bottom: unset; /* Убираем фиксированный отступ для футера */
  opacity: 1;
  transform: none;
  visibility: visible;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.section {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
  opacity: 1;
  transform: none;
  visibility: visible;
}

.card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.card-link:hover {
  transform: translateY(-5px);
}

/* Анимации для карточек */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardDisappear {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes cardGlow {
    0% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-color);
    }
    100% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

/* Стили для карточек */
.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    border: 1px solid var(--border-color);
    animation: cardAppear 0.5s ease forwards;
    height: 120px; /* Изменено с 180px на 120px */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    flex-shrink: 0; /* Запрещаем сжатие заголовка */
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
    z-index: 1;
    flex-grow: 1; /* Занимаем оставшееся пространство */
    display: flex;
    align-items: center; /* Центрируем текст по вертикали */
}

.emoji {
    position: absolute;
    right: -1rem;
    bottom: -1rem;
    font-size: 4rem;
    opacity: 0.1;
    transition: all 0.3s ease;
    z-index: 0;
    flex-shrink: 0; /* Запрещаем сжатие эмодзи */
}

.card:hover .emoji {
    opacity: 0.8;
    transform: scale(1.1) rotate(5deg);
}

/* Анимации для секций */
.category-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.category-section:not(.active) .card {
    animation: cardDisappear 0.3s ease forwards;
}

.category-section.active .card {
    animation: cardAppear 0.5s ease forwards;
    animation-delay: calc(var(--card-index) * 0.1s);
}

/* Стили для футера */
footer {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  box-shadow: 0 -2px 8px var(--shadow-color);
  z-index: 100;
  margin-top: 2rem;
  border-radius: 12px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-content {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section {
  flex: 1;
  text-align: left;
}

.footer-section h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.footer-section p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.footer-section a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-2px);
  background: var(--accent-color);
}

.social-links .icon {
  fill: var(--text-primary);
  transition: fill 0.3s ease;
}

.social-links a:hover .icon {
  fill: white;
}

.channel-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.channel-link .subscribers {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .site-content {
    padding-bottom: 300px; /* Увеличиваем отступ на мобильных устройствах */
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1rem;
  }

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

  .social-links {
    justify-content: center;
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .card {
    height: 160px;
    padding: 1.25rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
  
  .card-desc {
    font-size: 0.85rem;
  }
  
  .emoji {
    font-size: 3.5rem;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .card {
    height: 150px;
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-desc {
    font-size: 0.8rem;
  }
  
  .emoji {
    font-size: 3rem;
  }
}

/* Убираем лоадер */
.loader {
  display: none;
}

/* Стили для фонового контейнера */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: var(--bg-primary);
}

.background-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/static/img/bg1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
}

/* Обновляем стили для основного контента */
.content-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Удаляем старые стили для body::before */
body::before {
  display: none;
}

/* Медиа-запросы для мобильной адаптации */
@media screen and (max-width: 1024px) {
  .container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .section {
    padding: 1.5rem;
  }

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

@media screen and (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .section {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-description {
    font-size: 0.9rem;
  }

  .card-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .section {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .card {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-description {
    font-size: 0.8rem;
  }

  .card-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.75rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .footer {
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-link {
    font-size: 0.9rem;
  }
}

/* Адаптация для очень маленьких экранов */
@media screen and (max-width: 360px) {
  .container {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .section {
    padding: 0.75rem;
  }

  .card {
    padding: 0.5rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-description {
    font-size: 0.75rem;
  }

  .card-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  .stat-card {
    padding: 0.5rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }
}

/* Стили для кнопок категорий */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2rem 0;
  justify-content: center;
}

.category-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.category-button:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

.category-button.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Стили для секций категорий */
.category-section {
  display: none;
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.category-section.active {
  display: block;
  opacity: 1;
  transform: none;
  visibility: visible;
}

/* Адаптивность для кнопок категорий */
@media (max-width: 768px) {
  .category-buttons {
    gap: 8px;
    padding: 0 1rem;
  }
  
  .category-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .category-buttons {
    gap: 6px;
  }
  
  .category-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Стили для основного контента */
.site-content {
  flex: 1;
  padding-bottom: unset; /* Убираем фиксированный отступ для футера */
  opacity: 1;
  transform: none;
  visibility: visible;
}

/* Удаляем все анимации при загрузке */
@keyframes fadeIn {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Стили для контента */
.site-content {
  opacity: 1;
  transform: none;
  visibility: visible;
}

/* Удаляем все анимации при переключении категорий */
.category-section:not(.active) {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.category-section.active {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Простые классы для отступов */
.top-space {
  margin-top: 3rem;
}

.bottom-space {
  margin-bottom: 1.5rem;
}

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

/* Стили для переключателя языков */
.language-switcher {
  position: relative;
  display: inline-block;
  margin-right: 0;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: auto;
}

.language-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.current-lang-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-arrow {
  width: 12px;
  height: 8px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.language-toggle.active .lang-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
  min-width: 160px;
}

.language-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: var(--bg-secondary);
  color: var(--accent-color);
  transform: translateX(4px);
}

.lang-option.active {
  background: var(--accent-color);
  color: white;
}

.lang-flag {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.lang-name {
  font-weight: 500;
  white-space: nowrap;
}

/* RTL поддержка для арабского и персидского */
.lang-option[data-lang="ar"] .lang-name,
.lang-option[data-lang="fa"] .lang-name {
  direction: rtl;
  text-align: right;
}

/* Стили для переключателя темы */
.theme-switch {
  margin-left: 0.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
  .language-switcher {
    margin-right: 0;
  }
  
  .theme-switch {
    margin-left: 0.3rem;
  }
  
  .language-toggle {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .language-dropdown {
    min-width: 140px;
  }
  
  .lang-option {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .language-toggle {
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
  }
  
  .current-lang-flag {
    font-size: 1.1rem;
  }
  
  .lang-arrow {
    width: 10px;
    height: 6px;
  }
}

/* RTL поддержка для арабского и персидского языков */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .nav {
  direction: rtl;
}

[dir="rtl"] .desktop-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .dropdown {
  text-align: right;
}

[dir="rtl"] .dropdown-content {
  left: auto;
  right: 0;
}

[dir="rtl"] .language-switcher {
  margin-right: 0.5rem;
  margin-left: 0;
}

[dir="rtl"] .theme-switch {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .mobile-nav {
  text-align: right;
}

[dir="rtl"] .mobile-item-content {
  text-align: right;
}

/* Плавная анимация для смены направления */
* {
  transition: margin 0.3s ease, padding 0.3s ease;
} 