/*
Theme Name: EAK Theme
Theme URI: https://example.com/eak-theme
Author: DG
Author URI: https://example.com
Description: Тема для сайта ЕАК с адаптивным дизайном на Bootstrap 5
Version: 2.0.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eak-theme
*/

/* ===== Bootstrap Variables Override ===== */
:root {
    --bs-body-font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bs-body-bg: #f8fafc;
    --bs-primary: #FF4757;
    --bs-secondary: #ffffff;
    --bs-border-color: #dee2e6;

    /* Кастомные цвета */
    --eak-red: #FF4757;
    --eak-dark-red: #8B0000;
    --eak-blue: #1e90ff;
    --eak-text: #4a5568;
    --eak-text-light: #718096;
    --eak-border: #e2e8f0;
    --eak-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== Base Styles ===== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--eak-text);
    line-height: 1.6;
    background-color: var(--bs-body-bg);
}

body {
    font-family: 'Roboto', sans-serif;
}

h1,
h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
}

h3 {
    font-family: 'Roboto', sans-serif;
}

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

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

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ===== Header Styles ===== */
.header {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: white;
}

.logo-wrapper img {
    max-height: 60px;
    width: auto;
}

/* ===== Navigation Styles ===== */
.navbar-collapse {
    justify-content: space-between;
}

.navbar-nav {
    flex: 1;
}

.navbar-nav>li:first-child .nav-link {
    padding-left: 0 !important;
}

