/* ==================== */
/* VARIABLES & RESET */
/* ==================== */
:root {
    --primary-color: #FF6B00;
    --primary-dark: #E05D00;
    --primary-light: #FF8C42;
    --secondary-color: #333333;
    --light-gray: #F5F5F5;
    --white: #FFFFFF;
    --text-color: #444444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Raleway', sans-serif;
}

body {
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.3);
}

/* ==================== */
/* TYPOGRAPHY & FONTS */
/* ==================== */
@font-face {
    font-family: 'Raleway';
    src: url('/static/fonts/Raleway-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Caveat';
    src: url('/static/fonts/Caveat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

.page-header {
    text-align: center;
    margin: 1.6em;
}

.page-header h1 {
    font-size: 36px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.page-header h1:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* ==================== */
/* HEADER & NAVIGATION */
/* ==================== */
.header-top {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 10px 0;
    font-size: 14px;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.contact-info {
    display: flex;
    gap: 20px;
}

.contact-info a {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-info a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--white);
    font-size: 18px;
}

.social-links a:hover {
    color: var(--primary-light);
}

.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Main Navigation */
.nav-container {
    display: flex;
    align-items: center;
}

.main-nav {
    display: flex;
}

.main-nav > ul {
    display: flex;
    list-style: none;
}

.main-nav > ul > li {
    position: relative;
    padding: 10px 15px;
}

.main-nav > ul > li > a {
    color: var(--secondary-color);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
}

.main-nav > ul > li > a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav > ul > li > a:hover:after {
    width: 100%;
}

.main-nav > ul > li:hover > a {
    color: var(--primary-color);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.main-nav > ul > li:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.dropdown li a {
    color: var(--secondary-color);
    display: block;
}

.dropdown li:hover a {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
}

/* ==================== */
/* BANNER & HERO */
/* ==================== */
.banner-slider {
    position: relative;
}

.banner-slide {
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 120px 0;
    text-align: center;
    position: relative;
}

.banner-slide:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.banner-slide h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.banner-slide p {
    font-size: 20px;
    margin-bottom: 30px;
}

/* ==================== */
/* CONTENT SECTIONS */
/* ==================== */
.content-page {
    padding: 60px 0;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-content p {
    margin-bottom: 20px;
}

/* ==================== */
/* TEACHERS SECTION */
/* ==================== */
.teachers-section {
    padding: 60px 0;
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.teacher-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.teacher-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.teacher-img {
    height: 250px;
    overflow: hidden;
    background: linear-gradient(223.56deg, #FFB800 1.55%, #FFDD89 26.2%, #FFEDCD 60.11%, #FFDD89 89.28%, #FFB800 107.5%);
}

.teacher-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.teacher-card:hover .teacher-img img {
    transform: scale(1.1);
}

.teacher-info {
    padding: 20px;
    text-align: center;
}

.teacher-info h3 {
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.teacher-info p {
    color: var(--primary-color);
    font-weight: 600;
}

/* Teacher Single Page */

.teacher-profile {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 70vh;
    padding: 2.5em 0.5em;
    background-image:
        url("/static/images/bg-tutor.png"),
        radial-gradient(97.8% 97.8% at 50% 50%, #FFF4E0 24.64%, #FFB800 71.63%, #F4B66B 100%);
    background-size: cover, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    color: #000000;
}

.tutor-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2em;
    align-items: center;
}

.tutor-photo {
    width: 40%;
    max-width: 400px;
    max-height: 400px;
    aspect-ratio: 1 / 1;
    border-radius: 25px;
    background: linear-gradient(223.56deg, #FFB800 1.55%, #FFDD89 26.2%, #FFEDCD 60.11%, #FFDD89 89.28%, #FFB800 107.5%);
}

.tutor-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 25px;
}

.tutor-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Это можно изменить на 'space-around' или 'space-evenly' для равных отступов */
    width: 60%;
    height: 100%;
    max-height: 400px;
    min-height: 400px;
    gap: 0.5em; /* Устанавливаем равные отступы между элементами */
}

.tutor-name {
    font-family: "Raleway", sans-serif;
    font-size: 2.5em;
    font-weight: bold;
}

.tutor-description {
    font-family: "Raleway", sans-serif;
    font-weight: 600;
    font-size: 1.3em;
    color: #000000;
    margin: 0;
}

.tutor-blockquote > p {
    font-size: 1.7em;
    color: #F68932;
    font-family: "Caveat", cursive;
    font-weight: 200;
    line-height: 1;
}

.tutor-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2em;
}

.feature-title {
    font-family: "Raleway", sans-serif;
    font-size: 26px;
    font-weight: bold;
    line-height: 0.9;
    vertical-align: baseline;
}

.feature-description {
    font-family: "Raleway", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 0.9;
    vertical-align: baseline;
}

.tutor-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #F68932;
    color: white;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tutor-button:hover {
    background-color: #d5762d;
    color: #fff;
}

/* ====================== */
/* TUTOR PROGRAMS SECTION */
/* ====================== */

.programs-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.programs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    align-items: stretch; /* Все карточки одной высоты */
}

.program-card {
    position: relative;
    flex: 1 1 330px; /* Минимальная ширина 330px, адаптивно расширяется */
    max-width: 360px;
    min-height: 280px;
    background: #FFFFFF;
    box-shadow: 0px 6px 10px 7px rgba(218, 122, 46, 0.15);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.program-number {
    position: absolute;
    bottom: -16px;
    right: 10px;
    font-family: 'Impact', sans-serif;
    font-size: 11rem;
    line-height: 1;
    letter-spacing: 0.015em;
    color: #FFF4E0;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.program-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.program-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1.2;
    letter-spacing: 0.015em;
    color: #000000;
    margin: 0;
}

.program-subject {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.4;
    color: #000000;
    margin: 0;
}

.program-details {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #000000;
}

.program-details strong {
    font-weight: 700;
    color: #F68932;
}


/* ==================== */
/* CERTIFICATES SECTION */
/* ==================== */
.certificates-section {
    margin: 1em 0 3em 0;
}

.certificates-title {
    text-align: center;
    margin-bottom: 40px;
}

.certificates-title h2 {
    font-size: 28px;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
}

.certificates-title h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

.certificates-title-wrapper {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 30px;
}

.certificates-title {
    font-size: 28px;
    font-weight: 900;
    color: #000;
}

.certificates-arrows {
    display: flex;
    gap: 12px;
}

.cert-arrow {
    width: 42px;
    height: 42px;
    border-radius: 30px;
    border: 1px solid #AFB0BE;
    background-color: white;
    font-size: 24px;
    line-height: 1;
    text-align: center;
    color: #AFB0BE;
    cursor: pointer;
    transition: 0.3s ease;
}

.cert-arrow.active {
    border-color: #F68932;
    color: #F68932;
    opacity: 1;
    cursor: pointer;
}

.cert-arrow:hover.active {
    background-color: #f1f1f1;
}

/* Карусель */
.certificates-carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.certificates-carousel {
    display: flex;
    gap: 14px;
    transition: transform 0.4s ease-in-out;

    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.certificates-carousel::-webkit-scrollbar {
    display: none;
}

.certificate-slide {
    width: 40%;
    min-width: 300px;
    height: 220px;
    max-height: 250px;
    flex-shrink: 0;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.certificate-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
    .certificate-slide {
        min-width: 85%;
    }
}

/* ========== */
/* TUTOR FORM */
/* ========== */

.enroll-banner {
    position: relative;
    background: url('/static/images/enroll-bg.jpg') center/cover no-repeat;
    height: 244px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4em;
}

.enroll-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 244px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.enroll-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 1em;
}

.enroll-content h2 {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 36px;
    margin-bottom: 10px;
}

.enroll-content p {
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
    margin-bottom: 20px;
}

.enroll-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.enroll-form input[type="text"] {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #F68932;
    border-radius: 30px;
    padding: 20px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    min-width: 250px;
    flex: 1;
}

.enroll-form button {
    background: #F68932;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.075em;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    min-width: 233px;
}

.enroll-form button:hover {
    background-color: #e3771e;
}

/* ==================== */
/* FILTERS & PAGINATION */
/* ==================== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--light-gray);
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.filter-btn:hover, 
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #FF6B00;
    color: white;
    border-color: #FF6B00;
}

.pagination .current {
    background-color: #FF6B00;
    color: white;
    border-color: #FF6B00;
    font-weight: bold;
}

.pagination .disabled {
    color: #aaa;
    pointer-events: none;
    cursor: default;
}

/* ==================== */
/* FOOTER */
/* ==================== */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: var(--white);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-list i {
    color: var(--primary-color);
    margin-top: 3px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #aaa;
}

/* ==================== */
/* RESPONSIVE STYLES */
/* ==================== */
@media (max-width: 992px) {

    .header-top .container {
        flex-direction: column;
        gap: 10px;
    }

    .contact-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--white);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        z-index: 1001;
        padding: 20px;
        overflow-y: auto;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav > ul {
        flex-direction: column;
    }

    .main-nav > ul > li {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        display: none;
        margin-top: 10px;
        margin-left: 15px;
    }

    .main-nav > ul > li:hover .dropdown {
        display: block;
    }

    .teacher-profile {
        max-height: none;
        padding: 1.5em 1em; /* Изменено на 1em для лучшей адаптивности */
    }
    .tutor-card {
        flex-direction: column; /* Изменено на колонку для меньших экранов */
        align-items: center; /* Центрируем элементы */
        padding: 1.5em;
    }
    .tutor-photo {
        max-width: 300px;
        margin: 1em auto;
    }
    .tutor-info {
        width: 100%;
    }
    .tutor-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .banner h1 {
        font-size: 36px;
    }

    .banner p {
        font-size: 18px;
    }

    /* Teachers grid adjustments */
    .teacher-profile {
        padding: 1em 0.5em;
    }

    .tutor-card {
        flex-direction: column;
        padding: 1em;
    }

    .tutor-photo {
        width: 100%;
        max-width: 250px;
        aspect-ratio: 1 / 1;
        margin-bottom: 1em;
    }

    .tutor-info {
        width: 100%;
        max-height: none;
        min-height: auto;
        padding: 0;
    }

    .tutor-name {
        font-size: 1.8em;
        text-align: center;
    }

    .tutor-blockquote > p {
        font-size: 1.3em;
        text-align: center;
    }

    .tutor-description {
        font-size: 1.1em;
        text-align: justify;
    }

    .tutor-features {
        grid-template-columns: 1fr;
        gap: 0.8em;
    }

    .feature-title {
        font-size: 20px;
        line-height: 1.1;
    }

    .feature-description {
        font-size: 14px;
        line-height: 1.2;
    }

    .tutor-button {
        display: inline-block;
        width: 100%;
        text-align: center;
        margin-top: 1em;
        padding: 12px 0;
        font-size: 1em;
        border-radius: 25px;
    }

    /* Certificates grid adjustments */
    .certificates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .certificate-item {
        height: 300px;
    }

    .certificate-img {
        height: 250px;
    }
    .enroll-banner {
        height: auto;
        padding: 2em 1em;
        margin-top: 2em;
        flex-direction: column;
        text-align: center;
    }

    .enroll-overlay {
        height: 100%;
    }

    .enroll-content h2 {
        font-size: 28px;
    }

    .enroll-content p {
        font-size: 18px;
    }

    .enroll-form {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .enroll-form input[type="text"],
    .enroll-form button {
        width: 100%;
        min-width: unset;
    }

    .enroll-form button {
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .banner {
        padding: 60px 0;
    }

    .banner h1 {
        font-size: 28px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .btn {
        padding: 10px 20px;
    }

    .filters {
        justify-content: center;
    }

    /* Pagination adjustments */
    .pagination a,
    .pagination span {
        padding: 6px 12px;
        margin: 0 3px;
    }

    /* Single column layout for teachers on small screens */
    .teachers-grid {
        grid-template-columns: 1fr;
    }

    .teacher-profile {
        background-image:
        url("/static/images/bg-tutor.png"),
        radial-gradient(97.8% 97.8% at 50% 50%, #FFF4E0 24.64%, #FFB800 71.63%, #F4B66B 100%);
        padding: 1em 0;
    }

    .tutor-card {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 1em;
    }

    .tutor-photo {
        max-width: 250px;
        border-radius: 30px;
    }

    .tutor-photo img {
        border-radius: 30px;
    }

    .tutor-name {
        font-size: 1.8em;
    }
    .tutor-photo {
        max-width: 250px;
    }
    .tutor-button {
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    .tutor-features {
        grid-template-columns: 1fr;
        gap: 1em;
    }

    .feature-block {
        padding: 0.8em;
        text-align: center;
    }

    .feature-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .feature-description {
        font-size: 14px;
        line-height: 1.3;
        display: block;
    }

    .tutor-button {
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    /* Smaller pagination items */
    .pagination a,
    .pagination span {
        padding: 4px 8px;
        margin: 0 2px;
    }
}

@media (max-width: 480px) {
    .enroll-content h2 {
        font-size: 24px;
    }

    .enroll-content p {
        font-size: 16px;
    }

    .enroll-form input[type="text"] {
        font-size: 13px;
        padding: 16px;
    }

    .enroll-form button {
        font-size: 15px;
        padding: 14px 20px;
    }
}