/* ========================= */
/* СБРОС И БАЗОВЫЕ СТИЛИ */
/* ========================= */
:root {
    --purple: #b56cff;
    --purple-glow: 0 0 25px rgba(181,108,255,.9);
    --bg-dark: #0b0614;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    overflow-x: hidden;
    position: relative;

    /* Основной фон под safe area (iPhone и др.) */
    background-color: #0b0614;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Фон сайта */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
        url("img/bg-premium.png") center / cover no-repeat;
    filter: brightness(1.3) contrast(1.1);
    z-index: -1;
    pointer-events: none;

    /* Подгонка под safe area (чтобы фон доходил до верхней и нижней панели) */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ========================= */
/* HERO */
.hero {
    padding: 120px 80px 100px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center,
        rgba(181,108,255,.25),
        transparent 70%);
    z-index: 0;
    filter: blur(12px);
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 64px;
    margin-bottom: 15px;
}

.hero h2 {
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--purple);
    margin-bottom: 45px;
}

.hero ul {
    list-style: none;
    padding: 0;
    margin: 0 0 50px;
}

.hero li {
    margin-bottom: 15px;
    font-weight: 300;
}

/* ========================= */
/* HEADER */
header {
    padding: 25px 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(181,108,255,.3);
}

nav a {
    margin-right: 35px;
    color: #fff;
    text-decoration: none;
    font-weight: 300;
    position: relative;
}

nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 100%;
    height: 2px;
    background: var(--purple);
    box-shadow: var(--purple-glow);
}

.socials {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    margin-left: 15px;
    border: 2px solid var(--purple);
    border-radius: 50%;
    background: rgba(10,5,20,0.7);
    box-shadow: 0 0 15px rgba(181,108,255,0.8);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 10px rgba(181,108,255,0.9));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-link:hover {
    background: var(--purple);
    box-shadow: 0 0 25px rgba(181,108,255,0.9);
}

.social-link:hover img {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px #fff);
}

/* ========================= */
/* BUTTON */
.btn {
    padding: 15px 45px;
    border: 1px solid var(--purple);
    background: transparent;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--purple-glow);
    transition: .3s;
    display: inline-block;
    border-radius: 8px;
}

.btn:hover {
    background: var(--purple);
}

/* ========================= */
/* ABOUT */
section.about {
    padding: 70px 80px;
    border-top: 1px solid rgba(181,108,255,.2);
    text-align: center;
}

.about h3 {
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.about p {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 300;
}

/* ========================= */
/* FOOTER CARDS */
footer {
    padding: 60px 80px 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.card {
    border: 1px solid rgba(181,108,255,.4);
    box-shadow: var(--purple-glow);
    padding: 20px;
    text-align: center;
    transition: .3s;
    background: rgba(10, 5, 20, .65);
    backdrop-filter: blur(6px);
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-6px);
}

.card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 8px;
}

.card-title {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #f0e6ff;
    text-shadow:
        0 0 6px rgba(181,108,255,0.9),
        0 0 12px rgba(181,108,255,0.6),
        0 0 18px rgba(181,108,255,0.4);
    margin-top: 5px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.card:hover .card-title {
    text-shadow:
        0 0 8px rgba(181,108,255,1),
        0 0 16px rgba(181,108,255,0.8),
        0 0 24px rgba(181,108,255,0.6);
    color: #fff;
}

/* ========================= */
/* МОДАЛЬНОЕ ОКНО */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9999;
    padding: 20px;
}

.modal-content, .price-modal-content {
    position: relative;
    background: #0b0614;
    padding: 40px 30px 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* ограничиваем высоту модалки */
    overflow-y: auto; /* вертикальный скролл только внутри модалки */
    box-shadow: 0 0 25px rgba(181,108,255,0.7);
    color: #fff;
    text-align: left;
    animation: modalShow 0.3s ease-out;
    box-sizing: border-box;
}

.price-modal-content {
    padding: 20px 15px 15px;
}

@keyframes modalShow {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 22px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--purple);
    color: #fff;
    transform: scale(1.1);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--purple);
    text-align: center;
}

.modal-content p {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.5;
}

/* ========================= */
/* ПРАЙС-ЛИСТ */
.price-wrapper {
    width: 100%;
    overflow-x: hidden; /* горизонтальный скролл убран */
    padding-bottom: 10px;
}