.navbar-nav .nav-link {
    color: var(--eak-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .active>.nav-link {
    color: var(--eak-dark-red);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===== FIXED: Navigation Menu Styles - Решение проблемы с переносом пунктов ===== */
@media (min-width: 992px) {
    .navbar-nav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
    }
    
    .navbar-nav .nav-item {
        margin: 0 8px 5px 0;
        position: relative;
    }
    
    .navbar-nav .nav-link {
        /* УБРАЛ ОБРЕЗАНИЕ ТЕКСТА */
        white-space: normal;
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    /* Стили для Bootstrap dropdown меню */
    .dropdown-menu {
        position: absolute;
        min-width: 300px; /* Увеличил минимальную ширину */
        background: white;
        border: 1px solid var(--eak-border);
        border-radius: 4px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        padding: 0.5rem 0;
        display: block !important;
    }

    .dropdown:hover .dropdown-menu,
    .nav-item:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        display: block !important;
    }

    .dropdown-menu .dropdown-item {
        white-space: normal;
        padding: 0.6rem 1.2rem;
        display: block;
        width: 100%;
        color: var(--eak-text);
        border: none;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .dropdown-menu .dropdown-item:hover {
        background-color: #f8fafc;
        color: var(--eak-dark-red);
    }

    /* Убираем стандартные стили Bootstrap */
    .dropdown-menu[data-bs-popper] {
        margin-top: 0;
        left: 0;
    }
}

/* Для мобильного меню */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        white-space: normal;
    }
    
    .navbar-collapse {
        background: white;
        flex-direction: column;
    }

    /* Мобильные dropdown меню */
    .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        border: none;
        box-shadow: none;
        background-color: transparent;
        padding-left: 1.5rem;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-menu .dropdown-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    form.d-flex {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }
}

/* ===== Search Form Styles ===== */
form.d-flex {
    margin-left: auto;
    min-width: 200px;
}

form.d-flex .form-control {
    border-radius: 0.25rem;
    border: 1px solid var(--eak-border);
    padding: 0.375rem 0.75rem;
}

/* ===== Main Content ===== */
.site-main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

/* ===== News Block (Simplified) ===== */
.news-block {
    margin-bottom: 3rem;
}

.section-title {
    color: var(--eak-text);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.section-title::after {
    display: none;
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 80px;
    height: 3px;
    background: var(--eak-red);
    transform: translateX(-50%);
}

.news-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--eak-card-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.news-card .card-body {
    padding: 1.25rem;
    text-align: left;
}

.news-card .card-title {
    color: var(--eak-text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* ===== Buttons ===== */
.btn-eak-primary {
    background: linear-gradient(135deg, #FF6B6B 0%, var(--bs-primary) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-eak-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(255, 75, 87, 0.15);
    color: white;
}

/* ===== Updated Footer Styles ===== */
.footer {
    background: white;
    padding: 2rem 0;
    border-top: 2px solid var(--eak-blue);
    margin-top: auto;
}

.footer-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.footer-contacts,
.footer-social {
    flex: 1;
    min-width: 100px;
}

.footer-title {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.5rem;
    height: 2px;
    background: var(--eak-red);
}

.footer-links {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--eak-text);
    transition: all 0.2s ease;
}

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

.footer-bottom {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--eak-border);
}

.copyright {
    margin-bottom: 1rem;
    color: var(--eak-text-light);
    font-size: 0.875rem;
}

.legal-links a {
    color: var(--eak-text-light);
    font-size: 0.875rem;
    margin-left: 1rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-links a:hover {
    color: var(--eak-red);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-link img {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

.social-link:hover img {
    opacity: 0.8;
}

/* Адаптивность футера */
@media (max-width: 767.98px) {
    .footer-content-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-contacts,
    .footer-social {
        min-width: 100%;
    }

    .footer-title {
        margin-top: 1rem;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* ===== FAQ Page Styles ===== */
.eak-faq-container {
    padding: 0.5rem 0;
}

.eak-faq-title {
    color: var(--eak-text);
    text-align: left;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 0;
}

.eak-faq-title::after {
    display: none;
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 80px;
    height: 3px;
    background: var(--eak-red);
}

.eak-faq-accordion {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.eak-faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--eak-border);
    border-radius: 8px;
    overflow: hidden;
}

.eak-faq-question {
    width: 100%;
    padding: 1.25rem;
    text-align: left;
    background: var(--bs-secondary);
    color: var(--eak-text);
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eak-faq-question:hover {
    background: #f1f5f9;
    color: var(--eak-dark-red);
}

.eak-faq-icon {
    font-weight: bold;
    display: inline-block;
    width: 20px;
    text-align: center;
}

.eak-faq-answer {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid var(--eak-border);
    color: var(--eak-text-light);
    line-height: 1.6;
    text-align: left;
}

/* ===== Улучшенные стили аккордеона ===== */
.eak-accordion-container {
    margin: 2rem 0;
    position: relative;
}

.eak-accordion-group {
    margin-bottom: 2.5rem;
}

.accordion-group-title {
    color: var(--eak-text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--eak-blue);
    position: relative;
}

.eak-accordion-item {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: var(--eak-accordion-transition);
    border: 1px solid var(--eak-border);
}

.eak-accordion-item:hover {
    border-color: var(--eak-blue);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.1);
}

.eak-accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: white;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--eak-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--eak-accordion-transition);
    position: relative;
}

.eak-accordion-header:hover {
    background-color: #f8fafc;
}

.eak-accordion-header[aria-expanded="true"] {
    background-color: var(--eak-blue);
    color: white;
}

.eak-accordion-header[aria-expanded="true"] .eak-accordion-icon {
    color: white;
}

.eak-accordion-icon {
    margin-right: 12px;
    font-weight: bold;
    width: 20px;
    text-align: center;
    transition: var(--eak-accordion-transition);
    color: var(--eak-blue);
}

.eak-accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: var(--eak-accordion-transition);
    background-color: white;
}

.eak-accordion-content[aria-hidden="false"] {
    padding: 1.5rem;
    max-height: 5000px;
    border-top: 1px solid var(--eak-border);
}

.eak-accordion-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--eak-text-light);
}

.eak-accordion-content p:last-child {
    margin-bottom: 0;
}

/* Стили для временной шкалы внутри аккордеона */
.timeline-item {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    display: block;
    font-weight: 600;
    color: var(--eak-blue);
    margin-bottom: 0.5rem;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 991.98px) {
    .news-card .card-img-top {
        height: 180px;
    }
}

@media (max-width: 767.98px) {
    .logo-wrapper {
        text-align: center;
    }

    .news-card .card-img-top {
        height: 160px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .eak-faq-title {
        font-size: 1.5rem;
    }

    .legal-links a {
        margin-left: 0.5rem;
    }

    .social-links {
        gap: 0.75rem;
    }

    .eak-accordion-header {
        padding: 1rem;
        font-size: 1rem;
    }

    .eak-accordion-content[aria-hidden="false"] {
        padding: 1rem;
    }

    .accordion-group-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .news-card .card-img-top {
        height: 140px;
    }

    .news-card .card-title {
        font-size: 1rem;
    }

    .eak-faq-question {
        padding: 1rem;
        font-size: 1rem;
    }

    .eak-faq-answer {
        padding: 1rem;
    }

    .footer-links a {
        font-size: 0.9rem;
    }

    .eak-accordion-header {
        padding: 0.75rem;
    }

    .timeline-item {
        padding-left: 1rem;
    }
}

/* ===== WordPress Specific ===== */
.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100%;
    width: 100%;
}

.wp-block-image img {
    height: auto;
    max-width: 100%;
}

/* ===== Utility Classes ===== */
.rounded-top-0 {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.rounded-bottom-0 {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ===== IE11 Fixes ===== */
@media all and (-ms-high-contrast: none) {
    .gradient-btn {
        background: var(--eak-red) !important;
    }
}

.me-2 {
    margin-right: 0 !important;
}

/* News Page Styles */
.news-page-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
}

.years-sidebar {
    width: 130px;
    flex-shrink: 0;
}

.year-btn {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: none;
    text-align: left;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    text-decoration: none;
}

.year-btn {
    font-weight: bold;
}

.year-btn:hover,
.year-btn.active {
    border-left: 5px solid #ab2a2a;
}

.news-main-content {
    flex-grow: 1;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

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

.news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 15px;
}

.news-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
    display: block;
}

.news-title {
    font-size: 16px;
    line-height: 150%;
    margin: 0 0 10px 0;
    color: #333;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: #0056b3;
}

.news-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.page-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
}

@media (max-width: 768px) {
    .news-page-container {
        flex-direction: column;
    }

    .years-sidebar {
        width: 100%;
    }
}

/* Стили для страницы "О нас" */
.page-links-container {
    max-width: 800px;
    margin: 40px 0;
    padding: 0;
    width: 100%;
    float: none;
    clear: both;
}

.modern-link-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    display: block;
    width: 100%;
}

