/* Battle Stats Styles - Street Fighter Style */
#battle-stats {
    position: fixed;
    top: 70px; /* Position below the header */
    left: 0;
    width: 100%;
    background: rgba(0, 0, 20, 0.8);
    padding: 10px 20px; /* Reduced padding */
    border-bottom: 2px solid #4040ff;
    box-shadow: 0 0 15px rgba(64, 64, 255, 0.5);
    z-index: 90;
    backdrop-filter: blur(5px);
}

.stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 10px; /* Reduced gap */
}

.fighter-battle-stats {
    flex: 1;
    padding: 8px; /* Reduced padding */
    border-radius: 6px;
    background: rgba(20, 20, 40, 0.7);
    position: relative;
    border: 2px solid transparent; /* Add border on all sides */
    transition: all 0.2s ease;
}

.fighter-battle-stats.player {
    border-color: #60f0ff; /* Border on all sides */
    box-shadow: 0 0 10px rgba(96, 240, 255, 0.3);
}

.fighter-battle-stats.opponent {
    border-color: #ff6060; /* Border on all sides */
    box-shadow: 0 0 10px rgba(255, 96, 96, 0.3);
    text-align: right;
}

.fighter-battle-stats h3 {
    margin-bottom: 6px; /* Reduced margin */
    color: #60f0ff;
    font-size: 1.1rem; /* Slightly smaller font */
    text-shadow: 0 0 5px rgba(96, 240, 255, 0.7);
}

.fighter-battle-stats.player h3 {
    text-align: left;
}

.fighter-battle-stats.opponent h3 {
    color: #ff6060;
    text-shadow: 0 0 5px rgba(255, 96, 96, 0.7);
    text-align: right;
}

.battle-stat {
    margin-bottom: 6px; /* Reduced margin */
    display: flex;
    align-items: center;
}

.fighter-battle-stats.opponent .battle-stat {
    flex-direction: row-reverse;
}

.stat-label {
    font-weight: bold;
    color: #a0a0ff;
    margin: 0 8px; /* Reduced margin */
    min-width: 60px;
}

.fighter-battle-stats.opponent .stat-label {
    text-align: right;
}

.fighter-battle-stats.player .stat-bar {
    float: left;
}

.fighter-battle-stats.opponent .stat-bar {
    float: right;
}

/* Health bar color transitions */
.fighter-battle-stats.player .stat-bar.health {
    background: linear-gradient(to right, 
        hsl(calc(120 * var(--health-percent, 1)), 100%, 50%), 
        hsl(calc(120 * var(--health-percent, 1) - 15), 90%, 60%)
    );
    --health-percent: 1;
    transition: width 0.3s ease-out, --health-percent 0.3s ease-out;
}

.fighter-battle-stats.opponent .stat-bar.health {
    background: linear-gradient(to left, 
        hsl(calc(120 * var(--health-percent, 1)), 100%, 50%), 
        hsl(calc(120 * var(--health-percent, 1) - 15), 90%, 60%)
    );
    --health-percent: 1;
    transition: width 0.3s ease-out, --health-percent 0.3s ease-out;
}

/* Energy bar pulse animation */
@keyframes energyPulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.stat-bar.energy {
    animation: energyPulse 2s infinite;
}

.stat-bar-container {
    height: 16px; /* Reduced height */
}

.stat-bar-container span {
    position: absolute;
    color: white;
    font-size: 0.75rem; /* Smaller font */
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    top: 50%;
    transform: translateY(-50%);
}

.fighter-battle-stats.player .stat-bar-container span {
    right: 10px;
}

.fighter-battle-stats.opponent .stat-bar-container span {
    left: 10px;
}

.battle-stat-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px; /* Reduced margin */
    padding: 4px; /* Reduced padding */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.9rem; /* Smaller font */
}

.battle-stat-row .stat-label {
    width: auto;
    margin-right: 5px;
}

/* Add specific styling for opponent stat labels in battle-stat-row */
.fighter-battle-stats.opponent .battle-stat-row .stat-label {
    margin-right: 5px;
    margin-left: 0;
}

