/* ===== ОСНОВНЫЕ СТИЛИ ===== */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.2s ease-in-out;
}

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

/* ===== НАВИГАЦИЯ ===== */
.navbar-brand {
    font-size: 1.5rem;
    text-decoration: none;
}

.navbar-nav .nav-link {
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

/* ===== КАРТОЧКИ ===== */
.card {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
}


.card-header {
    background-color: var(--light-color);
    border: 1px solid #dee2e6;
    font-weight: 600;
}

.card-header .bg-light {
    background-color: blue !important;
}

/* ===== ПРОЕКТЫ ===== */
.project-card {
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-stats {
    margin-top: auto;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #dbeafe;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.stat-item-grey {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f0f2f4;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.stat-item-red {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #fee2e2;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.stat-item i {
    margin-right: 0.25rem;
}

/* ===== КЛЮЧЕВЫЕ СЛОВА ===== */
.keywords-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.keywords-panel.card {
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.keywords-panel.card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.keywords-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.keywords-list {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
}

#pagination-container {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    margin-bottom: 2rem;
}


.keyword-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: var(--transition);
    cursor: pointer;
}

.keyword-item:hover {
    background-color: var(--light-color);
}

.keyword-item:last-child {
    border-bottom: none;
}

.keyword-checkbox {
    margin-right: 0.5rem;
}

.keyword-text {
    flex: 1;
    color: var(--dark-color);
    text-decoration: none;
}

.keyword-text:hover {
    color: var(--primary-color);
}

/* ===== ГРУППЫ ===== */
.groups-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.groups-panel.card {
    height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

.groups-panel.card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
    min-height: 0;
}

#groups-list {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding-bottom: 1rem;
    margin-top: 0;
}

#groups-list .group-item:last-child {
    margin-bottom: 0;
}

.groups-panel.card .mb-3 {
    flex-shrink: 0;
}


.group-item {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.group-item:hover {
    box-shadow: var(--box-shadow);
}

.group-header {
    background-color: var(--light-color);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.group-header:hover {
    background-color: #e9ecef;
}

.group-title {
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

.group-count {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.group-actions {
    display: flex;
    gap: 0.5rem;
}

.group-body {
    padding: 0.75rem 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.group-keyword {
    display: block;
    padding: 0.25rem;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.group-keyword:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.group-keyword:last-child {
    margin-bottom: 0;
}


/* ===== КНОПКИ ===== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-primary {
    /*background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));*/
    border: none;
    height: 42px;
}

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

.btn-outline-secondary-2 {
    background-color: #6c757d !important;
    color: #fff !important;
}

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

.btn-success {
    /*background: linear-gradient(45deg, var(--success-color), #146c43);*/
    border: none;
    height: 42px;
}

.btn-warning {
    /*background: linear-gradient(45deg, var(--warning-color), #ffc107);*/
    border: none;
    height: 42px;
}

.btn-danger {
    /*background: linear-gradient(45deg, var(--danger-color), #b02a37);*/
    border: none;
    height: 42px;
}

#cancel-btn {
    height: 42px;
    background-color: #6c757d;
    color: #fff;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

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

/* ===== ФОРМЫ ===== */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ===== УТИЛИТАРНЫЕ КЛАССЫ ===== */
.text-gradient-primary {
    background: #000;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}


/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .project-card {
        margin-bottom: 1rem;
    }
    
    .keywords-panel,
    .groups-panel {
        margin-bottom: 1rem;
    }
    
    .keywords-panel.card,
    .groups-panel.card {
        height: auto;
        max-height: 170vh;
    }

    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .filters-panel {
        position: sticky;
        top: 76px;
        z-index: 100;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }

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

/* ===== СКРОЛЛБАР ===== */
.group-body::-webkit-scrollbar,
.keywords-panel .overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.group-body::-webkit-scrollbar-track,
.keywords-panel .overflow-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.group-body::-webkit-scrollbar-thumb,
.keywords-panel .overflow-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.group-body::-webkit-scrollbar-thumb:hover,
.keywords-panel .overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.text-muted-blue {
    --bs-text-opacity: 1;
    color: #1d4ed8;
}

.text-muted-created {
    --bs-text-opacity: 1;
    color: #6c7c93;
}

.text-muted-red {
    --bs-text-opacity: 1;
    color: #b91c1c;
}

.text-muted-2 {
    margin-right: 20px;
    font-size: 12px;
    color: #212529bf;
    font-weight: 500;
}

.text-muted-2 #bi-key-fill-2 {
    margin-right: 3px;
}

.text-muted-2 #bi-database-fill-2 {
    margin-right: 3px;
}

.d-flex .gap-2 {
    gap: 1rem !important;
    justify-content: space-between
    
}

.table-sm>:not(caption)>*>* {
    padding: .25rem .5rem;
}

#badge-existing-keywords {
    font-size: 1.5rem !important;
    padding: 1em;
    }

.text-muted-import {
    /*color: var(--bs-secondary-color) !important;*/
    font-weight: bold !important;
}

.countdown-timer-icon {
    --bs-text-opacity: 1;
    color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity)) !important;
}

.bg-info {
	border-radius: 9999px;
}

.btn-group-lg>.btn, .btn-lg {
    --bs-btn-padding-y: 0.5rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-font-size: 1rem;
    --bs-btn-border-radius: var(--bs-border-radius-lg);
}

.btn-warning {
    color: #fff;
}

.btn-warning:hover {
    color: #fff;
}

.btn-warning:active {
    color: #fff !important;
}

.btn-warning:focus-visible {
    color: #fff;
}

.btn.btn-warning.disabled {
    color: #fff !important;
}
