/* Player Status Banner - Top-left corner character status display */

.player-status-banner {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.95), rgba(42, 82, 152, 0.95));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    padding: 12px 20px 12px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 350px;
}

.player-status-banner:hover {
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Portrait Section */
.status-portrait {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, #1a1a2e, #2a2a4e);
}

.status-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder when no portrait */
.status-portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

/* Level Badge */
.status-level-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    font-weight: bold;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    min-width: 32px;
    text-align: center;
}

/* Bars Container */
.status-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

/* Individual Bar */
.status-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-bar-label {
    font-weight: bold;
    font-size: 0.85em;
    min-width: 28px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-bar-container {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Bar Fill with Gradient */
.status-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* HP Bar - Red gradient */
.status-bar-fill.hp {
    background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.status-bar-fill.hp::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* SP Bar - Green gradient */
.status-bar-fill.sp {
    background: linear-gradient(90deg, #059669, #10b981, #34d399);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.status-bar-fill.sp::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2.5s infinite;
}

/* MP Bar - Blue gradient */
.status-bar-fill.mp {
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.status-bar-fill.mp::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

/* Bar Text (Current/Max values) */
.status-bar-text {
    position: relative;
    z-index: 1;
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.5px;
}

/* Shimmer animation for bar fills */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Low Health Warning - Pulsing red glow */
.player-status-banner.low-health {
    animation: lowHealthPulse 1.5s ease-in-out infinite;
    border-color: #dc2626;
}

.player-status-banner.low-health .status-portrait {
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.8), inset 0 0 10px rgba(220, 38, 38, 0.5);
}

@keyframes lowHealthPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(220, 38, 38, 0.6);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 40px rgba(220, 38, 38, 1);
    }
}

/* Critical Health - More intense pulsing */
.player-status-banner.critical-health {
    animation: criticalHealthPulse 0.8s ease-in-out infinite;
    border-color: #991b1b;
}

.player-status-banner.critical-health .status-portrait {
    border-color: #991b1b;
    animation: portraitShake 0.4s ease-in-out infinite;
}

@keyframes criticalHealthPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(153, 27, 27, 1);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 50px rgba(239, 68, 68, 1);
    }
}

@keyframes portraitShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* Hover Tooltip */
.status-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    min-width: 280px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.player-status-banner:hover .status-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.status-tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.status-tooltip-row:last-child {
    border-bottom: none;
}

.status-tooltip-label {
    color: rgba(255, 255, 255, 0.7);
}

.status-tooltip-value {
    color: #ffd700;
    font-weight: bold;
}

/* Character Name Display */
.status-character-name {
    position: absolute;
    top: -28px;
    left: 0;
    font-size: 0.9em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Bar value change animation */
@keyframes barIncrease {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5);
    }
    100% {
        filter: brightness(1);
    }
}

@keyframes barDecrease {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(0.7);
    }
    100% {
        filter: brightness(1);
    }
}

.status-bar-fill.increasing {
    animation: barIncrease 0.6s ease-out;
}

.status-bar-fill.decreasing {
    animation: barDecrease 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-status-banner {
        min-width: 300px;
        padding: 10px 15px 10px 10px;
        top: 10px;
        left: 10px;
    }

    .status-portrait {
        width: 64px;
        height: 64px;
    }

    .status-bars {
        gap: 6px;
        min-width: 180px;
    }

    .status-bar-container {
        height: 18px;
    }

    .status-bar-label {
        font-size: 0.75em;
        min-width: 24px;
    }

    .status-bar-text {
        font-size: 0.7em;
    }

    .status-character-name {
        font-size: 0.8em;
        top: -24px;
    }

    .status-tooltip {
        min-width: 240px;
        padding: 12px 16px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .player-status-banner {
        min-width: 260px;
        gap: 8px;
    }

    .status-portrait {
        width: 56px;
        height: 56px;
    }

    .status-bars {
        min-width: 150px;
    }

    .status-bar-container {
        height: 16px;
    }
}

/* Hide banner when character creation is active */
body.character-creation-active .player-status-banner {
    display: none;
}
