/* bot_app/web_app/css/pages/cases.css */

/* Страница кейсов */
.cases-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.case-card {
    background-color: var(--primary-color); border: 1px solid var(--secondary-color);
    border-radius: 12px; padding: 10px; text-align: center; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; justify-content: flex-start; min-height: 220px;
}
.case-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.case-card-image-placeholder { height: 150px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; color: #444; margin-bottom: 10px; }
.case-card-text { margin-top: auto; }
.case-card h2 { margin: 0 0 5px 0; font-size: 16px; }
.case-price { color: #aaa; font-weight: bold; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.case-price svg {
    width: 14px; /* Adjust as needed, slightly smaller than text */
    height: 14px; /* Adjust as needed */
    vertical-align: middle; /* Ensure vertical alignment with text */
    margin-left: 2px; /* Adjusted gap to the left of the icon, slightly less */
}

.case-limit {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.case-cooldown {
    font-size: 12px;
    color: var(--text-color-secondary);
    margin-top: 5px;
}

.case-cooldown .cooldown-timer {
    font-weight: bold;
    color: var(--accent-color);
}

/* Стили изображений */
.case-card-image, .case-detail-image-tag { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; }

/* Updated styles for page header and group filter */
.page-header {
    display: flex;
    justify-content: space-between; /* Distribute items with space between */
    align-items: center;
    margin-bottom: 20px;
    position: relative; /* For dropdown positioning */
}

.page-header h1 {
    margin: 0 auto; /* Center the H1 */
}

.group-filter-container {
    position: relative; /* Keep relative for dropdown */
    z-index: 101; /* Ensure it's above other elements */
}

#group-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

#group-filter-btn:hover {
    background-color: var(--secondary-color-dark);
}

#group-filter-btn svg {
    transition: transform 0.3s ease;
}

#group-filter-btn.active svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%; /* Position below the button */
    left: 0;
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 100;
    display: none; /* Hidden by default */
    padding: 5px 0;
    margin-top: 5px; /* Space between button and dropdown */
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    transition: background-color 0.2s;
}

.dropdown-menu-item:hover {
    background-color: var(--secondary-color);
}

.dropdown-menu-item.selected {
    background-color: #28a745; /* Зеленый цвет вместо синего */
    color: white;
    font-weight: bold;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .page-header h1 {
        margin: 0;
        order: 1;
    }
    
    .group-filter-container {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    #group-filter-btn {
        padding: 10px 16px;
        font-size: 16px;
        min-width: 140px;
        justify-content: center;
    }
    
    .dropdown-menu {
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .page-header {
        gap: 10px;
    }
    
    #group-filter-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 120px;
    }
    
    .dropdown-menu {
        min-width: 160px;
    }
    
    .cases-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}
