/* Основные стили сайта Прокуратуры РФ */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white-color: #ffffff;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white-color);
}

/* Переопределение Bootstrap цветов для государственного стиля */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1e40af;
    border-color: #1e40af;
}

/* Навигация */
.navbar {
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Баннер */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.05) 10px, rgba(255,255,255,.05) 20px);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Иконки */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-icon i {
    font-size: 2.5rem;
    color: white;
}

.feature-icon-small {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-icon-small i {
    font-size: 1.8rem;
    color: white;
}

/* Карточки */
.card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

/* Подчеркивание заголовков */
.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), #3b82f6);
    margin-top: 10px;
}

/* Формы */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Кнопки */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* Бейджи статусов */
.badge {
    font-weight: 600;
    padding: 0.5em 1em;
    border-radius: 6px;
}

.status-new {
    background-color: #3b82f6;
}

.status-in_progress {
    background-color: #f59e0b;
}

.status-completed {
    background-color: #10b981;
}

.status-archived {
    background-color: #6b7280;
}

.status-active {
    background-color: #10b981;
}

.status-suspended {
    background-color: #f59e0b;
}

.status-closed {
    background-color: #6b7280;
}

.status-pending {
    background-color: #f59e0b;
}

.status-blocked {
    background-color: #ef4444;
}

.priority-low {
    background-color: #9ca3af;
}

.priority-medium {
    background-color: #3b82f6;
}

.priority-high {
    background-color: #f59e0b;
}

.priority-urgent {
    background-color: #ef4444;
}

/* Алерты */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

/* Таблицы */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(30, 58, 138, 0.05);
}

.table-responsive {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Пагинация */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
    border-radius: 6px;
    margin: 0 0.25rem;
    font-weight: 600;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Модальные окна */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Footer */
footer {
    margin-top: auto;
}

footer a:hover {
    opacity: 0.8;
}

/* Анимации загрузки */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Файлы */
.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    background-color: #e5e7eb;
    transform: translateX(5px);
}

.file-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 1rem;
    font-size: 1.2rem;
}

/* Комментарии */
.comment-item {
    background-color: var(--light-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.comment-text {
    margin-top: 0.5rem;
    color: var(--text-color);
}

/* Статистика на дашборде */
.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    bottom: 1rem;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.stat-card-blue {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.stat-card-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Адаптивность */

/* Планшеты и небольшие ноутбуки */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .top-navbar {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-brand {
        width: 0;
        overflow: hidden;
    }
}

/* Планшеты */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.875rem;
    }
    
    .stat-card .stat-icon {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    /* Скрываем некоторые колонки в таблицах на планшетах */
    .table th:nth-child(n+4),
    .table td:nth-child(n+4) {
        display: none;
    }
    
    .table th:last-child,
    .table td:last-child {
        display: table-cell;
    }
}

/* Мобильные устройства */
@media (max-width: 576px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 1.5rem;
    }
    
    .display-5 {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-card .stat-icon {
        position: relative;
        right: auto;
        bottom: auto;
        font-size: 2rem;
        opacity: 0.2;
        margin-bottom: 0.5rem;
    }
    
    .stat-card::before {
        display: none;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 2rem;
    }
    
    .feature-icon-small {
        width: 50px;
        height: 50px;
    }
    
    .feature-icon-small i {
        font-size: 1.5rem;
    }
    
    /* Таблицы на мобильных */
    .table-responsive {
        border: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
    }
    
    .table tbody td {
        display: block;
        text-align: left !important;
        padding: 0.5rem 0;
        border: 0;
    }
    
    .table tbody td:before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 0.25rem;
        color: var(--text-color);
    }
    
    /* Формы на мобильных */
    .form-control-lg {
        font-size: 1rem;
    }
    
    /* Модальные окна на мобильных */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Pagination на мобильных */
    .pagination {
        font-size: 0.875rem;
    }
    
    .page-link {
        padding: 0.375rem 0.625rem;
    }
    
    /* Navbar на мобильных */
    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 1rem;
    }
    
    /* Карточки на мобильных */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body.p-4 {
        padding: 1rem !important;
    }
    
    .card-body.p-5 {
        padding: 1.5rem !important;
    }
    
    /* Отступы на мобильных */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    /* Скрываем длинные тексты */
    .text-muted {
        font-size: 0.8rem;
    }
    
    /* Кнопки в один столбец на мобильных */
    .d-md-flex.gap-2 {
        flex-direction: column !important;
    }
    
    .d-md-flex.gap-2 > * {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
}

/* Очень маленькие устройства */
@media (max-width: 375px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero-section h1 {
        font-size: 1.25rem !important;
    }
    
    .stat-card .stat-number {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Landscape режим для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }
    
    .sidebar {
        padding-top: 60px;
    }
}

/* Улучшение для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .page-link,
    .card {
        -webkit-tap-highlight-color: transparent;
    }
    
    .table tbody tr {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    }
    
    /* Увеличенные области нажатия */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Утилиты */
.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

/* Transition для плавности */
* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

button,
a,
.btn,
.card {
    transition: all 0.3s ease;
}
