/* ==================== ITEM FINDER PANEL ==================== */
.item-finder-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1219 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.item-finder-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.item-finder-panel.mobile {
    width: 95%;
    max-height: 85vh;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
}

.item-finder-panel.mobile.visible {
    transform: translate(-50%, -50%) scale(1);
}

/* Панель управления */
.item-finder-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.item-finder-panel .panel-title {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-finder-panel .panel-title span {
    background: linear-gradient(135deg, #DDEE73, #58BA56);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.item-finder-panel .panel-controls {
    display: flex;
    gap: 8px;
}

.item-finder-panel .panel-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.item-finder-panel .panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.item-finder-panel .panel-btn.minimize::before {
    content: "−";
    font-size: 20px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.item-finder-panel .panel-btn.close::before {
    content: "✕";
    font-size: 16px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Контент */
.item-finder-panel .panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Конфигурация поиска */
.search-config {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.config-group {
    margin-bottom: 16px;
}

.config-group:last-child {
    margin-bottom: 0;
}

.config-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.config-label i {
    margin-right: 6px;
    color: #DDEE73;
}

.config-input, .config-select, .config-textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.config-input:focus, .config-select:focus, .config-textarea:focus {
    outline: none;
    border-color: #DDEE73;
    background: rgba(0, 0, 0, 0.5);
}

.config-textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
}

.config-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.config-hint i {
    font-size: 10px;
}

/* Селекторы типа */
.item-type-selector, .search-mode-selector {
    display: flex;
    gap: 10px;
}

.type-btn, .mode-btn {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.type-btn i, .mode-btn i {
    font-size: 14px;
}

.type-btn.active, .mode-btn.active {
    background: linear-gradient(135deg, #58BA56, #3d7a3b);
    border-color: #DDEE73;
    box-shadow: 0 2px 8px rgba(88, 186, 86, 0.3);
}

.type-btn:hover:not(.active), .mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Задержки */
.delay-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delay-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.delay-item span:first-child {
    flex: 1;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 140px;
}

.delay-item input[type="range"] {
    flex: 2;
    min-width: 120px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.delay-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #DDEE73;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.delay-number {
    width: 60px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    text-align: center;
    font-size: 12px;
}

/* Фильтры */
.filter-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Кнопки управления */
.finder-controls {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.control-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn.start {
    background: linear-gradient(135deg, #58BA56, #3d7a3b);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 186, 86, 0.3);
}

.control-btn.start:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 186, 86, 0.4);
}

.control-btn.pause {
    background: linear-gradient(135deg, #FFC926, #e5b520);
    color: #1a1f2e;
}

.control-btn.stop {
    background: linear-gradient(135deg, #FF7866, #e55a46);
    color: white;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Статистика */
.finder-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #DDEE73;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.current-info {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.current-planet, .current-user {
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-planet i, .current-user i {
    color: #DDEE73;
}

.current-planet span, .current-user span {
    color: #DDEE73;
    font-weight: 500;
}

/* Результаты поиска */
.search-results {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.results-header i {
    margin-right: 6px;
    color: #DDEE73;
}

.results-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 12px;
}

.results-placeholder {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.results-placeholder i {
    font-size: 48px;
    opacity: 0.5;
}

/* Результат - новая структура с result-header */
.result-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    overflow: hidden;
}

.result-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(221, 238, 115, 0.3);
}

.result-header {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: bold;
    color: #DDEE73;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-name i {
    font-size: 12px;
}

.user-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-bottom: 4px;
}

.planet-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* Предметы в результате */
.result-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}

.result-item-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.item-icon-placeholder {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #DDEE73;
}

.item-name {
    color: white;
    font-size: 12px;
}

.item-count {
    color: #DDEE73;
    font-weight: bold;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 12px;
}

.item-price {
    color: #FFC926;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 12px;
}

/* Лог */
.finder-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.log-messages {
    max-height: 150px;
    overflow-y: auto;
    padding: 12px;
    font-family: monospace;
    font-size: 11px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.log-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-family: monospace;
}

.log-icon {
    font-size: 11px;
}

.log-text {
    flex: 1;
    word-break: break-word;
}

.log-entry.info .log-text {
    color: rgba(255, 255, 255, 0.7);
}

.log-entry.success .log-text {
    color: #58BA56;
}

.log-entry.warning .log-text {
    color: #FFC926;
}

.log-entry.error .log-text {
    color: #FF7866;
}

.log-entry:last-child {
    border-bottom: none;
}

/* Кнопка очистки */
.clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Скроллбар */
.results-list::-webkit-scrollbar,
.log-messages::-webkit-scrollbar {
    width: 4px;
}

.results-list::-webkit-scrollbar-track,
.log-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.results-list::-webkit-scrollbar-thumb,
.log-messages::-webkit-scrollbar-thumb {
    background: rgba(221, 238, 115, 0.5);
    border-radius: 2px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .item-finder-panel {
        width: 95%;
        max-height: 85vh;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .result-time {
        align-self: flex-end;
    }
    
    .delay-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .delay-item span:first-child {
        min-width: auto;
    }
    
    .current-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .control-btn {
        padding: 10px;
        font-size: 12px;
    }
    
    .filter-options {
        flex-direction: column;
        gap: 8px;
    }
}

/* Кнопка выбора предмета */
.select-item-btn {
    background: linear-gradient(135deg, #58BA56, #3d7a3b);
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.select-item-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(88, 186, 86, 0.3);
}

/* Модальное окно выбора предмета */
.game-item-card:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: #DDEE73 !important;
    transform: translateY(-2px);
}
/* Бейдж количества предметов */
.items-badge {
    background: rgba(221, 238, 115, 0.2);
    color: #DDEE73;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
}

/* Анимация появления новых результатов */
.result-item {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .select-item-btn {
        width: 100%;
        height: 40px;
    }
    
    .game-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
    }
}

/* Анимация появления результатов */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: slideIn 0.2s ease-out;
}