/* ==========================================================================
   Levels Pricing Section - Навчання за рівнями
   ========================================================================== */

/* === СЕКЦІЯ LEVELS === */

.levels-section {
  padding: var(--section-padding-desktop);
  margin-bottom: var(--section-spacing-desktop);
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* === MAIN TITLE === */

.levels-section .section-title {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--color-white);
}

/* === SUBTITLE === */

.levels-section .section-subtitle {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  margin: 0 0 4rem 0;
  font-weight: 500;
  line-height: 1.5;
}

/* === ІНФОРМАЦІЙНИЙ БЛОК ЗВЕРХУ === */

.levels-info-top {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(255, 193, 7, 0.1) 100%);
  border: 2px solid rgba(255, 193, 7, 0.6);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 6rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.levels-info-top h3 {
  font-size: 3.25rem;
  font-weight: 900;
  color: var(--color-white);
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.levels-info-top p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.levels-info-top p:first-of-type {
  font-size: 2.15rem;
  font-weight: 600;
}

.levels-info-top p:last-child {
  margin-bottom: 0;
}

/* SVG зірочка у правому верхньому куті */
.levels-info-top__star {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 48px;
  height: 48px;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
  opacity: 1;
  z-index: 10;
  transform: rotate(15deg);
}

/* === СТИЛІ ДЛЯ НОВИХ ЕЛЕМЕНТІВ "БЕЗЛІМІТНА АНГЛІЙСЬКА" === */

/* Заголовок в levels-info-top */
.levels-info-top__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 0.5rem 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
}

/* Підзаголовок */
.levels-info-top__subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1.5rem 0;
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

/* CTA кнопка */
.levels-info-top__cta {
  display: block;
  margin: 0 auto;
  max-width: 300px;
  width: 100%;
}

/* Останній промо-блок без нижнього відступу */
.levels-info-promo {
  margin-bottom: 0;
}

/* === РІВЕНЬ КОМПОЗИЦІЇ: КАРТКИ КОМПОНЕНТІВ === */

.level-composition {
  padding: 2rem 0;
  margin-bottom: 4rem;
}

.level-composition h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin: 0 0 2rem 0;
  line-height: 1.3;
}

/* === КОНТЕЙНЕР ДЛЯ КАРТОК З ПРОКРУТКОЮ === */

.level-cards-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.level-cards-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Приховування скролбара */
.level-cards-container::-webkit-scrollbar {
  display: none;
}

/* === КАРТКА КОМПОНЕНТА === */

.level-card {
  flex: 0 0 auto;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
  scroll-snap-align: start;
  transition: all var(--transition-normal) ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
  .level-card:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }
}

.level-card:focus-visible {
  outline: 2px solid rgba(100, 149, 237, 0.8);
  outline-offset: 2px;
}

.level-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0;
  line-height: 1.3;
}

.level-card__description {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
}

/* === НАВІГАЦІЙНІ СТРІЛОЧКИ === */

.level-cards-nav-wrapper {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  z-index: 20;
}

.level-cards-nav {
  width: 40px;
  height: 40px;
  background: rgba(231, 30, 20, 0.9);
  border: 1px solid rgba(231, 30, 20, 0.6);
  border-radius: 8px;
  color: var(--color-white);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal) ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 0;
}

@media (hover: hover) and (pointer: fine) {
  .level-cards-nav:hover:not(:disabled) {
    background: rgba(231, 30, 20, 1);
    border-color: rgba(231, 30, 20, 0.9);
    transform: scale(1.05);
  }
}

.level-cards-nav:focus-visible {
  outline: 2px solid rgba(231, 30, 20, 0.8);
  outline-offset: 2px;
}

.level-cards-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === ПРАЙС-КАРТКИ === */

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 6rem;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
}

/* Картка прайсу */
.pricing-card {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  text-align: center;
  transition: all var(--transition-normal) ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  min-height: auto;
  overflow: visible;
}

