/* ===== BASE STYLES ===== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
}
/* Стили для ссылок в readme блоке */
.readme-content a {
    color: #ec4899 !important;
    text-decoration: none !important;
    border-bottom: 1px dashed #ec4899;
    padding-bottom: 1px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.readme-content a:hover {
    color: #d946ef !important;
    border-bottom: 1px solid #d946ef;
}

/* Иконка Bootstrap для внешних ссылок */
.readme-content a[href^="http"]::after {
     content: " ↗";
    font-family: 'Bootstrap Icons';
    font-size: 0.8em;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.readme-content a[href^="http"]:hover::after {
    transform: translate(1px, -1px);
}
/* ===== LAYOUT ===== */
/* Контент */
body > .container.py-4 {
    flex: 1 0 auto;
}

/* Футер */
footer {
    background-color: #f8f9fa;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ===== HEADER & NAVIGATION ===== */
.logo {
    font-family: Arial, sans-serif;
}

/* Хлебные крошки */
.breadcrumb {
    background-color: #f8f9fa;
    border-radius: 0.35rem;
    padding: 0.75rem 1rem;
}

.breadcrumb-item a {
    color: #4e73df;
    text-decoration: none !important;
}

.breadcrumb-item a:hover {
    color: #2e59d9;
}

.breadcrumb-item.active {
    color: #5a5c69;
}

/* ===== TABLE STYLES ===== */
.table {
    width: 100%;
}

.table td, .table th {
    vertical-align: middle;
}

/* Сортировка таблицы */
.table th a {
    transition: color 0.2s ease;
    text-decoration: none !important;
    color: #495057 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.table th a:hover {
    color: #4e73df !important;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background-color: #f8f9fa;
}

.sort-arrow {
    font-size: 12px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.table th a:hover .sort-arrow {
    color: #4e73df;
}

/* ===== BUTTON STYLES ===== */
/* Все ссылки без подчеркивания */
a, a.btn, button {
    text-decoration: none !important;
    color: inherit;
}

a:hover, a.btn:hover, button:hover {
    text-decoration: none !important;
}

/* Кастомная розовая outline кнопка */
.btn.btn-outline-pink {
    color: #ec4899;
    border-color: #ec4899;
    background: transparent;
    border-radius: 5px;
}

.btn.btn-outline-pink:hover {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    color: white;
    border-color: transparent;
}

/* ===== CUSTOM MODAL STYLES ===== */
#progressModal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    overflow: hidden;
}

/* Заголовок модального окна */
#progressModal .modal-header {
    border-bottom: 1px solid #e3e6f0;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    padding: 1.25rem 1.5rem;
}

#progressModal .modal-title {
    font-weight: 600;
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
}

/* Тело модального окна */
#progressModal .modal-body {
    padding: 2rem;
}

/* Капча */
#captchaQuestion {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

#captchaAnswer {
    border: 2px solid #e3e6f0;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

#captchaAnswer:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 0.2rem rgba(236, 72, 153, 0.25);
}

/* Кнопки в модальном окне */
#progressModal .btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

#progressModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
    color: white;
}

/* Прогресс-бар */
#progressModal .progress {
    border-radius: 10px;
    background-color: #f0f2f8;
    overflow: hidden;
}

#progressBar {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    border-radius: 10px;
}

/* Ошибка капчи */
#captchaError {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #dc3545;
    font-weight: 500;

}

#captchaError.show {

}

/* Анимация появления */
.modal.fade .modal-dialog {
    transform: scale(0.9);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Закрывающая кнопка */
#progressModal .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#progressModal .btn-close:hover {
    opacity: 1;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ec4899'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

/* Состояния модалки */
.modal-success .modal-content {
    border-left: 4px solid #28a745;
}

.modal-error .modal-content {
    border-left: 4px solid #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.modal-warning .modal-content {
    border-left: 4px solid #ffc107;
}

.modal-loading .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    animation: loading 2s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== README BLOCK ===== */
.readme-content {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 1px solid #e3e6f0 !important;
    border-left: 4px solid #4e73df !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.readme-content h6 {
    color: #4e73df;
    font-weight: 600;
}

.readme-content blockquote {
    border-left: 3px solid #4e73df;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
}

.readme-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #e83e8c;
}

.readme-content ul, .readme-content ol {
    padding-left: 2rem;
    margin: 0.5rem 0;
}

/* Сворачиваемый readme */
.btn-toggle-readme {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 5px;
}

.btn-toggle-readme:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.btn-toggle-readme i {
    transition: transform 0.3s ease;
}

.readme-content .collapse {
    transition: all 0.3s ease;
}

/* ===== ARTICLE STYLES ===== */
.article-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.article-content {
    line-height: 1.7;
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-meta {
    font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.readme-content .collapse.show {
    animation: fadeIn 0.3s ease;
}

/* ===== MOBILE ADAPTATION ===== */
/* Таблица для скролла на маленьких экранах */
@media (max-width: 992px) {
    .table-container {
        overflow-x: auto;
    }
}

/* Планшеты и маленькие ноутбуки */
@media (max-width: 768px) {
    /* Логотип */
    .logo.fs-4 {
        font-size: 1.1rem !important;
    }
    
    /* Таблица */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Скрываем столбец "Размер" */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        display: none;
    }
    
    /* Кнопки */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.775rem;
    }
    
    .btn-item-download {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
        border-width: 1px;
        border-radius: 4px !important;
    }
    
    /* Хлебные крошки */
    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .breadcrumb-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    /* Readme блок */
    .readme-content {
        font-size: 0.875rem;
        padding: 1rem;
    }
    
    .readme-content .alert-heading {
        font-size: 0.9rem;
    }
    
    /* Кнопка сворачивания readme */
    .btn-toggle-readme {
        padding: 0.2rem 0.4rem;
        font-size: 0.875rem;
    }
    
    /* Модальное окно */
    .modal-content {
        margin: 1rem;
        padding: 1rem;
    }
    
    /* Заголовки */
    .container h2 {
        font-size: 1.5rem;
    }
    
    /* Форма капчи */
    #captchaAnswer {
        width: 80px !important;
    }
    
    /* Чекбоксы */
    input[type="checkbox"] {
        transform: scale(1.2);
        margin: 0.2rem;
    }
}

/* Мобильные телефоны */
@media (max-width: 576px) {
    /* Скрываем столбец "Дата" */
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none;
    }
    
    /* Логотип */
    .logo.fs-4 {
        font-size: 1rem !important;
    }
    
    /* Кнопки скачивания */
    .btn-item-download {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Основные кнопки */
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Контейнер */
    .container.py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Хедер */
    header.py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}