/* Landing page styles */
:root {
    --primary-color: #5B9BD5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #fff;
    --dark-color: #383a3f;
    --header-height: 60px;
}

/* Скрываем блок promo на лендинг-страницах */
body:not(.is-cpanel) .promo {
    display: none !important;
}

/* Стили для позиций страницы */
.landing-container {
    margin-top: 0;
    padding-top: 0;
    overflow-x: hidden; /* слайдер не вываливается при первой загрузке (100vw / full_page) */
}
/* Чтобы слайдер «во всю страницу» не обрезался */
.landing-container:has(.slider-fullpage-wrapper) {
    overflow-x: visible;
}
.page-position:has(.slider-fullpage-wrapper) .container,
.page-position:has(.slider-fullpage-wrapper) .row,
.page-position:has(.slider-fullpage-wrapper) [class^="col-"] {
    overflow-x: visible;
}

.page-position {
    margin-bottom: 2rem;
}

.page-position-first {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 2rem;
}

.page-position-first .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Контент-блоки: карточки как на макете (тёмная тема, иконка сверху, заголовок, описание) */
.module-content-block .content-block {
    height: 100%;
    min-height: 220px;
    background: #2d2f33;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.module-content-block .content-block:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.module-content-block .content-block-media {
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}
.module-content-block .content-block-img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}
.module-content-block .content-block-body {
    flex: 1;
    text-align: center;
}
.module-content-block .content-block-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.module-content-block .content-block-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #9ca3af;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Макет 2: контент сверху, изображение снизу */
.content-block-layout-2 .content-block-media {
    margin-bottom: 0;
    margin-top: 1.25rem;
    order: 2;
}
.content-block-layout-2 .content-block-body {
    order: 1;
}

/* Макеты 3 и 4: изображение и контент в ряд */
.content-block-layout-3 .content-block-row,
.content-block-layout-4 .content-block-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    text-align: left;
}
.content-block-layout-3 .content-block-media,
.content-block-layout-4 .content-block-media {
    margin-bottom: 0;
    flex-shrink: 0;
}
.content-block-layout-3 .content-block-img,
.content-block-layout-4 .content-block-img {
    max-height: 64px;
}
.content-block-layout-3 .content-block-body,
.content-block-layout-4 .content-block-body {
    text-align: left;
    flex: 1;
}
.content-block-layout-4 .content-block-row {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .content-block-layout-3 .content-block-row,
    .content-block-layout-4 .content-block-row {
        flex-direction: column;
        text-align: center;
    }
    .content-block-layout-3 .content-block-body,
    .content-block-layout-4 .content-block-body {
        text-align: center;
    }
}

/* Мобильная адаптация контент-блоков: 3 в ряд. Сетка только для строк с контент-блоками */
@media (max-width: 576px) {
    .page-position .row:has(.module-content-block) {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        margin-left: 0;
        margin-right: 0;
    }
    .page-position .row:has(.module-content-block) > [class*="col-"] {
        max-width: none !important;
        flex: none !important;
        padding-left: 0;
        padding-right: 0;
        min-width: 0;
    }
    .module-content-block .content-block {
        padding: 0.65rem 0.5rem;
        border-radius: 10px;
        min-width: 0;
        overflow: hidden;
    }
    .module-content-block {
        min-width: 0;
    }
    .module-content-block .content-block-media {
        margin-bottom: 0.4rem;
    }
    .module-content-block .content-block-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }
    .module-content-block .content-block-text {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    .module-content-block .content-block-img {
        max-height: 40px;
    }
}

/* Переопределяем стили базового шаблона для главной страницы */
body:not(.is-cpanel) section.content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body:not(.is-cpanel) .content-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: white;
}

/* Layout container */
.layout-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Убираем просветы в футере для лендинг-страниц */
body:not(.is-cpanel) .footer {
    height: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
}

