/**
 * D&D AI RPG - Hotbar/Quick Slots System Styles
 * Bottom bar for quick access to items, spells, and abilities
 */

/* Hotbar Container */
.hotbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    transition: all 0.3s ease;
}

.hotbar.collapsed {
    transform: translateX(-50%) translateY(60px);
}

.hotbar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.hotbar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toggle Button */
.hotbar-toggle {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 2px solid #3498db;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 5px 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.hotbar-toggle:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(41, 128, 185, 0.3) 100%);
}

.toggle-icon {
    color: #3498db;
    font-size: 12px;
    display: inline-block;
    transition: transform 0.3s;
}

/* Slots Container */
.hotbar-slots {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.98) 100%);
    border: 2px solid #3498db;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
}

/* Individual Slot */
.hotbar-slot {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotbar-slot:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.2);
    transform: translateY(-3px);
}

.hotbar-slot.drag-over {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.3);
    transform: scale(1.05);
}

/* Slot Content */
.hotbar-slot-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotbar-slot-content.empty {
    opacity: 0.3;
}

.hotbar-slot-empty {
    font-size: 20px;
    color: #555;
}

/* Hotbar Item */
.hotbar-item {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #2ecc71;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: grab;
    transition: all 0.2s;
}

.hotbar-item:hover {
    transform: scale(1.1);
}

.hotbar-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.hotbar-item-icon {
    font-size: 24px;
}

.hotbar-item-quantity {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 4px;
    min-width: 14px;
    text-align: center;
}

/* Slot Key Label */
.hotbar-slot-key {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 9px;
    color: #f39c12;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 3px;
    border-radius: 3px;
}

/* Cooldown Overlay */
.hotbar-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    pointer-events: none;
    border-radius: 0 0 6px 6px;
}

/* Type-specific borders */
.hotbar-slot-content.type-item .hotbar-item {
    border-color: #2ecc71;
}

.hotbar-slot-content.type-spell .hotbar-item {
    border-color: #9b59b6;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
}

.hotbar-slot-content.type-ability .hotbar-item {
    border-color: #f39c12;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

.hotbar-slot-content.type-consumable .hotbar-item {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

/* Tooltip */
.hotbar-slot:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 1000;
}

/* Combat Active - Show indicator */
.hotbar.combat-active .hotbar-slots {
    border-color: #e74c3c;
}

.hotbar.combat-active .hotbar-slot-key {
    color: #95a5a6;
}

/* Responsive */
@media (max-width: 768px) {
    .hotbar-slots {
        padding: 8px 10px;
        gap: 3px;
    }
    
    .hotbar-slot {
        width: 40px;
        height: 40px;
    }
    
    .hotbar-item {
        width: 32px;
        height: 32px;
    }
    
    .hotbar-item-icon {
        font-size: 18px;
    }
    
    .hotbar-slot-key {
        font-size: 8px;
    }
}

@media (max-width: 500px) {
    .hotbar-slots {
        flex-wrap: wrap;
        max-width: 230px;
        justify-content: center;
    }
}

/* Animation for adding items */
@keyframes hotbarAdd {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.hotbar-item.new {
    animation: hotbarAdd 0.3s ease;
}

/* Glow effect for ready items */
@keyframes readyGlow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 15px currentColor;
    }
}

.hotbar-item.ready {
    animation: readyGlow 2s ease-in-out infinite;
}
