/* ========================================
   KURILABOT GAME CASES STYLES - СТИЛИ КЕЙСОВ
   ======================================== */

/* ===== КНОПКА ИСТОРИИ В ШАПКЕ ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    color: #00ffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.history-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.history-btn:active {
    transform: scale(0.95);
}

/* ===== КОМПАКТНЫЙ ПРИКРЕПЛЕННЫЙ БАЛАНС ===== */
.cases-balance-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(15, 15, 25, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.balance-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.1);
    flex: 1;
}

.balance-compact i {
    font-size: 14px;
    color: #00ffff;
}

.balance-compact span {
    font-size: 13px;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

/* ===== ГОРИЗОНТАЛЬНЫЕ КАТЕГОРИИ ===== */
.cases-categories-horizontal {
    margin-bottom: 12px;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-chip:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.4);
    color: #00ffff;
}

.category-chip.active {
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border-color: transparent;
    color: #000000;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.4);
}

.category-chip i {
    font-size: 11px;
}

.category-loading {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.5);
}

.category-loading i {
    font-size: 12px;
}

/* Для совместимости с JavaScript */
.category-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.4);
    color: #00ffff;
}

.category-btn.active {
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border-color: transparent;
    color: #000000;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.4);
}

.category-icon {
    font-size: 11px;
}

.category-name {
    font-size: 12px;
}

/* ===== ПОИСК КЕЙСОВ ===== */
.cases-search {
    margin-bottom: 15px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i.fa-search {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    transition: all 0.3s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    color: #ff0000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 10px;
}

.search-clear:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}

/* ===== СЕТКА КЕЙСОВ ===== */
.cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.cases-loading,
.cases-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.cases-loading i,
.cases-empty i {
    font-size: 32px;
    color: #00ffff;
    opacity: 0.5;
}

.cases-loading span,
.cases-empty span {
    font-size: 14px;
}

/* ===== КАРТОЧКА КЕЙСА ===== */
.case-item {
    background: linear-gradient(135deg, 
        rgba(15, 15, 25, 0.95) 0%, 
        rgba(25, 25, 35, 0.9) 100%);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.case-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.case-item:hover::before {
    left: 100%;
}

.case-item:hover {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.08) 0%, 
        rgba(0, 128, 255, 0.05) 100%);
    border-color: rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.15);
}

.case-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.case-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
}

.case-info {
    flex: 1;
    min-width: 0;
}

.case-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-category {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}

.case-category i {
    font-size: 9px;
    color: #00ffff;
}

.case-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.price-amount {
    font-size: 16px;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.price-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.case-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    line-height: 1.4;
}

.case-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.case-stats {
    display: flex;
    gap: 12px;
    flex: 1;
}

.case-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.case-stat i {
    font-size: 10px;
    color: #00ffff;
}

.case-open-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-open-btn:hover {
    background: linear-gradient(135deg, #00cccc, #0066cc);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.4);
}

.case-open-btn:disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Для совместимости с JavaScript */
.case-buy-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-buy-btn:hover {
    background: linear-gradient(135deg, #00cccc, #0066cc);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.4);
}

.case-buy-btn:disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
}

.case-buy-btn.not-enough {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff4444;
}

/* ===== КНОПКА ПРОКРУТКИ ВВЕРХ ===== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border: none;
    border-radius: 50%;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 
        0 4px 15px rgba(0, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    z-index: 1000;
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-to-top-btn:hover {
    background: linear-gradient(135deg, #00cccc, #0066cc);
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(0, 255, 255, 0.6),
        0 3px 10px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-btn:active {
    transform: scale(0.95);
}

.scroll-to-top-btn i {
    font-size: 18px;
}

/* ===== МОДАЛЬНОЕ ОКНО ИСТОРИИ ===== */
.cases-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.cases-history-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.cases-history-modal.closing {
    animation: modalFadeOut 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.cases-history-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
}

.cases-history-modal .modal-content {
    position: relative;
    z-index: 10001;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.98), rgba(25, 25, 35, 0.95));
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 16px;
    padding: 0;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 255, 255, 0.2);
    animation: modalSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cases-history-modal.closing .modal-content {
    animation: modalSlideDown 0.3s ease;
}

@keyframes modalSlideDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
}

.cases-history-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    flex-shrink: 0;
}

.cases-history-modal .modal-header h4 {
    margin: 0;
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cases-history-modal .modal-header h4 i {
    color: #00ffff;
}

.cases-history-modal .modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 6px;
    color: #ff0000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.cases-history-modal .modal-close:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}

.cases-history-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.history-item {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(0, 255, 255, 0.05);
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateX(4px);
}

.history-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000000;
    flex-shrink: 0;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-case {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.history-item-reward {
    font-size: 12px;
    color: #00ffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-item-reward i {
    font-size: 10px;
}

.history-item-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.history-placeholder {
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.history-placeholder i {
    font-size: 48px;
    color: rgba(0, 255, 255, 0.3);
}

/* Скроллбар для истории */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00cccc, #0066cc);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .cases-balance-sticky {
        padding: 6px 10px;
        gap: 8px;
    }
    
    .balance-compact {
        padding: 3px 8px;
    }
    
    .balance-compact i {
        font-size: 12px;
    }
    
    .balance-compact span {
        font-size: 11px;
    }
    
    .category-chip,
    .category-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .category-icon {
        font-size: 10px;
    }
    
    .category-name {
        font-size: 11px;
    }
    
    .case-item {
        padding: 12px;
    }
    
    .case-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .case-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cases-balance-sticky {
        padding: 5px 8px;
    }
    
    .balance-compact span {
        font-size: 10px;
    }
    
    .case-header {
        gap: 10px;
    }
    
    .case-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .case-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .case-open-btn,
    .case-buy-btn {
        width: 100%;
    }
    
    .category-chip,
    .category-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .category-icon {
        font-size: 9px;
    }
    
    .category-name {
        font-size: 10px;
    }
    
    .history-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .scroll-to-top-btn {
        width: 40px;
        height: 40px;
        bottom: 70px;
        right: 15px;
    }
    
    .scroll-to-top-btn i {
        font-size: 16px;
    }
    
    .cases-history-modal .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .cases-history-modal .modal-header {
        padding: 12px 15px;
    }
    
    .cases-history-modal .modal-header h4 {
        font-size: 14px;
    }
    
    .history-list {
        padding: 15px;
    }
    
    .history-item {
        padding: 10px 12px;
    }
    
    .history-item-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .history-item-case {
        font-size: 12px;
    }
    
    .history-item-reward {
        font-size: 11px;
    }
}
