/* Character UI Styles */
#character-ui {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    z-index: 100;
    pointer-events: none; /* Allow clicks to pass through except on interactive elements */
}

/* Character Icon Container */
.character-icon-container {
    position: relative;
    pointer-events: auto;
}

.character-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-icon:hover {
    border-color: #666;
    transform: scale(1.05);
}

.character-icon-placeholder {
    font-size: 32px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.character-level {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    border: 2px solid #666;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Character Bars Container */
.character-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

/* Bar Container */
.bar-container {
    position: relative;
    pointer-events: auto;
}

.bar-background {
    width: 200px;
    height: 24px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #333;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Health Bar */
.health-bar {
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 50%, #990000 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.health-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}

/* Resource Bar (Mana/Energy/Rage) */
.resource-bar {
    background: linear-gradient(180deg, #4444ff 0%, #0000cc 50%, #000099 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.resource-bar.rage {
    background: linear-gradient(180deg, #ff8844 0%, #cc4400 50%, #993300 100%);
}

.resource-bar.energy {
    background: linear-gradient(180deg, #ffff44 0%, #cccc00 50%, #999900 100%);
}

.resource-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}

/* Bar Text */
.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

.bar-separator {
    margin: 0 2px;
    opacity: 0.8;
}

/* Resource Label */
.resource-label {
    position: absolute;
    bottom: -18px;
    left: 0;
    font-size: 11px;
    color: #aaa;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

/* Class-specific icon colors */
.character-icon.warrior {
    border-color: #cc4400;
}

.character-icon.mage {
    border-color: #4444ff;
}

.character-icon.rogue {
    border-color: #ffff44;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bar-container.low-health .bar-fill {
    animation: pulse 1s ease-in-out infinite;
}

/* Hide on mobile or small screens */
@media (max-width: 768px) {
    #character-ui {
        top: 10px;
        left: 10px;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    .character-bars {
        min-width: 150px;
    }
    
    .bar-background {
        width: 150px;
        height: 20px;
    }
}