/* ============================================================================
   Полный автономный CSS для расписания курсов ДПО — ТУ УГМК
   С улучшенными hover-эффектами для интерактивности
   ============================================================================ */

/* === Сброс и базовые настройки === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-width: 375px;
}

body {
    min-height: 100%;
    font-family: 'OpenSans', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6111111111;
    color: #303030;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    text-decoration: none;
    color: #333ef9;
}

ul, ol {
    margin-left: 20px;
}
ul li {
    list-style: disc;
}

img {
    vertical-align: top;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}
img:hover {
    transform: scale(1.02);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: inherit;
    font-size: inherit;
}

/* === Шрифты === */
@font-face {
    font-family: 'OpenSans';
    src: url('/icon/OpenSans-Regular.woff2') format('woff2'),
         url('/icon/OpenSans-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSans';
    src: url('/icon/OpenSans-Bold.woff2') format('woff2'),
         url('/icon/OpenSans-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'icons';
    src: url('/icon/icons.woff2') format('woff2'),
         url('/icon/icons.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === Иконки === */
[class*="_icon-"]:before {
    font-family: "icons" !important;
    font-style: normal;
    font-weight: normal;
    speak: never;
    display: inline-block;
    text-decoration: inherit;
    text-align: center;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

._icon-sdo:before { content: "\e917"; }

/* === Макет === */
.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wrapper > main {
    flex: 1 1 auto;
    min-width: 0;
}

[class*="__container"] {
    max-width: 91.875rem;
    margin: 0 auto;
    padding: 0 15px;
}

/* === Header (шапка) === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 27px 0;
    z-index: 149;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.header:hover {
    box-shadow: 0 4px 20px rgba(51, 62, 249, 0.15);
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    max-width: 91.875rem;
    margin: 0 auto;
    padding: 0 15px;
}

.logo img {
    height: 3.4375rem;
    transition: transform 0.3s ease, filter 0.3s ease;
}
.logo:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(51, 62, 249, 0.3));
}

.header__title {
    font-size: 2.25rem;
    font-weight: bold;
    color: #333ef9;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: default;
}
.header__title:hover {
    color: #2a2ec9;
    text-shadow: 0 2px 4px rgba(51, 62, 249, 0.3);
}

@media (max-width: 768px) {
    .header__title {
        font-size: 1.5rem;
        white-space: normal;
    }
    .header__container {
        gap: 12px;
    }
}

/* === Основной контент === */
.page-section {
    padding: 80px 0 40px;
}
.page-section__container {
    max-width: 91.875rem;
    margin: 0 auto;
    padding: 0 15px;
}

/* === Переключатели вида + Switch Toggle === */
.view-toggle {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.view-toggle button {
    padding: 0.5rem 1.2rem;
    border: 2px solid #333ef9;
    background: #fff;
    color: #333ef9;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.view-toggle button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(51, 62, 249, 0.1), transparent);
    transition: left 0.5s ease;
}

.view-toggle button:hover::before {
    left: 100%;
}

.view-toggle button:hover {
    background: #333ef9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 62, 249, 0.4);
}

.view-toggle button:active {
    transform: translateY(0);
}

.view-toggle button.active {
    background: #333ef9;
    color: white;
    box-shadow: 0 4px 12px rgba(51, 62, 249, 0.4);
}

/* === Switch Toggle для "Только актуальные" === */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-left: 1rem;
    border-left: 1px solid #dee2e6;
}

.toggle-label {
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #6c757d;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #333ef9;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 26px;
}

.slider.round:before {
    border-radius: 50%;
}

.switch:hover .slider {
    box-shadow: 0 2px 8px rgba(51, 62, 249, 0.3);
}

/* Адаптив для переключателей */
@media (max-width: 768px) {
    .view-toggle {
        justify-content: center;
    }
    .toggle-wrapper {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
}

/* === Фильтры и сортировка === */
.filters-sort-block {
    margin: 1rem 0;
    background: #fff;
    padding: 1.3rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    align-items: end;
    transition: all 0.3s ease;
}

.filters-sort-block:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.filter-group label {
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
    transition: color 0.3s ease;
}

.filter-group:hover label {
    color: #333ef9;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    background: #fff;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #333ef9;
    box-shadow: 0 0 0 3px rgba(51, 62, 249, 0.1);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #333ef9;
    box-shadow: 0 0 0 3px rgba(51, 62, 249, 0.2);
}

@media (max-width: 768px) {
    .filters-sort-block {
        flex-direction: column;
    }
    .filter-group {
        min-width: 100%;
    }
}

/* === Таблицы === */
.courses-table-container {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
}

.courses-table th,
.courses-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.courses-table th {
    background: linear-gradient(135deg, #efefef 0%, #e0e0e0 100%);
    font-weight: bold;
    color: #333;
}

.courses-table tr {
    transition: all 0.2s ease;
}

.courses-table tr:hover {
    background: linear-gradient(90deg, #e8edff 0%, #f0f4ff 100%);
    transform: scale(1.005);
}

.courses-table tr:hover td {
    border-color: #333ef9;
}

.courses-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.courses-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, #e8edff 0%, #f0f4ff 100%);
}

/* === Экспорт (под таблицей) === */
.export-buttons {
    margin: 1rem 0;
    text-align: right;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.export-buttons a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.export-buttons a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.export-buttons a:hover::before {
    width: 300px;
    height: 300px;
}

.export-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.export-buttons a:active {
    transform: translateY(-1px);
}

/* === Календарь === */
.calendar-view {
    margin-top: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.calendar-view:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #303030;
}

.calendar-header button {
    background: transparent;
    border: 2px solid #333ef9;
    color: #333ef9;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background: #333ef9;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(51, 62, 249, 0.4);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.calendar-day-header {
    font-weight: bold;
    padding: 0.3rem;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    font-size: 0.9rem;
    color: #333;
}

.calendar-day {
    min-height: 80px;
    padding: 0.2rem;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.2s ease;
    cursor: default;
}

.calendar-day:hover {
    border-color: #333ef9;
    background: #f8faff;
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(51, 62, 249, 0.2);
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.other-month:hover {
    background: #e9ecef;
}

.calendar-day-number {
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
    transition: all 0.2s ease;
}

.calendar-day:hover .calendar-day-number {
    color: #333ef9;
}

.calendar-event {
    display: block;
    background: linear-gradient(90deg, #e7f3ff 0%, #d0e6ff 100%);
    border-left: 3px solid #333ef9;
    padding: 0.2rem 0.3rem;
    margin: 0.1rem 0;
    text-align: left;
    font-size: 0.8rem;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333ef9;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.calendar-event:hover {
    background: linear-gradient(90deg, #333ef9 0%, #2a2ec9 100%);
    color: white;
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(51, 62, 249, 0.4);
    text-decoration: none;
}

/* === Список курсов === */
.course-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #333ef9 0%, #2a2ec9 100%);
    transition: height 0.3s ease;
}

.course-card:hover::before {
    height: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(51, 62, 249, 0.2);
    border-color: #333ef9;
}

.course-card a {
    transition: all 0.2s ease;
}

.course-card a:hover {
    color: #2a2ec9 !important;
    text-decoration: underline !important;
}

/* === СТАТУСЫ КУРСОВ (3 варианта) === */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: default;
}

/* 🟦 Подача заявок */
.status-badge.applying {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e6ff 100%);
    color: #333ef9;
    border: 1px solid #333ef9;
}

.status-badge.applying:hover {
    background: linear-gradient(135deg, #333ef9 0%, #2a2ec9 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(51, 62, 249, 0.4);
}

/* ⬜ Набор завершен */
.status-badge.closed {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.status-badge.closed:hover {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.4);
}

/* ⬛ Обучение завершено */
.status-badge.finished {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    border: 1px solid #adb5bd;
}

.status-badge.finished:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(73, 80, 87, 0.4);
}

/* === Формы и уведомления === */
.feedback__container .errortext {
    display: inline-block;
    color: #fdd9d9 !important;
    background-color: #ffe6e6;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 0 0 10px 0;
    font-size: 0.9em;
    border: 1px solid #ffcccc;
}

.imgcaptcha .form-feedback__button {
    padding: 2.5px 25px !important;
    background: linear-gradient(135deg, #333ef9 0%, #2a2ec9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(51, 62, 249, 0.3);
}

.imgcaptcha .form-feedback__button:hover {
    background: linear-gradient(135deg, #2a2ec9 0%, #1f23a0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 62, 249, 0.5);
}

.imgcaptcha .form-feedback__button:active {
    transform: translateY(0);
}

/* === Ссылки в тексте === */
.info-detailed-news__text a,
.news-detail a {
    color: #333ef9;
    text-decoration: underline;
    position: relative;
    transition: all 0.2s ease;
}

.info-detailed-news__text a::after,
.news-detail a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #333ef9;
    transition: width 0.3s ease;
}

.info-detailed-news__text a:hover::after,
.news-detail a:hover::after {
    width: 100%;
}

.info-detailed-news__text a:hover,
.news-detail a:hover {
    color: #2a2ec9;
    text-decoration: none;
}

/* === Пагинация === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.9rem;
    border: 2px solid #dee2e6;
    text-decoration: none;
    color: #333ef9;
    background: #fff;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(51, 62, 249, 0.1), transparent);
    transition: left 0.5s ease;
}

.pagination a:hover::before {
    left: 100%;
}

.pagination a:hover {
    background: #333ef9;
    color: white;
    border-color: #333ef9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 62, 249, 0.4);
}

.pagination .current {
    background: linear-gradient(135deg, #333ef9 0%, #2a2ec9 100%);
    color: white;
    font-weight: bold;
    border-color: #333ef9;
    box-shadow: 0 2px 8px rgba(51, 62, 249, 0.3);
}

/* === Footer === */
.footer {
    background: linear-gradient(135deg, #333ef9 0%, #2a2ec9 100%);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
    transition: all 0.3s ease;
}

.footer:hover {
    background: linear-gradient(135deg, #2a2ec9 0%, #1f23a0 100%);
    box-shadow: 0 -4px 20px rgba(51, 62, 249, 0.3);
}

/* === Дополнительные утилиты === */
.back-link {
    display: inline-block;
    margin: 1rem 0;
    color: #333ef9;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.back-link::before {
    content: '←';
    margin-right: 0.3rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.back-link:hover {
    background: #e7f3ff;
    color: #2a2ec9;
    padding-left: 0.8rem;
}

.back-link:hover::before {
    transform: translateX(-3px);
}

.field-row {
    display: flex;
    margin: 0.8rem 0;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.field-row:hover {
    background: #f8faff;
}

.field-label {
    font-weight: bold;
    min-width: 220px;
    color: #333;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.field-row:hover .field-label {
    color: #333ef9;
}

.field-value {
    flex: 1;
    color: #555;
}

@media (max-width: 768px) {
    .field-row {
        flex-direction: column;
    }
    .field-label {
        margin-bottom: 0.25rem;
        min-width: auto;
    }
}

/* === Анимация появления элементов === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card,
.courses-table tr,
.calendar-day {
    animation: fadeInUp 0.4s ease forwards;
}

/* Задержка анимации для карточек */
.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.2s; }
.course-card:nth-child(5) { animation-delay: 0.25s; }
.course-card:nth-child(6) { animation-delay: 0.3s; }

/* === Адаптивность для hover-эффектов на мобильных === */
@media (hover: none) {
    .course-card:hover,
    .view-toggle button:hover,
    .pagination a:hover,
    .btn-toggle-view:hover,
    .status-badge:hover,
    .switch:hover .slider {
        transform: none;
        box-shadow: none;
    }
}