.price-wrapper .price-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

.price-table th, .price-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(181,108,255,0.2);
}

.price-table th {
    font-weight: 600;
    color: var(--purple);
}

.price-table td {
    font-weight: 300;
    color: #fff;
}

.price-table tr:hover {
    background: rgba(181,108,255,0.1);
}

.price-description p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
}

/* ========================= */
/* НОВОСТИ */
.news-page {
    padding: 60px 80px;
    text-align: center;
}

.news-page h1 {
    font-size: 36px;
    margin-bottom: 30px;
    color: var(--purple);
}

.news-post {
    background: rgba(10, 5, 20, 0.65);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--purple-glow);
    transition: all 0.3s ease;
}

.news-post:hover {
    transform: translateY(-5px);
}

.news-post h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.news-post img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto 0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(181,108,255,0.5);
}

/* ========================= */
/* МЕДИА-ЗАПРОСЫ */

/* Планшеты */
@media (max-width: 900px) {
    header, .hero, .about, footer { padding-left: 30px; padding-right: 30px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 48px; }
    .hero h2 { font-size: 14px; }
    .hero ul li { font-size: 14px; }
    .btn { padding: 12px 35px; }
    .price-modal-content { max-width: 90%; }
    .price-table th, .price-table td { font-size: 13px; padding: 6px 8px; }
    .price-description p { font-size: 13px; }
}

/* Мобильные устройства */
@media (max-width: 600px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
    }
    nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0; }
    nav a { margin-right: 0; font-size: 14px; }
    .socials { margin-top: 0; display: flex; align-items: center; }
    .hero { padding: 80px 20px 60px; }
    .hero h1 { font-size: 36px; }
    .hero h2 { font-size: 12px; letter-spacing: 2px; }
    .hero ul li { font-size: 13px; }
    .btn { padding: 10px 25px; font-size: 14px; }
    section.about { padding: 50px 20px; }
    .about h3 { font-size: 20px; }
    .about p { font-size: 14px; }
    .cards { grid-template-columns: 1fr; }
    .card img { height: auto; }
    .card span { font-size: 13px; }

    .price-modal-content { max-width: 95%; padding: 15px 10px; }
    .price-table th, .price-table td { font-size: 12px; padding: 5px 6px; }
    .price-description p { font-size: 12px; }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .hero h1 { font-size: 28px; }
    .hero h2 { font-size: 11px; }
    .btn { padding: 8px 20px; font-size: 13px; }
    .about p { font-size: 13px; }

    .price-modal-content { padding: 10px 8px; }
    .price-table th, .price-table td { font-size: 11px; padding: 4px 5px; }
    .price-description p { font-size: 11px; }
}

/* ========================= */
/* COURSES PAGE */
/* ========================= */

.courses-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Socials поверх контента */
.courses-socials {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 10;
}

/* Основной блок */
.courses-wrapper {
    padding: 120px 80px 80px;
    text-align: center;
}

.courses-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 56px;
    margin-bottom: 10px;
}

.courses-subtitle {
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--purple);
    margin-bottom: 70px;
}

/* Сетка курсов */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Карточка */
.course-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(10,5,20,0.6);
    box-shadow: 0 0 30px rgba(181,108,255,0.5);
    transform: translateY(20px);
    opacity: 0;
    animation: courseFadeIn 0.8s ease forwards;
}

.course-card:nth-child(1) { animation-delay: .1s; }
.course-card:nth-child(2) { animation-delay: .2s; }
.course-card:nth-child(3) { animation-delay: .3s; }
.course-card:nth-child(4) { animation-delay: .4s; }
.course-card:nth-child(5) { animation-delay: .5s; }

.course-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
}

/* Эффект при наведении */
.course-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(181,108,255,0.35),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.course-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.15);
}

.course-card:hover::after {
    opacity: 1;
}

/* Анимация появления */
@keyframes courseFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 700px) {
    .courses-wrapper {
        padding: 100px 20px 60px;
    }

    .courses-title {
        font-size: 36px;
    }

    .courses-subtitle {
        font-size: 12px;
        margin-bottom: 40px;
    }

    .courses-socials {
        top: 15px;
        right: 15px;
    }
}