@media (hover: hover) and (pointer: fine) {
  .pricing-card:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
  }
}

/* Популярна картка */
.pricing-card--popular {
  border: 2px solid rgba(255, 193, 7, 0.6);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(255, 193, 7, 0.05) 100%);
  box-shadow: 0 8px 40px rgba(255, 193, 7, 0.3);
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 320px;
}

@media (hover: hover) and (pointer: fine) {
  .pricing-card--popular:hover {
    border-color: rgba(255, 193, 7, 0.9);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(255, 193, 7, 0.1) 100%);
    box-shadow: 0 12px 48px rgba(255, 193, 7, 0.4);
  }
}

/* Badge "Найпопулярніший" */
.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 193, 7, 1);
  color: rgba(0, 0, 0, 0.95);
  font-size: 1rem;
  font-weight: 700;
  padding: 3px 16px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Тільки на популярній картці */
.pricing-card:not(.pricing-card--popular) .pricing-card__badge {
  display: none;
}

/* Стікер зі знижкою */
.pricing-card__discount-sticker {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 56px;
  height: 56px;
  background: rgba(76, 175, 80, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 1);
  transform: rotate(15deg);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  z-index: 15;
}

/* Заголовок картки */
.pricing-card__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0.3rem 0 0.3rem 0;
  line-height: 1.3;
}

.pricing-card--popular .pricing-card__title {
  color: rgba(255, 193, 7, 0.95);
}

/* Рядок 2: Кількість рівнів = Тривалість */
.pricing-card__row-2 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

/* Рядок 3: Ціна за рівень */
.pricing-card__row-3 {
  margin: 0 0 0.75rem 0;
  padding-top: 0.5rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-old {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

.price-new {
  color: rgba(76, 175, 80, 0.95);
  font-weight: 700;
  font-size: 2.5rem;
}

/* Ціна за місяць */
.pricing-card .price-per-month {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(100, 149, 237, 0.95);
  margin: 0.5rem 0 0 0;
  padding: 0;
  line-height: 1.2;
}

.pricing-card--popular .price-per-month {
  color: rgba(255, 193, 7, 0.95);
}

/* === КНОПКА "ПОЧАТИ НАВЧАННЯ" === */

.pricing-card__button {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary) 0%, rgba(231, 30, 20, 0.8) 100%);
  color: var(--color-white);
  cursor: pointer;
  transition: all var(--transition-normal) ease;
  box-shadow: 0 4px 12px rgba(231, 30, 20, 0.3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: hover) and (pointer: fine) {
  .pricing-card__button:hover {
    background: linear-gradient(135deg, rgba(231, 30, 20, 0.9) 0%, rgba(231, 30, 20, 0.7) 100%);
    box-shadow: 0 6px 16px rgba(231, 30, 20, 0.4);
    transform: translateY(-2px);
  }
}

.pricing-card__button:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.pricing-card__button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(231, 30, 20, 0.3);
}

/* === CTA БЛОК === */

.levels-cta {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 0;
}

.levels-cta .button {
  max-width: 400px;
  margin: 0 auto;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-normal) ease;
}

/* === RESPONSIVE: TABLET === */

@media (width <=1200px) and (width >=768px) {
  .levels-section {
    padding: var(--section-padding-desktop);
  }

  .levels-section .section-title {
    font-size: var(--font-size-xl);
  }

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

  .levels-info-top {
    margin-bottom: 2rem;
  }

  .level-composition {
    margin-bottom: 4rem;
    padding: 0;
  }

  .level-cards-container {
    gap: 1rem;
  }

  .level-card {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }

  .pricing-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    align-items: center;
  }

  .pricing-card {
    min-height: auto;
    padding: 1.8rem 1.25rem;
    justify-content: space-between;
  }

  .pricing-card--popular {
    transform: scale(1.03);
    padding-top: 2rem;
    padding-bottom: 2rem;
    min-height: 400px;
  }

  .pricing-card__title {
    font-size: 1.1rem;
  }

  .pricing-card .price-per-month {
    font-size: 1.5rem;
  }

  .pricing-card--popular .price-per-month {
    font-size: 1.75rem;
  }
}

