/* =====================================================
   LAPOZÓS RPG - Harc stílusok
   ===================================================== */

/* Combat Modal */
.combat-arena {
    width: 900px;
    max-width: 95vw;
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1a1a 50%, #1a0a0a 100%);
    border: 2px solid #8b0000;
    box-shadow:
        0 0 50px rgba(139, 0, 0, 0.5),
        inset 0 0 100px rgba(139, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

/* Header */
.combat-header {
    background: linear-gradient(90deg, #8b0000, #cc0000, #8b0000);
    padding: 20px;
    text-align: center;
}

.combat-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    letter-spacing: 3px;
}

/* Combat Field */
.combat-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    gap: 30px;
}

/* Combatant */
.combatant {
    flex: 1;
    text-align: center;
    padding: 20px;
}

.combatant-portrait {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 4px solid;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.player-side .combatant-portrait {
    border-color: #4169e1;
    box-shadow: 0 0 30px rgba(65, 105, 225, 0.5);
}

.enemy-side .combatant-portrait {
    border-color: #dc143c;
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.5);
}

.combatant-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.combatant-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #fff;
}

.combatant-hp-bar {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.combatant-hp-bar .hp-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.player-side .hp-fill {
    background: linear-gradient(90deg, #4169e1, #6495ed);
}

.enemy-side .hp-fill {
    background: linear-gradient(90deg, #dc143c, #ff4500);
}

.combatant-hp-text {
    margin-top: 8px;
    font-size: 1rem;
    color: #ccc;
}

/* Combat Center - VS & Dice */
.combat-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.vs-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: vsPulse 2s ease-in-out infinite;
}

@keyframes vsPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Combat Log */
.combat-log {
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.combat-log-entry {
    padding: 8px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 0.95rem;
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.combat-log-entry.player-action {
    background: rgba(65, 105, 225, 0.2);
    border-left: 3px solid #4169e1;
}

.combat-log-entry.enemy-action {
    background: rgba(220, 20, 60, 0.2);
    border-left: 3px solid #dc143c;
}

.combat-log-entry.victory {
    background: rgba(46, 213, 115, 0.2);
    border-left: 3px solid #2ed573;
    color: #2ed573;
}

.combat-log-entry.defeat {
    background: rgba(255, 71, 87, 0.2);
    border-left: 3px solid #ff4757;
    color: #ff4757;
}

.combat-log-entry .damage {
    font-weight: 700;
    color: #ff4757;
}

.combat-log-entry .roll {
    color: #ffd700;
}

/* Combat Actions */
.combat-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
}

.btn-combat {
    padding: 16px 40px;
    font-size: 1.2rem;
    font-family: var(--font-display);
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-attack {
    background: linear-gradient(135deg, #cc0000, #8b0000);
    color: white;
    box-shadow: 0 5px 20px rgba(204, 0, 0, 0.5);
}

.btn-attack:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(204, 0, 0, 0.7);
}

.btn-attack:active {
    transform: translateY(0);
}

.btn-flee {
    background: linear-gradient(135deg, #666, #444);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.btn-flee:hover {
    background: linear-gradient(135deg, #888, #666);
    transform: translateY(-3px);
}

.btn-combat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Damage Animation */
.combatant.damaged {
    animation: damageShake 0.5s ease;
}

@keyframes damageShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.combatant.damaged .combatant-portrait {
    animation: damageFlash 0.3s ease;
}

@keyframes damageFlash {
    0%, 100% { filter: none; }
    50% { filter: brightness(2) saturate(0); }
}

/* Damage Number Popup */
.damage-popup {
    position: absolute;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #ff4757;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: damageFloat 1s ease-out forwards;
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

.damage-popup.heal {
    color: #2ed573;
}

.damage-popup.critical {
    color: #ffd700;
    font-size: 2.5rem;
}

/* Victory/Defeat Overlay */
.combat-result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    animation: resultFadeIn 0.5s ease;
}

@keyframes resultFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.combat-result-overlay h2 {
    font-family: var(--font-display);
    font-size: 4rem;
    margin-bottom: 20px;
    animation: resultPop 0.5s ease 0.2s both;
}

@keyframes resultPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.combat-result-overlay.victory h2 {
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.combat-result-overlay.defeat h2 {
    color: #ff4757;
    text-shadow: 0 0 30px rgba(255, 71, 87, 0.8);
}

.combat-rewards {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    animation: resultSlideUp 0.5s ease 0.4s both;
}

@keyframes resultSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 10px;
}

.reward-item .icon {
    font-size: 1.5rem;
}

.reward-item .value {
    font-size: 1.3rem;
    font-weight: 600;
}

.btn-continue {
    margin-top: 30px;
    padding: 15px 40px;
    background: var(--color-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: resultSlideUp 0.5s ease 0.6s both;
}

.btn-continue:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.5);
}

/* Boss modifiers */
.enemy-side.boss .combatant-portrait {
    width: 180px;
    height: 180px;
    border-width: 5px;
    animation: bossGlow 2s ease-in-out infinite;
}

@keyframes bossGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.5);
    }
    50% {
        box-shadow: 0 0 50px rgba(220, 20, 60, 0.8), 0 0 80px rgba(255, 0, 0, 0.4);
    }
}

.enemy-side.boss .combatant-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.enemy-side.boss .combatant-name::before {
    content: '👑 ';
}

/* Flee damage indicator */
.flee-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    animation: fadeInScale 0.3s ease;
    z-index: 100;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.flee-result h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.flee-result.success h3 {
    color: #2ed573;
}

.flee-result.fail h3 {
    color: #ff4757;
}

/* Reszponzív */
@media (max-width: 768px) {
    .combat-arena {
        width: 100%;
        max-height: 100vh;
    }

    .combat-field {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .combatant-portrait {
        width: 100px;
        height: 100px;
    }

    .combat-center {
        order: -1;
    }

    .vs-text {
        font-size: 1.5rem;
    }

    .combat-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-combat {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
}
