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

body {
    background: #0f0f11;
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
    height: 100vh;
    overscroll-behavior-y: contain; 
}

#bgBlur {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.25);
    transition: background-image 1.5s ease-in-out;
    z-index: 0;
}

.container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    z-index: 1;
}

/* Панель управления */
.controls-wrapper {
    background: rgba(15, 15, 17, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.controls {
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.input-group {
    display: flex;
    gap: 10px;
    flex: 1;
}

/* Обертка для поля ввода, чтобы подсказки выпадали правильно */
.tag-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

#tagInput {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

#tagInput:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Выпадающий список автодополнения */
.autocomplete-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Кастомизация скроллбара в подсказках */
.autocomplete-items::-webkit-scrollbar {
    width: 6px;
}
.autocomplete-items::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.autocomplete-item:hover {
    background: rgba(79, 70, 229, 0.4);
}

.autocomplete-item .tag-name {
    color: #fff;
    font-weight: 500;
}

.autocomplete-item .tag-count {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

.button {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

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

.button#startBtn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.button.success {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    white-space: nowrap;
    min-width: 120px;
    text-align: right;
}

/* Панель настроек */
.settings-panel {
    display: none; 
    padding: 0 20px 15px 20px;
    gap: 20px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    align-items: flex-end;
}

.settings-panel.open {
    display: flex;
}

.setting-item {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
}

.setting-item input[type="range"] {
    width: 100%;
    accent-color: #4f46e5;
}

.save-btn-wrapper {
    display: flex;
    align-items: center;
}
/* Стили для чекбоксов фильтров */
.filters-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
    justify-content: flex-start !important;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #4f46e5;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px;
        gap: 10px;
    }
    .input-group {
        width: 100%;
        flex-direction: column;
    }
    .status {
        text-align: center;
    }
    .settings-panel {
        flex-direction: column;
        padding: 0 15px 15px 15px;
    }
    .save-btn-wrapper {
        width: 100%;
    }
    .save-btn-wrapper .button {
        width: 100%;
    }
}

/* Вьювер */
.viewer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#imageContainer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    object-fit: contain; 
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.slide.active {
    opacity: 1;
}

.slide.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 20;
}

@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }