@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap");

/* Inventory Bar Styles */
#inventory-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--inventory-bar-height);
    background-color: var(--hud-bg-color);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center; 
    align-items: center; 
    padding: 5px 10px;
    box-sizing: border-box;
    z-index: 11; 
    pointer-events: auto; 
    gap: 15px; 
    font-family: "Roboto Mono", monospace; 
}

.inventory-section {
    display: flex;
    flex-direction: column; 
    align-items: center;
    padding: 5px;
    border: 1px solid; 
    border-radius: var(--border-radius);
    background-color: rgba(0,0,0,0.2);
}

.inventory-section-label {
    font-size: 9px; 
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--text-secondary); 
    letter-spacing: 0.5px;
}

.inventory-slots-container {
    display: flex;
    gap: 5px; 
}

.inventory-slot {
    width: var(--inventory-slot-size);
    height: var(--inventory-slot-size);
    background-color: rgba(20, 20, 40, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab; 
    transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
    position: relative; 
}

.inventory-slot:hover {
    background-color: rgba(var(--ui-theme-secondary-rgb), 0.1); 
    border-color: var(--secondary-color); 
}

/* Drag Over Highlight */
.inventory-slot.drag-over {
    background-color: rgba(var(--ui-theme-accent-rgb), 0.2); 
    border-color: var(--accent-color); 
    box-shadow: 0 0 8px rgba(var(--ui-theme-accent-rgb), 0.5); 
}

.inventory-slot.occupied:hover {
    background-color: rgba(var(--ui-theme-primary-rgb), 0.15); 
    border-color: var(--primary-color); 
}

/* Placeholder icon for empty slots */
.inventory-slot .slot-placeholder {
    position: absolute;
    width: 60%;
    height: 60%;
    opacity: 0.16;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary); /* SVG uses currentColor */
    transition: opacity 0.15s ease, transform 0.12s ease;
    transform: scale(1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.inventory-slot:hover .slot-placeholder {
    opacity: 0.24;
    transform: translate(-50%, -50%) scale(1.02);
}

/* Ensure placeholder SVG fills its container and inherits color */
.inventory-slot .slot-placeholder svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
    stroke: none;
}

.inventory-slots-sublabels {
    display: flex;
    justify-content: space-between;
    /* Dynamic width calculation must remain inline or JS calculated, but base styles can be here */
    font-size: 9px;
    color: var(--text-secondary);
}

/* Simple Item Representation */
.item-representation {
    width: 80%;
    height: 80%;
    border: 2px solid transparent; /* New: show stage color */
    border-radius: 4px;
    font-size: 14px; /* Larger for power number */
    font-weight: bold;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    overflow: hidden;
    text-align: center;
    line-height: 1;
    background-color: rgba(255, 255, 255, 0.1); 
    transition: opacity 0.2s ease; 
    cursor: grab; 
    user-select: none; 
    -webkit-user-drag: element; 

    /* NEW: Layout for icon and power */
    flex-direction: column; 
    padding: 2px;
}
.item-representation:active {
    cursor: grabbing; 
}

/* NEW: Icon and Power Text styles */
.item-icon {
    width: 16px;
    height: 16px;
    color: var(--text-color); /* Icon stroke/fill */
    margin-bottom: 2px;
}

.item-power {
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

/* Stage color borders for inventory items */
.item-representation.stage-primary { border-color: var(--stage-slingapult-color); }
.item-representation.stage-secondary { border-color: var(--stage-sorcerarcher-color); }
.item-representation.stage-tertiary { border-color: var(--stage-samurocket-color); }

/* Optional category hints */
.item-representation.cat-damage { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.item-representation.cat-range { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }

/* Style for the item being actively dragged */
.item-representation.dragging {
    cursor: grabbing; 
}

/* NEW: Utility classes for Inventory Section styling */
.section-border-primary { border-color: var(--stage-slingapult-color) !important; }
.section-border-secondary { border-color: var(--stage-sorcerarcher-color) !important; }
.section-border-tertiary { border-color: var(--stage-samurocket-color) !important; }
.section-border-general { border-color: var(--text-secondary) !important; }

.section-label-primary { color: var(--stage-slingapult-color) !important; }
.section-label-secondary { color: var(--stage-sorcerarcher-color) !important; }
.section-label-tertiary { color: var(--stage-samurocket-color) !important; }
.section-label-general { color: var(--text-secondary) !important; }