/* === RESPONSIVE: MOBILE === */

@media (width < 768px) {
  .levels-section {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(100vw - 2rem);
    padding: var(--section-padding-mobile);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--section-spacing-mobile);
    overflow-x: hidden;
  }

  .levels-section .section-title {
    font-size: 2rem;
    margin-bottom: 0.35rem;
  }

  .levels-section .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
  }

  .levels-info-top {
    padding: 1.25rem 1rem;
    margin-bottom: 1.75rem;
    border-radius: 12px;
  }

  .levels-info-top h3 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .levels-info-top p {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }

  .levels-info-top p:first-of-type {
    font-size: 1.2rem;
  }

  .levels-info-top__star {
    width: 40px;
    height: 40px;
    top: -10px;
    right: -10px;
  }

  /* Mobile стилі для нових елементів */
  .levels-info-top__title {
    font-size: 1.5rem;
  }

  .levels-info-top__subtitle {
    font-size: 1rem;
  }

  .level-composition {
    margin-bottom: 3rem;
    padding: 0;
  }

  .level-composition h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
  }

  .level-cards-container {
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .level-card {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
    padding: 1rem;
    border-radius: 10px;
  }

  .level-card__title {
    font-size: 0.85rem;
  }

  .level-card__description {
    font-size: 0.7rem;
  }

  .level-cards-nav-wrapper {
    margin-top: 0.75rem;
  }

  .level-cards-nav {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .pricing-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .pricing-card {
    min-height: auto;
    padding: 1.8rem 1rem;
    border-radius: 12px;
    transform: none;
    justify-content: space-between;
  }

  .pricing-card--popular {
    transform: none;
    border-width: 2px;
    padding-top: 2rem;
    padding-bottom: 2rem;
    min-height: auto;
  }

  .pricing-card__badge {
    font-size: 0.65rem;
    padding: 2px 12px;
    top: -10px;
  }

  .pricing-card__title {
    font-size: 1.9rem;
    margin-top: 0;
  }

  .pricing-card__row-2 {
    font-size: 0.9rem;
    margin: 0;
  }

  .pricing-card__row-3 {
    font-size: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
  }

  .price-old {
    font-size: 0.95rem;
  }

  .price-new {
    font-size: 2rem;
  }

  .pricing-card .price-per-month {
    font-size: 1.2rem;
    margin-top: 0;
    padding-top: 0;
  }

  .levels-cta {
    margin-top: 2rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .levels-cta .button {
    max-width: 100%;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.7rem;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.4;
  }
}

/* === ACCESSIBILITY === */

@media (prefers-reduced-motion: reduce) {

  .levels-info-top,
  .level-card,
  .level-cards-nav,
  .pricing-card {
    transition: none;
  }

  .level-card:hover,
  .pricing-card:hover {
    transform: none;
  }
}

/* === FOCUS STATES === */

.level-card:focus-visible,
.level-cards-nav:focus-visible,
.pricing-card:focus-visible,
.levels-cta .button:focus-visible {
  outline: 2px solid rgba(100, 149, 237, 0.8);
  outline-offset: 2px;
}

/* === FALLBACK FOR NO BACKDROP-FILTER SUPPORT === */

@supports not (backdrop-filter: blur(10px)) {

  .levels-info-top,
  .level-card,
  .pricing-card {
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* === PERFORMANCE OPTIMIZATION === */

.level-card {
  will-change: auto;
}

@media (hover: hover) and (pointer: fine) {
  .level-card:hover {
    will-change: transform;
  }

  .level-card:not(:hover) {
    will-change: auto;
  }
}

.pricing-card {
  will-change: auto;
}

@media (hover: hover) and (pointer: fine) {
  .pricing-card:hover {
    will-change: transform;
  }

  .pricing-card:not(:hover) {
    will-change: auto;
  }
}