/* 战斗界面样式 */

#battle-view {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    position: relative;
    overflow: hidden;
}

#battle-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(74, 138, 200, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(138, 74, 200, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(200, 74, 138, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

#battle-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* 敌方区域 */
#enemy-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

#enemy-ai {
    transform: scaleX(-1); /* 翻转敌方AI精灵 */
}

/* 玩家区域 */
#player-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

/* AI精灵战斗样式 */
.battle-ai {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(74, 138, 200, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 300px;
}

.battle-ai:hover {
    border-color: #4a8ac8;
    box-shadow: 0 0 20px rgba(74, 138, 200, 0.3);
}

.battle-ai.damaged {
    animation: shake 0.5s ease-in-out;
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.battle-ai.healed {
    animation: heal 0.5s ease-in-out;
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

@keyframes heal {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* AI精灵图像 */
.ai-sprite {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #4a8ac8, #8a4ac8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 0 20px rgba(74, 138, 200, 0.5);
    position: relative;
    overflow: hidden;
}

.ai-sprite::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-sprite.logic {
    background: linear-gradient(45deg, #4a8ac8, #5a9ad8);
}

.ai-sprite.creative {
    background: linear-gradient(45deg, #8a4ac8, #9a5ad8);
}

.ai-sprite.learning {
    background: linear-gradient(45deg, #4ecdc4, #5eddd4);
}

.ai-sprite.social {
    background: linear-gradient(45deg, #ffd93d, #ffed4d);
}

.ai-sprite.computational {
    background: linear-gradient(45deg, #ff6b6b, #ff7b7b);
}

/* AI信息区域 */
.ai-info {
    flex: 1;
}

.ai-info h4 {
    color: #4a8ac8;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.ai-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-bar span {
    font-size: 0.8rem;
    color: #8a8a8a;
    min-width: 40px;
}

.bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a8ac8, #8a4ac8);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: flow 2s infinite;
}

@keyframes flow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 战斗控制区域 */
#battle-controls {
    background: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #4a8ac8;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

#skill-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.skill-btn {
    padding: 0.8rem;
    background: rgba(74, 138, 200, 0.2);
    border: 1px solid #4a8ac8;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.skill-btn:hover {
    background: rgba(74, 138, 200, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 138, 200, 0.3);
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.skill-btn.cooldown {
    position: relative;
}

.skill-btn.cooldown::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

.skill-name {
    font-weight: bold;
    margin-bottom: 0.3rem;
    color: #4a8ac8;
}

.skill-type {
    font-size: 0.7rem;
    color: #8a8a8a;
    margin-bottom: 0.3rem;
}

.skill-cost {
    font-size: 0.8rem;
    color: #ffd93d;
}

/* 战斗操作按钮 */
#battle-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.battle-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #4a8ac8, #8a4ac8);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(74, 138, 200, 0.3);
}

.battle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 138, 200, 0.5);
}

.battle-btn:active {
    transform: translateY(0);
}

.battle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#capture-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

#capture-btn:hover {
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.5);
}

#item-btn {
    background: linear-gradient(45deg, #ffd93d, #ffed4d);
    color: #333;
}

#item-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.5);
}

#run-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
}

#run-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.5);
}

/* 战斗效果 */
.battle-effect {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

.damage-text {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.heal-text {
    color: #4ecdc4;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
    animation: floatUp 1s ease-out forwards;
}

.status-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    animation: pulse 1s ease-out;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.status-effect.poison {
    background: radial-gradient(circle, rgba(255, 0, 0, 0.3), transparent);
}

.status-effect.paralyze {
    background: radial-gradient(circle, rgba(255, 255, 0, 0.3), transparent);
}

.status-effect.confuse {
    background: radial-gradient(circle, rgba(255, 0, 255, 0.3), transparent);
}

/* 战斗回合指示器 */
.turn-indicator {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #4a8ac8;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    z-index: 5;
}

/* 战斗日志 */
.battle-log {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #4a8ac8;
    border-radius: 8px;
    padding: 0.8rem;
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    z-index: 5;
}

.battle-log-entry {
    margin-bottom: 0.3rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(74, 138, 200, 0.2);
}

.battle-log-entry:last-child {
    border-bottom: none;
}

.battle-log-entry.player {
    color: #4ecdc4;
}

.battle-log-entry.enemy {
    color: #ff6b6b;
}

.battle-log-entry.system {
    color: #8a8a8a;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .battle-ai {
        min-width: 250px;
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .ai-sprite {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    #skill-buttons {
        grid-template-columns: 1fr;
    }
    
    #battle-actions {
        flex-direction: column;
    }
    
    .battle-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .battle-log {
        max-height: 80px;
        font-size: 0.7rem;
    }
} 