/* Database Battle Styles */
.database-battle {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.database-battle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.battle-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.battle-header h2 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: battleGradient 3s ease infinite;
    margin-bottom: var(--spacing-sm);
}

@keyframes battleGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.battle-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-xl);
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    position: relative;
    z-index: 1;
}

@media (max-width: 968px) {
    .battle-arena {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    .vs-symbol { order: 2; }
    .vector-fighter { order: 3; }
}

.fighter {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.sql-fighter {
    border-image: linear-gradient(135deg, #3b82f6, #1e40af) 1;
}

.vector-fighter {
    border-image: linear-gradient(135deg, #10b981, #059669) 1;
}

.fighter:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.fighter-avatar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    position: relative;
}

.sql-avatar {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.vector-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.fighter-stats h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.fighter-type {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-style: italic;
}

.power-bars {
    margin-top: var(--spacing-md);
}

.power-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.power-bar span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    min-width: 80px;
}

.bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 2s ease;
}

.fighter-demo {
    margin: var(--spacing-md) 0;
}

.demo-box {
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border-left: 4px solid;
}

.sql-fighter .demo-box {
    border-left-color: #3b82f6;
}

.vector-fighter .demo-box {
    border-left-color: #10b981;
}

.demo-box code {
    color: #fbbf24;
    font-weight: 600;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.demo-result {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.fighter-moves {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.move {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-sm);
    color: #4ade80;
    font-size: 0.85rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.move.weak {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.vs-symbol {
    text-align: center;
    position: relative;
}

.vs-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    position: relative;
    animation: pulse 2s infinite;
    box-shadow: 0 0 40px rgba(255, 107, 107, 0.5);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.lightning {
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 1.5rem;
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Battle Problem */
.battle-problem {
    background: rgba(255, 87, 34, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid rgba(255, 152, 0, 0.3);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.problem-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.problem-title h3 {
    color: #ff9800;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.ranking-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 768px) {
    .ranking-display {
        grid-template-columns: 1fr;
    }
}

.rank-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    border: 2px solid transparent;
    position: relative;
}

.rank-item.gold {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.rank-item.silver {
    border-color: #94a3b8;
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
}

.rank-item.bronze {
    border-color: #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.rank-item.correct {
    border-color: #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
}

.medal {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: var(--spacing-sm);
}

.content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: var(--spacing-xs);
}

.issue {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.issue.correct {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.problem-insight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    color: white;
    font-weight: 500;
}

.problem-insight i {
    color: #60a5fa;
    font-size: 1.2rem;
}

/* Battle Solution */
.battle-solution {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.05));
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.3);
    position: relative;
    z-index: 1;
}

.solution-header h3 {
    color: #10b981;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.solution-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.flow-step, .flow-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px;
}

.flow-result {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(34, 197, 94, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
}

.flow-step i, .flow-result i {
    font-size: 1.5rem;
    color: #10b981;
}

.flow-step span, .flow-result span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.flow-arrow {
    color: #60a5fa;
    font-size: 1.2rem;
    font-weight: 700;
}