/* Общие стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ff6b35;
  --secondary-color: #004e89;
  --accent-color: #ffd23f;
  --text-dark: #1a1a2e;
  --text-light: #ffffff;
  --bg-light: #f8f9fa;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-gradient-p1: linear-gradient(
    90deg,
    rgba(247, 247, 237, 0) 0%,
    rgba(237, 221, 83, 1) 100%
  );
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);

  /* Цвета для светлой темы */
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --navbar-gradient: linear-gradient(135deg, #667eea 0%, #2a064f 100%);
  --philosophy-bg: rgba(255, 255, 255, 0.95);
  --belt-item-bg: #f7fafc;
  --belt-item-hover: #edf2f7;
}

/* Темная тема */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border-color: #334155;
  --card-bg: #1e293b;
  --navbar-gradient: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
  --philosophy-bg: rgba(30, 41, 59, 0.95);
  --belt-item-bg: #1e293b;
  --belt-item-hover: #334155;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.7);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Навигация */
.navbar {
  background: var(--navbar-gradient);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-hover);
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideInLeft 0.6s ease;
}

.logo-icon {
  font-size: 2.5rem;
  animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

.nav-logo h1 {
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  animation: slideInRight 0.6s ease;
}

.nav-link {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.05s ease;
  padding: 8px;
  position: relative; /* обязательно! */
  overflow: hidden; /* обрезает выходящую за границы анимацию */
  cursor: pointer;
}

.nav-link img {
  /* margin-left: 20px; */
  width: 40px;
  height: 30px;
}
/* .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transition: 0.3s ease;
} */
.nav-link img:hover {
  transform: scale(1.2);
  transition: 0.3s ease;
}
/* Гамбургер меню */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 30px;
  height: 3px;
  background: var(--text-light);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Контейнер для переключателей темы и языка */
.controls-container {
  position: fixed;
  top: 125px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Переключатель темы */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background: var(--navbar-gradient);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Переключатель языка */
.language-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background: var(--navbar-gradient);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: white;
}

.language-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-icon-container {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-icon-container {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;

}

.theme-toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.theme-toggle-switch::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle-switch {
  background: rgba(255, 210, 63, 0.3);
}

[data-theme="dark"] .theme-toggle-switch::before {
  transform: translateX(24px);
  background: #ffd23f;
}

.theme-icon {
  font-size: 1.5rem;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.language-flag {
  font-size: 1.5rem;
  transition: all 0.3s ease;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.theme-icon.sun {
  opacity: 1;
}

.theme-icon.moon {
  opacity: 0;
}

[data-theme="dark"] .theme-icon.sun {
  opacity: 0;
}

[data-theme="dark"] .theme-icon.moon {
  opacity: 1;
}

/* Языковые флаги */
.language-flag.ru {
  opacity: 1;
}

.language-flag.en {
  opacity: 0;
}

[lang="en"] .language-flag.ru {
  opacity: 0;
}

[lang="en"] .language-flag.en {
  opacity: 1;
}

.theme-toggle-label {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Hero секция */
.hero {
  background: var(--bg-secondary);
  padding: 4rem 2rem;
  min-height: auto;
  transition: background 0.3s ease;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 3rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.philosophy-box {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease;
  border: 1px solid var(--border-color);
}
.philosophy-box img {
  max-width: 70px;
}
.philosophy-box.visible {
  transform: translateY(0);
  opacity: 1;
}

.philosophy-text {
  border-radius: 15px;
  background-color: var(--card-bg);
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-primary);
  padding: 10px;
  transition: all 0.3s ease;
}

/* Секция поясов */
.belts-section {
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-top: 2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.subsection-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1.5rem;
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 10px;
  transition: all 0.3s ease;
}

.intro-text {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 10px;
  transition: all 0.3s ease;
}

.belts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.belt-category h4 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.belt-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.belt-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--belt-item-bg);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.belt-item:hover {
  transform: translateX(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background: var(--belt-item-hover);
}

.belt-color {
  width: 60px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #ddd;
  flex-shrink: 0;
}

/* Цвета поясов */
.belt-color.white {
  background: #ffffff;
}
.belt-color.white-yellow {
  background: linear-gradient(to right, #ffffff 50%, #ffd700 50%);
}
.belt-color.yellow {
  background: #ffd700;
}
.belt-color.yellow-green {
  background: linear-gradient(to right, #ffd700 50%, #4caf50 50%);
}
.belt-color.green {
  background: #4caf50;
}
.belt-color.green-blue {
  background: linear-gradient(to right, #4caf50 50%, #2196f3 50%);
}
.belt-color.blue {
  background: #2196f3;
}
.belt-color.blue-red {
  background: linear-gradient(to right, #2196f3 50%, #f44336 50%);
}
.belt-color.red {
  background: #f44336;
}
.belt-color.red-black {
  background: linear-gradient(to right, #f44336 50%, #000000 50%);
}
.belt-color.black {
  background: #000000;
}

.belt-info {
  display: flex;
  flex-direction: column;
}

.belt-info strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.belt-info span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Даны */
.dan-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dan-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--belt-item-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.dan-details {
  flex: 1;
}

.dan-details strong {
  font-size: 1.2rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 1rem;
}

.dan-details ul {
  list-style: none;
  padding-left: 0;
}

.dan-details li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.dan-details li:last-child {
  border-bottom: none;
}

.important-note {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 5px solid var(--primary-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .important-note {
  background: linear-gradient(135deg, #795548 0%, #5d4037 100%);
}

.exam-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.exam-text {
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Секции Пхумсе */
.poomsae-section {
  padding: 4rem 2rem;
  /* background: linear-gradient(135deg, #667eea 0%, #57505e 100%); */
  border-bottom: 5px solid rgba(255, 255, 255, 0.1);
}

/* .poomsae-section:nth-child(even) {
  background: linear-gradient(135deg, #434343 0%, #f5576c 100%);
} */

.poomsae-section.black-belt {
  background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
  border: 3px solid var(--accent-color);
}

.poomsae-content {
  max-width: 1200px;
  margin: 0 auto;
}

.poomsae-title {
  font-size: 2.5rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease;
}

.poomsae-title.visible {
  transform: translateY(0);
  opacity: 1;
}

.poomsae-description {
  font-size: 1.2rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease 0.2s;
  -webkit-text-shadow: 3px 2px 11px rgba(0, 0, 0, 0.65);
  -moz-text-shadow: 3px 2px 11px rgba(0, 0, 0, 0.65);
  text-shadow: 3px 2px 11px rgba(0, 0, 0, 0.65);
}

.poomsae-description.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Видео контейнер */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 соотношение */
  height: 0;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: var(--shadow-hover);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.6s ease 0.4s;
}

.video-container.visible {
  transform: scale(1);
  opacity: 1;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

/* Секция Фристайл */
.freestyle-section {
  /* background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); */
  background: linear-gradient(135deg, #c9e3e3 0%, #427798 100%);
  padding: 4rem 2rem;
}

.freestyle-content {
  max-width: 1400px;
  margin: 0 auto;
}

.freestyle-intro {
  font-size: 1.3rem;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 3rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.freestyle-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 3rem;
}

.freestyle-item {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  transform: translateY(20px);
  opacity: 0;
}

.freestyle-item.visible {
  transform: translateY(0);
  opacity: 1;
}

.freestyle-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.freestyle-item h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.freestyle-item p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* Футер */
.footer {
  background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
  color: var(--text-light);
  padding: 2rem;
  text-align: center;
}

.footer-content p {
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.footer-note {
  font-style: italic;
  opacity: 0.8;
}

/* Анимации при скролле */
.animate-on-scroll {
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.6s ease;
}

.animate-on-scroll.visible {
  transform: translateY(0);
  opacity: 1;
}

#poomsae1 {
  background: #e8e8b7;
  background: linear-gradient(
    90deg,
    rgba(232, 232, 183, 0.67) 0%,
    rgba(237, 221, 83, 1) 100%
  );
}
#poomsae2 {
  background: #f0f04d;
  background: linear-gradient(
    90deg,
    rgba(240, 240, 77, 0.67) 0%,
    rgba(175, 237, 83, 1) 100%
  );
}
#poomsae3 {
  background: #94f533;
  background: linear-gradient(
    90deg,
    rgba(148, 245, 51, 1) 0%,
    rgba(115, 176, 23, 1) 100%
  );
}
#poomsae4 {
  background: #73b017;
  background: linear-gradient(
    90deg,
    rgba(115, 176, 23, 1) 0%,
    rgba(59, 199, 255, 1) 100%
  );
}
#poomsae5 {
  background: #3bc7ff;
  background: linear-gradient(
    90deg,
    rgba(59, 199, 255, 1) 0%,
    rgba(17, 123, 166, 1) 100%
  );
}
#poomsae6 {
  background: #167ee0;
  background: linear-gradient(
    90deg,
    rgba(22, 126, 224, 1) 10%,
    rgba(222, 22, 22, 1) 100%
  );
}
#poomsae7 {
  background: #e8270e;
  background: linear-gradient(
    90deg,
    rgba(232, 39, 14, 0.88) 10%,
    rgba(138, 3, 3, 1) 100%
  );
}
#poomsae8 {
  background: #c72424;
  background: linear-gradient(
    90deg,
    rgba(199, 36, 36, 0.88) 10%,
    rgba(84, 24, 24, 1) 100%
  );
}

.swiper-button-prev {
  margin-top: 60px !important;
}
.swiper-button-next {
  margin-top: 60px !important;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.email {
  font-size: 16px;
  color: white;
}
/* Адаптивность */
@media (max-width: 1024px) {
  .nav-menu {
    gap: 0.3rem;
  }

  .nav-link {
    /* padding: 0.6rem 1rem; */
    font-size: 0.9rem;
  }

  .freestyle-video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .swiper {
    max-width: 600px;
    min-height: 300px;
  }
  .hamburger {
    display: flex;
  }
  .nav-link img {
    max-width: 32px;
  }
  .nav-menu {
    position: fixed;
    right: -100%;
    /* right: 0%; */
    top: 70px;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 30%;
    text-align: center;
    transition: left 0.3s ease;
    box-shadow: var(--shadow);
    /* padding: 2rem 0; */
    gap: 0;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    display: block;
    /* padding: 1rem; */
    width: 90%;
    margin: 0 auto;
  }

  .nav-logo h1 {
    font-size: 1.3rem;
  }

  .logo-icon {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .poomsae-title {
    font-size: 1.8rem;
  }

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

  .philosophy-box,
  .belts-section {
    padding: 1.5rem;
  }

  .freestyle-video-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .freestyle-item {
    padding: 1.5rem;
  }
}
@media (max-width: 768px) {
  .nav-menu {
    top: 65px;
  }
}
@media (max-width: 480px) {
  .nav-menu {
    top: 80px;
  }
  .nav-container {
    padding: 0 1rem;
  }

  .nav-logo h1 {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .poomsae-title {
    font-size: 1.5rem;
  }

  .poomsae-description,
  .philosophy-text {
    font-size: 1rem;
  }

  .hero,
  .poomsae-section,
  .freestyle-section {
    padding: 2rem 1rem;
  }

  .belt-item {
    flex-direction: column;
    text-align: center;
  }

  .dan-item {
    flex-direction: column;
  }

  /* Адаптация переключателей для мобильных */
  .controls-container {
    top: 90px;
    right: 10px;
    gap: 10px;
  }

  .theme-toggle,
  .language-toggle {
    width: 45px;
    height: 45px;
  }

  .theme-icon,
  .language-flag {
    font-size: 1.2rem;
  }
}

/* Улучшенная производительность */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
