/* style.css */
@charset "UTF-8";

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Open Sans', sans-serif;
    background: linear-gradient(
        135deg,
        #0c0c0c 0%,
        #1a1a2e 15%,
        #16213e 35%,
        #0f3460 50%,
        #533a7d 70%,
        #8b5a8c 85%,
        #a0616a 100%
    );
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
    line-height: 1.6;
}

/* Анимированный фон с фигурами */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    animation: float 8s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.shape:nth-child(1) {
    width: 120px;
    height: 80px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    transform: rotate(15deg);
}

.shape:nth-child(2) {
    width: 90px;
    height: 140px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
    transform: rotate(-20deg);
}

.shape:nth-child(3) {
    width: 100px;
    height: 60px;
    bottom: 20%;
    left: 15%;
    animation-delay: 4s;
    transform: rotate(25deg);
}

.shape:nth-child(4) {
    width: 80px;
    height: 120px;
    top: 15%;
    right: 25%;
    animation-delay: 6s;
    transform: rotate(-10deg);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(var(--start-rotation, 0deg));
    }
    50% {
        transform: translateY(-20px) rotate(calc(var(--start-rotation, 0deg) + 180deg));
    }
}

/* Glass morphism эффекты */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.glass:hover::before {
    left: 100%;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
header {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin: 0 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.logo:hover .logo-icon svg {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.4));
}

.clinic-name {
    color: #4FC3F7;
    text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
}

.nav-links {
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    margin-left: 20px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border-bottom-color: #4FC3F7;
}

/* Система страниц */
.page {
    display: none;
    min-height: 100vh;
    padding: 40px 0 20px;
}

.page.active {
    display: block;
}

.content-wrapper {
    min-height: calc(100vh - 200px);
}

/* Главный герой секция */
.main-hero-section {
    margin-bottom: 60px;
}

.main-hero-content {
    padding: 60px 20px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
    box-sizing: border-box;
    width: 100%;
}

.main-hero-content h1 {
    font-size: clamp(1.8rem, 6vw, 3rem);
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 10px;
    box-sizing: border-box;
}

.main-hero-subtitle {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    max-width: min(90%, 800px);
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    word-wrap: break-word;
}


/* Контакты на главной */
.main-contacts-section {
    margin-bottom: 60px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.contact-info {
    padding: 40px;
}

.contact-info h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-item-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-item-text h4 {
    color: white;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.contact-item-text p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.contact-map {
    padding: 40px;
}

.contact-map h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: white;
}

.map-container {
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.map-placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.map-placeholder p {
    margin: 8px 0;
    font-size: 16px;
}

/* Секции */
.section-title {
    font-size: 2.5rem;
    color: white;
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Преимущества */
.advantages-section {
    margin-bottom: 60px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.advantage-card {
    padding: 30px;
    text-align: center;
    color: white;
}

.advantage-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4FC3F7;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.advantage-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: white;
}

.advantage-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Страница "О клинике" */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

.about-text {
    padding: 40px;
    color: white;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.about-text h3 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: white;
}

.about-text ul {
    list-style: none;
    padding-left: 0;
}

.about-text li {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.about-text li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4FC3F7;
    font-weight: bold;
}

.clinic-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Герой секции для других страниц */
.hero {
    padding: 60px 40px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Футер */
#footer {
    margin-top: 60px;
}

.footer-content {
    padding: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    padding: 5px 10px;
}

.footer-links a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.copyright {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    nav {
        padding: 15px 30px;
        margin: 0 15px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .logo {
        font-size: 24px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }
}

/* Мобильная шапка - ИСПРАВЛЕННАЯ ВЕРСИЯ */
/* Мобильная шапка - ИСПРАВЛЕННАЯ ВЕРСИЯ */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0; /* 👈 МЕНЯЕМ: убираем gap между логотипом и кнопками */
        padding: 15px 20px;
        margin: 0 10px;
        transition: none;
        align-items: stretch; /* 👈 Выравниваем по ширине */
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        transition: opacity 0.2s ease-out;
        margin-left: 0;
        width: 100%;
        /* 👇 Добавляем для анимации высоты */
        max-height: 200px; /* 👈 Максимальная высота развернутого состояния */
        overflow: hidden;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 14px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        white-space: nowrap;
        transition: background-color 0.2s ease;
    }

    /* Компактный режим */
    header.compact {
        padding: 8px 0; /* 👈 Одинаковый паддинг сверху и снизу */
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    header.compact nav {
        padding: 8px 15px; /* 👈 Компактный паддинг */
        gap: 0;
    }

    header.compact .nav-links {
        /* 👇 Ключевое исправление - полностью убираем блок */
        max-height: 0 !important; /* 👈 Принудительно обнуляем высоту */
        opacity: 0;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0;
        border: none;
        /* 👇 Быстрая анимация */
        transition: max-height 0.2s ease-out, opacity 0.15s ease-out;
    }

    /* Полный режим */
    header.expanded .nav-links {
        opacity: 1;
        max-height: 200px; /* 👈 Возвращаем высоту */
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
    }

    /* Логотип на мобильных */
    .logo {
        font-size: 20px;
        transition: none;
        margin-bottom: 0; /* 👈 Убираем отступ снизу */
    }

    .logo-icon {
        width: 30px;
        height: 30px;
        transition: none;
    }
}


/* Вариант для слабых устройств - вообще без анимации */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .nav-links {
        transition: none !important;
    }

    header.compact .nav-links {
        display: none !important;
        transition: none !important;
    }

    header.expanded .nav-links {
        display: flex !important;
    }
}

/* Очень узкие экраны */
@media (max-width: 480px) {
    .main-hero-content {
        padding: 40px 15px;
    }

    .main-hero-content h1 {
        font-size: clamp(1.5rem, 7vw, 2rem);
        padding: 0 5px;
        line-height: 1.3;
    }

    .main-hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        padding: 0 10px;
        line-height: 1.5;
    }
}

@media (max-width: 360px) {
    .main-hero-content h1 {
        font-size: 1.4rem;
    }

    .main-hero-subtitle {
        font-size: 0.95rem;
    }
}
