/* Base Styles */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --text-color: #212121;
    --secondary-text: #757575;
    --background-light: #F5F5F5;
    --background-dark: #333333;
    --white: #FFFFFF;
    --divider-color: #BDBDBD;
    --calendar-beginner: #C8E6C9;
    --calendar-medium: #A5D6A7;
    --calendar-advanced: #81C784;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Spectral', serif;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    position: relative;
    margin-bottom: 2rem;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

section {
    padding: 4rem 1rem;
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--secondary-text);
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

/* Wave Divider */
.wave-divider {
    position: relative;
    height: 150px;
    width: 100%;
    overflow: hidden;
}

.wave-divider svg {
    position: absolute;
    width: 100%;
    height: 100%;
    fill: var(--background-light);
}

.wave-divider.inverted svg {
    transform: rotate(180deg);
}

/* Header and Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Spectral', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Tooltip styles */
nav a[data-tooltip] {
    position: relative;
}

nav a[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: var(--background-dark);
    color: var(--white);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1;
}

nav a[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Hero Section */
.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    background-color: var(--white);
    position: relative;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-calendar {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calendar-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: center;
}

.calendar-body {
    padding: 1rem;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.calendar-day .day {
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.calendar-day .event {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.event.beginner {
    background-color: var(--calendar-beginner);
}

.event.medium {
    background-color: var(--calendar-medium);
}

.event.advanced {
    background-color: var(--calendar-advanced);
}

.calendar-footer {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    border-top: 1px solid var(--divider-color);
}

.level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.level-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.level-dot.beginner {
    background-color: var(--calendar-beginner);
}

.level-dot.medium {
    background-color: var(--calendar-medium);
}

.level-dot.advanced {
    background-color: var(--calendar-advanced);
}

/* Programs Section */
.programs {
    background-color: var(--background-light);
}

.comparison-table {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 3rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    background-color: var(--primary-color);
    color: var(--white);
}

.header-cell {
    flex: 1;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.header-cell:first-child {
    background-color: var(--background-dark);
}

.table-row {
    display: flex;
    border-bottom: 1px solid var(--divider-color);
}

.table-row:last-child {
    border-bottom: none;
}

.row-header {
    flex: 1;
    background-color: var(--primary-light);
    padding: 1rem;
    font-weight: 600;
}

.cell {
    flex: 1;
    padding: 1rem;
    text-align: center;
    background-color: var(--white);
}

.program-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.program-card {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.program-img {
    height: 200px;
    overflow: hidden;
}

.program-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.program-card:hover .program-img img {
    transform: scale(1.05);
}

.program-content {
    padding: 1.5rem;
}

.program-features {
    list-style: none;
    margin: 1.5rem 0;
}

.program-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

/* Calendar Section */
.full-calendar {
    background-color: var(--white);
}

.calendar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background-color: var(--white);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.full-calendar-grid {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.calendar-header-row {
    display: flex;
    background-color: var(--primary-color);
    color: var(--white);
}

.time-column, .day-column {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.time-column {
    width: 100px;
    background-color: var(--background-dark);
}

.day-column {
    flex: 1;
    min-width: 150px;
}

.calendar-content {
    display: flex;
    background-color: var(--white);
}

.time-slot {
    height: 100px;
    border-bottom: 1px solid var(--divider-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:last-child {
    border-bottom: none;
}

.calendar-event {
    height: 100px;
    border-bottom: 1px solid var(--divider-color);
    padding: 0.5rem;
    transition: var(--transition);
}

.calendar-event:last-child {
    border-bottom: none;
}

.calendar-event h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.calendar-event p {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin: 0;
}

.calendar-event.beginner {
    background-color: var(--calendar-beginner);
}

.calendar-event.medium {
    background-color: var(--calendar-medium);
}

.calendar-event.advanced {
    background-color: var(--calendar-advanced);
}

.calendar-event.empty {
    background-color: var(--white);
}

.calendar-event:not(.empty):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
    position: relative;
}

/* Success Stories Section */
.success-stories {
    background-color: var(--background-light);
}

.stories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.story-card {
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.story-image {
    height: 250px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-content {
    padding: 1.5rem;
    flex: 1;
}

.story-quote {
    font-style: italic;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.story-quote::before {
    content: '"';
    font-size: 2.5rem;
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-family: 'Spectral', serif;
    line-height: 1;
}

/* Gallery Section */
.community-gallery {
    background-color: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 250px;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1rem;
    color: var(--white);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Section */
.contact-section {
    background-color: var(--background-light);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item h4 {
    margin-bottom: 0.5rem;
}

.contact-form {
    flex: 2;
    min-width: 300px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--divider-color);
    border-radius: var(--border-radius);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
}

/* Footer */
footer {
    background-color: var(--background-dark);
    color: var(--white);
    padding: 3rem 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-block {
    grid-column: span 4;
}

.footer-logo {
    grid-row: 1;
    grid-column: 1 / 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo span {
    font-family: 'Spectral', serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0;
}

.footer-nav {
    grid-row: 1;
    grid-column: 5 / 9;
}

.footer-docs {
    grid-row: 2;
    grid-column: 3 / 7;
}

.footer-consult {
    grid-row: 1;
    grid-column: 9 / 13;
}

.footer-contact {
    grid-row: 2;
    grid-column: 7 / 11;
}

.footer-copyright {
    grid-row: 3;
    grid-column: 1 / 13;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-block h3 {
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-block h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-block ul {
    list-style: none;
}

.footer-block li {
    margin-bottom: 0.8rem;
}

.footer-block a {
    color: var(--white);
    opacity: 0.8;
    transition: var(--transition);
}

.footer-block a:hover {
    opacity: 1;
    color: var(--primary-light);
}

.specialists {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.specialist {
    padding: 0.8rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.specialist:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.specialist-name {
    font-weight: 600;
}

.specialist-pos {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-email {
    display: inline-block;
    color: var(--primary-light);
    font-weight: 500;
    margin-top: 0.5rem;
}

.footer-email:hover {
    color: var(--white);
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero {
        flex-direction: column;
        padding: 3rem 1rem;
    }
    
    .hero-content, .hero-calendar {
        flex: none;
        width: 100%;
    }
    
    .footer-block {
        grid-column: span 6;
    }
    
    .footer-logo, .footer-nav {
        grid-row: 1;
    }
    
    .footer-docs, .footer-consult {
        grid-row: 2;
    }
    
    .footer-contact, .footer-copyright {
        grid-row: 3;
    }
    
    .footer-contact {
        grid-column: 1 / 7;
    }
    
    .footer-copyright {
        grid-row: 4;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .calendar-header-row, .calendar-content {
        display: block;
        overflow-x: auto;
    }
    
    .calendar-header-row {
        display: flex;
    }
    
    .calendar-content {
        display: flex;
    }
    
    .time-column, .day-column {
        min-width: 120px;
    }
    
    .comparison-table {
        overflow-x: auto;
        display: block;
    }
    
    .table-header, .table-row {
        min-width: 600px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .footer-block {
        grid-column: span 12;
    }
    
    .footer-logo, .footer-nav, .footer-docs, .footer-consult, .footer-contact {
        grid-row: auto;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .program-cards {
        gap: 1.5rem;
    }
    
    .calendar-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .stories-grid {
        gap: 1.5rem;
    }
    
    .story-image {
        height: 200px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 375px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .logo svg {
        width: 40px;
        height: 40px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .story-image {
        height: 180px;
    }
    
    .gallery-item {
        height: 180px;
    }
    
    .info-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* CSS для формы */
.contact-form input,
.contact-form textarea,
.contact-form select {
    transition: var(--transition);
}

.contact-form input:hover,
.contact-form textarea:hover,
.contact-form select:hover {
    border-color: var(--primary-color);
}

.contact-form button[type="submit"] {
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    position: relative;
    overflow: hidden;
}

.contact-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.contact-form button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Микроанимация для ховер-эффектов кнопок */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.primary-btn:hover {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Дополнительные стили для волнистых разделителей */
.wave-divider {
    background-color: transparent;
}

.wave-divider svg path {
    transition: d 0.5s;
}

.wave-divider:hover svg path {
    d: path("M0,0 C100,30 200,70 300,50 C400,30 500,10 600,50 C700,90 800,70 900,50 C1000,30 1100,10 1200,50 L1200,120 L0,120 Z");
}

/* Фавикон */
@media (prefers-color-scheme: dark) {
    :root {
        --favicon-color: var(--primary-light);
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --favicon-color: var(--primary-color);
    }
}