/* CSS Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    background-color: #EEEEEE;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin: 0;
}

#central_column {
    width: 100%;
    max-width: 500px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

#combat { 
    flex-grow: 1; /* Toma todo el espacio restante */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#enemy, #character {
    /*flex: 1; Ambos divs ocupan el 50% de la altura de #combate */
    display: flex;
    padding: 20px;
}

#character {
    margin-bottom: -10px;
}

#combat .avatar {
    min-height: 100px;
    min-width: 100px;
    max-height: 100px;
    max-width: 100px;
    background-image: url('../img/ui/top_bar/avatar/TopBar_Avatar_Frame.png');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -10px;
    margin-top: -10px;
}
#combat .avatar img {
    min-width: 72px;
    min-height: 72px;
    max-width: 72px;
    max-height: 72px;
}

#combat .stats_box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

#combat .stats_box .main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

#combat .stats_box .main .name {
    display: flex;
    align-items: center;
}

#combat .stats_box .main .status {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: right;
}

#combat .stats_box .main .status .active_status {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    background: no-repeat center/contain;
    background-position: center;
    background-size: contain;
    border-radius: 50%;
    color: white;
    text-shadow: 2px 2px 4px black;
    font-size: 0.9rem;
}

#combat .stats_box .health_value, #combat .stats_box .energy_value {
    display: flex;
    align-items: center;
    justify-content: right;
    width: 40px;
    height: 100%;
    padding-right: 3px;
}

#combat .stats_box .health, #combat .stats_box .energy {
    display: flex;
    align-items: center;
    width: 100%;
    color: white;
    border-radius: 3px;
    height: 14px;
}

#combat .stats_box .health {
    background: linear-gradient(to right, #4CAF50, #81C784);
}

#combat .stats_box .energy {
    background: linear-gradient(to right, #FFEB3B, #FFF176);
}

#combat .stats_box .combat_bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid #999999;
    border-radius: 5px;
}

#actions {
    display: flex;
    justify-content: space-evenly;
    background-color: #333333;
    padding: 18px 11px 11px 11px;
    align-items: center;
    font-size: 0.8rem;
    line-height: 130%;
    height: 80px;
    background-image: url('../img/ui/action_bar/skill_bar_back.png');
    background-size: cover;
}

#actions .action, #actions .action_run {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    cursor: pointer;
    background-image: url('../img/ui/action_bar/action_back.png');
    background-size: cover;
}

#actions .separator {
    background-image: url('../img/ui/action_bar/skill_bar_separator.png');
    background-size: cover;
    width: 15px;
    height: 43px;
}

#actions .action_run {
    width: 36px;
    height: 36px;
}

#actions .action_run img {
    width: 22px;
    height: 22px;
}

#actions .action img {
    width: 33px;
    height: 33px;
}

#enemy_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    font-size: 0.8rem;
    line-height: 130%;
}

#enemy_actions .enemy_action img {
    border-radius: 5px;
    border: 1px solid #333333;
}

#combat_feed {
    display: flex;
    flex-direction: column;
    line-height: 130%;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #000000;
    height: 80px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #000000 #FFFFFF;
}

#combat_feed .feed_item {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

#combat_feed .feed_item img {
    width: 20px;
    height: 20px;
}

strong {
    font-weight: 700;
}

/* TOOLTIP */

.tooltip {
    position: absolute;
    background-color: black;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap; /* Prevents the tooltip from wrapping */
    z-index: 1000;
    line-height: 140%;
}

.tooltip .titulo_tooltip {
    font-weight: 700;
    font-size: 1rem;
}

.tooltip .descripcion_tooltip {
    color: #CCCCCC;
    margin-bottom: 10px;
}

.tooltip-trigger {
    position: relative;
    user-select: none; /* Evita la selección de texto */
    -webkit-user-select: none; /* Safari */
    -webkit-touch-callout: none; /* Evita el menú contextual en iOS */
    pointer-events: auto; /* Permitir la interacción normal */
}

.tooltip-trigger img {
    pointer-events: none; /* Deshabilitar interacciones con imágenes en iOS */
}

/* Optional: Style for tooltip triggers */
.tooltip-trigger:hover, 
.tooltip-trigger:active {
    cursor: pointer;
}

/* Animaciones para los avatares */
@keyframes attack {
    0% { transform: translateY(0); }
    20% { transform: translateY(3px); }  /* Ligero movimiento hacia abajo */
    60% { transform: translateY(-8px); } /* Mayor movimiento hacia arriba */
    100% { transform: translateY(0); }
}

@keyframes receive-attack {
    0% { transform: translateX(0); filter: brightness(100%); }
    25% { transform: translateX(-5px); filter: brightness(150%) sepia(100%) saturate(200%) hue-rotate(-45deg); }
    75% { transform: translateX(5px); filter: brightness(150%) sepia(100%) saturate(200%) hue-rotate(-45deg); }
    100% { transform: translateX(0); filter: brightness(100%); }
}

@keyframes heal {
    0%, 100% { filter: brightness(100%); }
    50% { filter: brightness(150%) sepia(50%) hue-rotate(80deg); }
}

@keyframes energize {
    0%, 100% { filter: brightness(100%); }
    50% { filter: brightness(150%) sepia(100%) hue-rotate(0deg); }
}

#combat .avatar.attack { 
    animation: attack 0.6s ease-in-out; 
}

#combat .avatar.receive-attack {
    animation: receive-attack 0.5s ease-in-out;
}

#combat .avatar.heal { 
    animation: heal 1s ease-in-out; 
}

#combat .avatar.energize { 
    animation: energize 1s ease-in-out; 
}