.vs-indicator {
    font-size: 1.3rem; /* Smaller font */
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.7);
    position: relative;
    width: 50px; /* Reduced width */
    text-align: center;
}

.vs-indicator::before,
.vs-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 15px; /* Reduced width */
    height: 2px;
    background: rgba(255, 204, 0, 0.5);
}

.vs-indicator::before {
    left: 0;
    transform: translateY(-50%);
}

.vs-indicator::after {
    right: 0;
    transform: translateY(-50%);
}

/* Adjust battle controls positioning */
#battle-controls {
    position: relative;
    z-index: 80;
    margin-top: 120px; /* Reduced margin to account for smaller stats bar */
    background: none;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    margin: auto;
    width: 90%;
    max-width: 500px;
}

#start-battle {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    background: linear-gradient(to bottom, #ff4040, #aa2020);
    border: 2px solid #ff6060;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

#start-battle:hover {
    background: linear-gradient(to bottom, #ff6060, #ff4040);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 64, 64, 0.7);
}

/* Timer element for future use */
.battle-timer {
    position: absolute;
    top: auto;
    bottom: -40px; /* Position it just below the battle stats */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px; /* Reduced padding */
    border-radius: 20px;
    font-size: 20px; /* Smaller font */
    font-weight: bold;
    text-align: center;
    border: 2px solid #4040ff;
    text-shadow: 0 0 5px #60f0ff;
    box-shadow: 0 0 15px rgba(64, 64, 255, 0.5);
    z-index: 100;
    transition: all 0.3s ease;
}

.turn-number {
    display: inline-block;
    padding: 0 10px;
    animation: pulse 2s infinite;
}

.action-buttons {
    position: absolute;
    top: 100%; /* Position it right below the battle stats */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
    margin-top: 10px; /* Small gap between battle stats and buttons */
    background-color: rgba(0, 0, 20, 0.8);
    border-radius: 10px;
    border: 2px solid #4040ff;
    box-shadow: 0 0 15px rgba(64, 64, 255, 0.5);
    z-index: 89; /* Just below the battle stats */
    backdrop-filter: blur(5px);
}

.action-button {
    padding: 12px 24px;
    border-radius: 8px;
    background: linear-gradient(to bottom, #3a3a8c, #1a1a4c);
    color: white;
    border: 1px solid #60f0ff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-button:hover {
    background: linear-gradient(to bottom, #4a4a9c, #2a2a5c);
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(96, 240, 255, 0.7);
}

.attack-button {
    background: linear-gradient(to bottom, #8c3a3a, #4c1a1a);
    border-color: #ff6060;
}

.attack-button:hover {
    background: linear-gradient(to bottom, #9c4a4a, #5c2a2a);
    box-shadow: 0 0 10px rgba(255, 96, 96, 0.7);
}

.defend-button {
    background: linear-gradient(to bottom, #3a8c3a, #1a4c1a);
    border-color: #60ff60;
}

.defend-button:hover {
    background: linear-gradient(to bottom, #4a9c4a, #2a5c2a);
    box-shadow: 0 0 10px rgba(96, 255, 96, 0.7);
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Add a hover effect to the fighter stats cards */
.fighter-battle-stats:hover {
    box-shadow: 0 0 15px rgba(96, 240, 255, 0.5);
    transform: translateY(-2px);
}

.fighter-battle-stats.opponent:hover {
    box-shadow: 0 0 15px rgba(255, 96, 96, 0.5);
}

/* Make the battle UI more compact on smaller screens */
@media (max-width: 768px) {
    #battle-stats {
        padding: 8px 10px;
    }
    
    .fighter-battle-stats {
        padding: 6px;
    }
    
    .fighter-battle-stats h3 {
        font-size: 1rem;
    }
    
    .battle-stat-row {
        font-size: 0.8rem;
    }
    
    .vs-indicator {
        font-size: 1.1rem;
        width: 40px;
    }
}