/* Sidebar Styles */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #2c3e50;
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
}

.sidebar.active {
    margin-left: -250px;
}

.sidebar .sidebar-header {
    padding: 20px;
    background: #1a252f;
}

.sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 1rem;
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar ul li a:hover {
    background: #34495e;
    color: #fff;
}

.sidebar ul li a.active {
    background: #3498db;
    color: #fff;
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    background: #f8f9fa;
}

#sidebarCollapse {
    background: #3498db;
    color: #fff;
    border: none;
}

#sidebarCollapse:hover {
    background: #2980b9;
}

/* Table Styles */
.dataTables_wrapper {
    padding: 15px 0;
}

table.dataTable td {
    vertical-align: middle;
}

.btn-action {
    padding: 4px 8px;
    margin: 0 2px;
    font-size: 12px;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 2px solid #3498db;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    color: #2c3e50;
}

/* Badge Styles */
.badge-active {
    background: #27ae60;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
}

.badge-inactive {
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
}

/* Modal Styles */
.modal-lg {
    max-width: 800px;
}

.modal-header {
    background: #2c3e50;
    color: #fff;
}

.modal-header .btn-close {
    color: #fff;
    filter: brightness(0) invert(1);
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: #2c3e50;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52,152,219,0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }
    .sidebar.active {
        margin-left: 0;
    }
    #sidebarCollapse span {
        display: none;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Custom */
.toast-custom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}

/* Upload Area Styles */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.upload-area.drag-over {
    border-color: #27ae60;
    background: #e8f8f0;
}

.upload-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-text p {
    margin-bottom: 5px;
    color: #495057;
}

.browse-link {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

.browse-link:hover {
    color: #2980b9;
}

.file-info {
    margin-top: 10px;
}

.file-info .alert {
    padding: 12px 15px;
}

.file-info .btn-close {
    font-size: 12px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(52,152,219,0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Preview Table */
#previewTable {
    font-size: 13px;
}

#previewTable th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Select2 Custom */
.select2-container--bootstrap-5 .select2-selection {
    border-color: #dee2e6;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding: 0.375rem 0.75rem;
}
/* Image thumbnails */
.image-thumbnails {
    display: flex;
    align-items: center;
    gap: 5px;
}

.image-thumbnails i {
    font-size: 18px;
}

/* Dropzone styles */
.dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
    min-height: 150px;
    padding: 20px;
}

.dropzone .dz-message {
    margin: 0;
    text-align: center;
    color: #6c757d;
}

.dropzone .dz-message i {
    color: #3498db;
    margin-bottom: 10px;
}

.dropzone .dz-preview .dz-image {
    border-radius: 5px;
}

/* Image gallery */
.image-item .card {
    transition: transform 0.2s;
}

.image-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.image-item .card-img-top {
    border-bottom: 1px solid #dee2e6;
}

/* Nav tabs */
.nav-tabs .nav-link {
    color: #2c3e50;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

/* Progress bar */
.progress {
    height: 25px;
    border-radius: 5px;
}

.progress-bar {
    background-color: #3498db;
    line-height: 25px;
    font-weight: 500;
}

.select2-container--default .select2-selection--multiple {
    max-height: 120px !important;
    overflow-y: auto !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    max-height: 110px !important;
    overflow-y: auto !important;
}

/* Select2 кастомные стили для чекбоксов */
.connected-result-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.connected-result-wrapper:hover {
    background-color: #f8f9fa;
}

.connected-result-checkbox {
    flex-shrink: 0;
}

.select2-results__option--highlighted .connected-result-wrapper {
    background-color: #e7f1ff;
}

/* Ограничиваем высоту выбранных элементов */
.select2-selection--multiple {
    max-height: 120px !important;
    overflow-y: auto !important;
}

.select2-selection__rendered {
    max-height: 110px !important;
    overflow-y: auto !important;
}

.select2-selection__choice {
    background-color: #e9ecef !important;
    border: none !important;
    padding: 4px 8px !important;
    margin: 2px 4px !important;
    font-size: 13px !important;
}

/* Индикатор счётчика */
#connectedCount {
    background-color: #0d6efd;
    color: white;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.select2-selection__choice__display {
    padding-left: 15px!important;
}

.select2-selection__choice__display {
    top: 3px!important; 
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--bs-focus-ring-color)!important;
    color: black!important;
}