/* ==========================================================================
   Inventory Carousel Styles - Refactored

   This file contains ONLY item-carousel specific styles that don't exist
   in the NPC carousel (tabs, inventory stats, item-specific styling).

   The core carousel mechanics (revolving door effect, positioning, animations)
   are defined in carousel.css and shared by both carousels.

   IMPORTANT: Do NOT override these base carousel properties here:
   - .carousel-viewport overflow (must stay visible)
   - .carousel-track overflow (must stay visible)
   - .carousel-track height (must be 100px)
   - .carousel-item positioning (handled by base styles)
   ========================================================================== */

/* Tab System */
.carousel-tabs {
    display: flex;
    gap: 8px;
    margin-right: auto;
}

.carousel-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 186, 8, 0.3);
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    border-radius: 4px;
}

.carousel-tab:hover {
    background: rgba(255, 186, 8, 0.1);
    border-color: rgba(255, 186, 8, 0.5);
}

.carousel-tab.active {
    background: rgba(255, 186, 8, 0.2);
    border-color: var(--selective-yellow);
    color: var(--selective-yellow);
}

.carousel-tab .tab-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(72%) sepia(67%) saturate(4571%) hue-rotate(359deg) brightness(104%) contrast(104%);
}

.carousel-tab.active .tab-icon {
    filter: brightness(0) saturate(100%) invert(86%) sepia(29%) saturate(3019%) hue-rotate(359deg) brightness(105%) contrast(104%);
}

/* Inventory Stats */
.inventory-stats {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 186, 8, 0.2);
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.stat-bar:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 11px;
    color: #aaa;
    min-width: 45px;
}

.stat-progress {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 186, 8, 0.2);
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #51cf66 0%, #37b24d 100%);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.stat-value {
    font-size: 11px;
    color: var(--selective-yellow);
    min-width: 50px;
    text-align: right;
}

/* Item Rarity Colors */
.item-item.rarity-common {
    border-color: #868e96;
}

.item-item.rarity-uncommon {
    border-color: #51cf66;
}

.item-item.rarity-rare {
    border-color: #4dabf7;
}

.item-item.rarity-epic {
    border-color: #be4bdb;
}

.item-item.rarity-legendary {
    border-color: #ffd43b;
    box-shadow: 0 0 10px rgba(255, 212, 59, 0.3);
}

.item-item.rarity-unique {
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

/* Item Card Enhancements */
.item-item {
    /* Don't override position - let base carousel-item handle it */
    border-width: 2px;
}

/* Item carousel header and stats are additional elements */
/* The carousel viewport and track should inherit base styles from carousel.css */
/* Only override what's absolutely necessary */

/* Ensure header doesn't affect revolving door mechanism */
.item-carousel .carousel-header {
    flex-shrink: 0; /* Don't let header shrink */
    position: relative;
    z-index: 3; /* Above carousel items */
}

.item-carousel .inventory-stats {
    flex-shrink: 0; /* Don't let stats shrink */
    position: relative;
    z-index: 3; /* Above carousel items */
}

/* Ensure item carousel items are positioned absolutely like NPCs */
.item-carousel .carousel-item {
    position: absolute !important; /* Override any conflicting styles */
}

.item-item.equipped {
    background: rgba(255, 186, 8, 0.1);
}

.equipped-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--selective-yellow);
    color: #000;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--selective-yellow);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid rgba(255, 186, 8, 0.5);
}

.item-durability {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 186, 8, 0.2);
}

.durability-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8787 100%);
    transition: width 0.3s ease;
}

/* Item Action Buttons */
.item-actions {
    position: absolute;
    bottom: 5px;
    left: 5px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-item:hover .item-actions {
    opacity: 1;
}

.item-actions .action-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 186, 8, 0.5);
    color: var(--selective-yellow);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.item-actions .action-btn:hover {
    background: rgba(255, 186, 8, 0.3);
    transform: scale(1.1);
}

/* Item Icon SVGs */
.item-icon-svg {
    width: 32px;
    height: 32px;
    filter: brightness(0) saturate(100%) invert(86%) sepia(29%) saturate(3019%) hue-rotate(359deg) brightness(105%) contrast(104%);
}

.carousel-icon-placeholder .item-icon-svg {
    width: 100%;
    height: 100%;
}

/* Carousel Header - Item carousel specific element */
.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 186, 8, 0.2);
    min-height: 32px; /* Ensure consistent height */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .carousel-tabs {
        gap: 4px;
    }

    .carousel-tab {
        padding: 4px 8px;
        font-size: 11px;
    }

    .carousel-tab .tab-icon {
        width: 14px;
        height: 14px;
    }

    .stat-bar {
        gap: 4px;
    }

    .stat-label {
        font-size: 10px;
        min-width: 40px;
    }

    .stat-value {
        font-size: 10px;
        min-width: 45px;
    }
}