/* Header styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    /* background-color задается через настройки цветовой схемы в base.html */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 100%;
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo styles */
.logo {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Navigation styles */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-list li {
    position: relative;
}

.nav-list a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-list a:hover {
    color: var(--primary-color);
}

.nav-list a:hover::after {
    width: 100%;
}

.nav-list a.active {
    color: var(--primary-color);
}

.nav-list a.active::after {
    width: 100%;
}

/* Header right content */
.header-right-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Blog search in header */
.blog-header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-search-toggle {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    color: var(--dark-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

.blog-search-toggle:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.blog-search-expandable {
    position: absolute;
    top: 50px;
    right: 0;
    width: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.blog-search-expandable.active {
    width: 350px;
    opacity: 1;
    visibility: visible;
}

.blog-search-form {
    display: flex;
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.blog-search-form input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.blog-search-form input::placeholder {
    color: #999;
}

.blog-search-submit {
    background: var(--primary-color);
    border: none;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-search-submit:hover {
    background: #4a8bc4;
}

/* Inline search form in header center */
.blog-search-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.blog-search-form-inline {
    display: flex;
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 25px;
    box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
    overflow: hidden;
    border: 1px solid var(--primary-color);
}

.blog-search-form-inline input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.blog-search-form-inline input::placeholder {
    color: #999;
}

.blog-search-submit-inline {
    background: var(--primary-color);
    border: none;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-search-submit-inline:hover {
    background: #4a8bc4;
}

/* Search results dropdown */
.blog-search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.blog-search-results.has-results {
    display: block;
}

.blog-search-results-list {
    padding: 0;
    margin: 0;
}

.blog-search-result-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--dark-color);
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.blog-search-result-item:last-child {
    border-bottom: none;
}

.blog-search-result-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: var(--dark-color);
}

.blog-search-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.blog-search-result-excerpt {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 4px;
    line-height: 1.4;
}

.blog-search-result-date {
    font-size: 0.75rem;
    color: #999;
}

.blog-search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Auth buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons .btn {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
    border-width: 1px !important;
    border-color: #5b9bd5 !important;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    -webkit-box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
    -moz-box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
    box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color) !important;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Features section */
.features {
    padding: 4rem 0;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Courses section */
.courses {
    padding: 4rem 0;
    background-color: var(--light-color);
}

.course-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-card img {
    height: 200px;
    object-fit: cover;
}

/* Testimonials section */
.testimonials {
    padding: 4rem 0;
}

.testimonial-card {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* Main content */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
    padding: 0;
}

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

/* Для главной страницы убираем отступы сверху у контента */
body:not(.is-cpanel) .content-container {
    padding-top: 0;
}

/* Footer styles */
.footer-main {
    width: 100%;
    margin: 0;
    padding: 2rem 0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    /* background-color задается через настройки цветовой схемы в base.html */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
}

.footer-column {
    padding: 0 1rem;
}

.footer-column h3 {
    color: var(--dark-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.8rem;
}

.footer-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: fit-content;
    align-items: flex-end;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--light-color);
    color: var(--dark-color);
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
    min-width: 160px;
    -webkit-box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
    -moz-box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
    box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
}

.btn-social:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-social i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.sidebar {
    display: none;
}

/* Переопределяем стили футера для лендинг-страниц */
body:not(.is-cpanel) .footer {
    height: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
}

/* Responsive footer */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 1rem;
    }
}

@media (max-width: 576px) {
    .footer-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .footer {
        padding: 2rem 0;
    }
    
    .footer-column {
        text-align: center;
        padding: 0;
    }
    
    .social-buttons {
        align-items: center;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .nav-list.active {
        display: flex;
    }

    .auth-buttons {
        gap: 0.5rem;
    }

    .auth-buttons .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .header-container {
        padding: 0 0.5rem;
    }

    .blog-search-expandable.active {
        width: 280px;
    }
    
    .header-right {
        gap: 0.5rem;
    }
}

.footer-copyright {
    width: 100%;
    text-align: start;
    padding: 1.5rem 2rem;
    margin: 0;
    border-top: 1px solid rgba(0,0,0,0.1);
    /* background-color задается через настройки цветовой схемы в base.html */
}

.footer-copyright p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .header-container,
    .content-container,
    .footer-container,
    .footer-copyright p {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Auth pages styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: start;
    min-height: calc(100vh - var(--header-height));
    padding: 0rem 1rem;
    background: #fff;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h3 {
    color: var(--dark-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 0;
}

.auth-body {
    width: 100%;
}

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--primary-color);
    width: 16px;
}

.form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    position: relative;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.1);
    background: white;
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

.form-check-label {
    color: var(--dark-color);
    font-weight: 500;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    border: none;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(91, 155, 213, 0.3);
    color: white;
    background: #4a8bc4;
}

.auth-links {
    margin-top: 2rem;
    text-align: center;
}

.forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.forgot-password:hover {
    color: var(--info-color);
    background: rgba(91, 155, 213, 0.1);
    text-decoration: none;
}

.register-link {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.register-link span {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive design for auth */
@media (max-width: 576px) {
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .auth-header h3 {
        font-size: 1.75rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
        font-size: 0.95rem;
    }
    
    .btn-login {
        padding: 0.875rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }
    
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .auth-logo-img {
        height: 50px;
    }
}

/* Error messages styling */
.auth-body .errorlist {
    color: #dc3545;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