.modern-link-list li {
    margin: 0 0 12px 0;
    padding: 0;
    width: 100%;
}

.modern-link-list a {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--eak-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid var(--eak-blue);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.modern-link-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    color: var(--eak-blue);
    border-left-color: var(--eak-red);
}

.modern-link-list a::after {
    content: '→';
    margin-left: auto;
    color: var(--eak-blue);
    opacity: 0;
    transition: all 0.3s ease;
}

.modern-link-list a:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .modern-link-list a {
        padding: 15px 20px;
    }
}

/* Аккордеон в "Порядок регистрации" */
.eak-accordion-container {
    padding: 0;
    margin: 2rem 0;
}

.eak-accordion {
    background-color: transparent;
    box-shadow: none;
}

.eak-accordion-item {
    margin-bottom: 15px;
    border: 1px solid var(--eak-border);
    border-radius: 8px;
    background-color: transparent;
    overflow: hidden;
    transition: all 0.3s ease;
}

.eak-accordion-item:hover {
    border-color: var(--eak-blue);
}

.eak-accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: white;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--eak-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.eak-accordion-header:hover {
    background-color: #f8fafc;
    color: var(--eak-blue);
}

.eak-accordion-header.active {
    background-color: var(--eak-blue);
    color: white;
    border-radius: 8px 8px 0 0;
}

.eak-accordion-header.active .eak-accordion-icon {
    transform: rotate(45deg);
    color: white;
}

.eak-accordion-icon {
    font-size: 1.25rem;
    transition: all 0.3s ease;
    color: var(--eak-blue);
}

.eak-accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: white;
}

.eak-accordion-content.show {
    padding: 1.5rem;
    max-height: 5000px;
    border-top: 1px solid var(--eak-border);
    border-radius: 0 0 8px 8px;
}

.eak-accordion-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--eak-text-light);
}

.eak-accordion-content p:last-child {
    margin-bottom: 0;
}

/* Адаптивность */
@media (max-width: 767.98px) {
    .eak-accordion-header {
        padding: 1rem;
        font-size: 1rem;
    }

    .eak-accordion-content.show {
        padding: 1rem;
    }
}

.breadcrumbs {
    max-width: 1200px;
    margin: 0 0 1.5rem 0;
    margin-left: auto;
    margin-right: auto;  
}

.phone-numbers a {
    font-size: 16px;
    color: #333;
    line-height: 100%;
    white-space: nowrap;
}

.phone-numbers a:hover {
    color: #dc3545;
}

.stats-section {
    background: transparent;
    color: #333;
}

.stat-item {
    text-align: center;
    margin-bottom: 30px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    display: block;
    color: #333;
    text-shadow: none;
    line-height: 150%;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 400;
    color: #333;
    line-height: 1.4;
}

/* Одна строка на больших экранах */
@media (min-width: 992px) {
    .stat-item {
        margin-bottom: 0;
    }
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .stat-number {
        font-size: 2.5rem;
    }
    .stat-label {
        font-size: 1rem;
    }
    .stats-section {
        padding: 60px 0;
    }
}

.counter {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.counter.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Cookie Consent Banner */
.eak-cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: #fff;
    padding: 15px 0;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    font-family: 'Roboto', sans-serif;
}

.eak-cookie-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.eak-cookie-text {
    margin: 0 15px 10px 0;
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.eak-cookie-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eak-cookie-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.eak-cookie-btn-accept {
    background-color: #4CAF50;
    color: white;
}

.eak-cookie-btn-accept:hover {
    background-color: #3e8e41;
}

.eak-cookie-btn-reject {
    background-color: #f44336;
    color: white;
}

.eak-cookie-btn-reject:hover {
    background-color: #d32f2f;
}

.eak-cookie-link {
    color: #bbb;
    text-decoration: underline;
    font-size: 14px;
    white-space: nowrap;
}

.eak-cookie-link:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .eak-cookie-container {
        flex-direction: column;
        text-align: center;
    }
    
    .eak-cookie-text {
        margin: 0 0 15px 0;
    }
    
    .eak-cookie-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .eak-cookie-link {
        margin-top: 10px;
        white-space: normal;
    }
}