/* ========== СБРОС СТИЛЕЙ И БАЗОВЫЕ НАСТРОЙКИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #cfcfcf;
    background-image: 
        linear-gradient(rgba(124, 58, 237, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
}

/* ========== ШАПКА ========== */
header {
    background-color: #FFFFFF;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

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

.logo-link {
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.7;
}

.text-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.5px;
    margin: 0;
    cursor: pointer;
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.text-a {
    text-decoration: none;
    color: #000000;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    padding: 8px 0;
}

.text-a:hover {
    opacity: 0.7;
}

.text-a.active {
    color: #999999;
    font-weight: 400;
}

.text-a.active:hover {
    color: #000000;
}

#LK {
    background-color: #000000;
    color: #FFFFFF !important;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

#LK:hover {
    background-color: #333333;
    opacity: 1 !important;
    transform: translateY(-1px);
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
main {
    flex: 1;
    padding: 40px 20px;
}

.courses-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== ФИЛЬТРЫ ========== */
.filters-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #FFFFFF;
    border: 2px solid #000000;
    color: #000000;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    background-color: #000000;
    color: #FFFFFF;
}

.filter-btn.active {
    background-color: #000000;
    color: #FFFFFF;
}

/* ========== СЕТКА КУРСОВ ========== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    justify-items: center;
}

/* ========== КАРТОЧКИ КУРСОВ ========== */
.course-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.course-card.hidden {
    display: none;
}

/* Контейнер для изображения */
.course-image-wrapper {
    width: 100%;
    height: 250px;
    background-color: #E5E5E5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Реальное изображение */
.course-image-real {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет область, обрезая лишнее */
    transition: transform 0.3s;
}

.course-card:hover .course-image-real {
    transform: scale(1.05); /* Увеличение при наведении */
}

/* Заглушка, если картинки нет */
.course-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #c7f900;
    background-color: #E5E5E5;
}

/* Остальные стили карточки */
.course-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.topic-badge {
    background-color: transparent;
    border: 2px solid #000000;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.course-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 15px;
}

.course-content p {
    font-size: 15px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 44px;
}

.course-badges {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.badge {
    border: 1px solid #000000;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enroll-btn {
    background-color: #000000;
    color: #FFFFFF;
    border: none;
    padding: 16px 60px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 280px;
}

.enroll-btn:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.enroll-btn:active {
    transform: translateY(0);
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: #FFFFFF;
    border: 2px solid #000000;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    color: #000000;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 16px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-cancel {
    background-color: transparent;
    border: 2px solid #000000;
    color: #000000;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-cancel:hover {
    background-color: #F5F5F5;
}

.modal-start {
    background-color: #000000;
    border: none;
    color: #FFFFFF;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-start:hover {
    background-color: #333333;
    transform: translateY(-2px);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 900px) {
    .courses-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 20px;
    }
    
    .text-logo h1 {
        font-size: 22px;
    }
    
    .navbar ul {
        gap: 20px;
    }
    
    .text-a {
        font-size: 14px;
    }
    
    #LK {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .filters-container {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .course-content {
        padding: 25px;
    }
    
    .course-content h2 {
        font-size: 20px;
    }
    
    .course-content p {
        font-size: 14px;
    }
    
    .badge {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .enroll-btn {
        padding: 14px 50px;
        font-size: 15px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-cancel,
    .modal-start {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .navbar ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .course-image {
        height: 200px;
    }
    
    .course-content {
        padding: 20px;
    }
    
.enroll-btn {
        padding: 14px 40px;
        font-size: 14px;
        max-width: 100%;
    }
}

/* Глитч-эффект для заголовков */
.course-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s;
}

.course-content h2:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #7C3AED;
}

.course-content h2:hover::before,
.course-content h2:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.course-content h2:hover::before {
    animation: glitch-top 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #7C3AED;
    z-index: -1;
    clip: rect(0, 900px, 0, 0);
}

.course-content h2:hover::after {
    animation: glitch-bottom 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #000000;
    z-index: -2;
    clip: rect(0, 900px, 0, 0);
}

