/* ========================================
   CONTENEDOR PRINCIPAL DE RESULTADOS
   ======================================== */
.loot-results-container {
    max-width: 1000px;
    margin: 10px auto;
    padding: 5px;
}

/* ========================================
   SECCIONES GENERALES
   ======================================== */
.loot-section {
    margin-bottom: 15px;
}

.loot-section h3 {
    text-decoration: underline;
    margin: 0;
    font-size: 18px;
    text-align: center;
    color: #333;
}

.loot-section h4 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

/* ========================================
   FORMULARIO PRINCIPAL
   ======================================== */
#analyzer {
    resize: none;
}

.loot-form-container {
    margin: 0;
    padding: 0;
    line-height: normal;
}

.textareaForm {
    width: 100%;
    height: 200px;
    min-height: 150px;
    padding: 10px;
    border: transparent;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

/* ========================================
   BLOQUE: INFORMACIÓN DE SESIÓN
   ======================================== */
.loot-session-block {
    text-align: center;
    background: transparent !important;
    padding: 0;
    border-radius: 5px;
    margin-bottom: 15px;
}

.loot-session-block p {
    margin: 5px 0 !important;
    line-height: 1.6;
    word-wrap: break-word;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center;
}

/* Subclase: Columna de etiquetas (Fecha, Duración, Balance, Loot Total) */
.loot-session-label {
    text-align: right;
    font-weight: bold;
}

/* Subclase: Columna de valores */
.loot-session-value {
    text-align: left;
}

/* ========================================
   BLOQUE: TARJETAS DE JUGADORES
   ======================================== */
.loot-players-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.loot-player-card {
    text-align: left;
    padding: 5px;
    background: #dddddd;
    border-radius: 5px;
}

.loot-player-card h4 {
}

.loot-player-card p {
    margin: 5px 0 !important;
    font-size: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
}

/* Subclase: Columna de etiquetas (Loot, Supplies, Balance) */
.loot-player-label {
    text-align: right;
    font-weight: bold;
}

/* Subclase: Columna de valores */
.loot-player-value {
    text-align: left;
}

/* ========================================
   BLOQUE: DAÑO Y SANACIÓN
   ======================================== */
.loot-damage-healing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 10px;
}

/* BLOQUE: DAÑO */
.loot-damage-block {
    text-align: left;
}

.loot-damage-block h3 {
    margin-top: 0;
}

.loot-damage-block p {
    margin: 5px 0 !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center;
}

/* Subclase: Columna de nombres de jugadores */
.loot-damage-name {
    text-align: right;
    font-weight: bold;
}

/* Subclase: Columna de porcentajes */
.loot-damage-percentage {
    text-align: left;
}

/* BLOQUE: SANACIÓN */
.loot-healing-block {
    text-align: left;
}

.loot-healing-block h3 {
    margin-top: 0;
}

.loot-healing-block p {
    margin: 5px 0 !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center;
}

/* Subclase: Columna de nombres de jugadores */
.loot-healing-name {
    text-align: right;
    font-weight: bold;
}

/* Subclase: Columna de porcentajes */
.loot-healing-percentage {
    text-align: left;
}

/* ========================================
   BLOQUE: TRANSFERENCIAS
   ======================================== */
.loot-transfers-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.loot-transfer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin: 5px 0;
    background: #f9f9f9;
    border: 1px solid #dddddd;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.loot-transfer-item:hover {
    background: #f0f0f0;
}

.loot-transfer-text {
    flex: 1;
    text-align: center;
    font-size: 14px;
}

.loot-transfer-copy {
    flex-shrink: 0;
    margin-left: 15px;
}

/* ========================================
   BOTÓN DE COPIAR OPTIMIZADO
   ======================================== */
.loot-copy-btn {
    background: linear-gradient(135deg, rgba(49, 67, 226, 0.9) 0%, #3143e2 100%);
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loot-copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.loot-copy-btn:hover::before {
    width: 100px;
    height: 100px;
}

.loot-copy-btn:hover {
    box-shadow: 0 4px 12px rgba(49, 67, 226, 0.5);
}

.loot-copy-btn:active {
    box-shadow: 0 2px 6px rgba(49, 67, 226, 0.4);
}

.loot-copy-btn svg {
    color: white;
    z-index: 1;
    transition: transform 0.3s ease;
}

.loot-copy-btn:hover svg {
    transform: scale(1.1);
}

.loot-copy-btn.copied {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.loot-copy-btn.copied svg {
    animation: checkPulse 0.5s ease;
}

@keyframes checkPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ========================================
   UTILIDADES Y COLORES
   ======================================== */
/* Colores para valores positivos y negativos */
.loot-positive {
    color: #10aa10;
    font-weight: 500;
}

.loot-negative {
    color: #dd0000;
    font-weight: 500;
}

/* Color para el mayor daño */
.loot-max-damage {
    color: #dd0000;
    font-weight: bold;
}

/* Color para la mayor sanación */
.loot-max-healing {
    color: rgb(49, 67, 226);
    font-weight: bold;
}

/* Icono de moneda */
.loot-gold-icon {
    width: 10px;
    height: auto;
    vertical-align: baseline;
    margin-right: 5px;
    margin-bottom: 0 !important;
}

/* ========================================
   BOTONES (SUBMIT Y BUTTON)
   ======================================== */
.loot-actions {
    text-align: center;
    margin-top: 20px;
}

input[type="submit"],
input[type="button"].loot-button,
.botonBless,
.botonPlayers,
.botonCost {
    font-size: 13px !important;
    background-color: rgba(49, 67, 226, 0.8) !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    color: #fff !important;
    font-weight: normal !important;
    margin: 10px 5px 5px;
}

input[type="button"].loot-button,
.botonBless,
.botonPlayers,
.botonCost {
    font-size: 13px !important;
    background-color: rgba(49, 67, 226, 0.8) !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    border: none !important;
    padding: 10px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    color: #fff !important;
    font-weight: normal !important;
    margin: 31px 5px 5px !important;
}

input[type="submit"]:hover,
input[type="button"].loot-button:hover,
.botonBless:hover,
.botonPlayers:hover,
.botonCost:hover {
    background-color: #3143e2 !important;
}

input[type="submit"]:active,
input[type="button"].loot-button:active,
.botonBless:active,
.botonPlayers:active,
.botonCost:active {
}

/* Botón de reiniciar con estilo diferenciado */
#resetButton {
    background-color: #dc3545 !important;
}

#resetButton:hover {
    background-color: #c82333 !important;
}

/* ========================================
   POPUPS Y OVERLAYS
   ======================================== */
#blessPopup,
#levelPopup,
#eliminarPopup,
#costPopup,
#extraCostPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 5px;
    min-width: 300px;
    max-width: 600px;
    animation: fadeIn 0.3s ease;
}

/* Z-index especial para popups secundarios */
#levelPopup,
#extraCostPopup {
    z-index: 1001;
}

#blessPopup h3,
#levelPopup h3,
#eliminarPopup h3,
#costPopup h3,
#extraCostPopup h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

#popupOverlay,
#levelPopupOverlay,
#eliminarPopupOverlay,
#costPopupOverlay,
#extraCostOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Z-index especial para overlays secundarios */
#levelPopupOverlay,
#extraCostOverlay {
    z-index: 1000;
}

/* ========================================
   CLASES PARA ELEMENTOS DENTRO DE POPUPS
   ======================================== */

/* Contenedor de checkboxes */
.popup-checkbox-container {
    margin-bottom: 15px;
}

/* Labels dentro de popups */
#blessPopup label,
#levelPopup label,
#eliminarPopup label,
#costPopup label,
#extraCostPopup label {
    display: block;
    margin: 5px 0;
    color: #333;
}

/* Labels con más espaciado */
.popup-label-spaced {
    margin: 10px 0 !important;
}

/* Título de label (para nombres de jugadores en addCost) */
.popup-label-title {
    margin-bottom: 5px;
    font-weight: bold;
}

/* Flex row (para bless.js: nombre + input) */
.popup-flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Flex group (para addCost.js: múltiples inputs) */
.popup-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Span con ancho fijo (para nombres en bless.js) */
.popup-label-fixed {
    min-width: 150px;
}

/* Input flexible (flex: 1) */
.popup-input-flex {
    flex: 1;
}

/* Input con ancho mínimo */
.popup-input-min {
    min-width: 100px;
}

/* Estilos para inputs dentro de popups */
#blessPopup input[type="checkbox"],
#levelPopup input[type="checkbox"],
#eliminarPopup input[type="checkbox"],
#costPopup input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#levelPopup input[type="number"],
#extraCostPopup input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#levelPopup input[type="number"]:focus,
#extraCostPopup input[type="number"]:focus {
    outline: none;
    border-color: rgba(49, 67, 226, 0.8);
}

#levelPopup input[type="number"]:invalid,
#extraCostPopup input[type="number"]:invalid {
    border-color: #dd0000;
}

/* Botones dentro de popups */
#blessPopup input[type="button"],
#levelPopup input[type="button"],
#eliminarPopup input[type="button"],
#costPopup input[type="button"],
#extraCostPopup input[type="button"] {
    font-size: 13px !important;
    background-color: rgba(49, 67, 226, 0.8) !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    color: #fff !important;
    font-weight: normal !important;
    margin: 10px 5px 5px;
}

#blessPopup input[type="button"]:hover,
#levelPopup input[type="button"]:hover,
#eliminarPopup input[type="button"]:hover,
#costPopup input[type="button"]:hover,
#extraCostPopup input[type="button"]:hover {
    background-color: #3143e2 !important;
}

/* ========================================
   NOTIFICACIONES TOAST
   ======================================== */
.loot-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999999;
    pointer-events: none;
}

.loot-toast {
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    font-size: 14px;
    line-height: 1.4;
}

.loot-toast.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.loot-toast.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.loot-toast.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
}

.loot-toast.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.loot-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.loot-toast-message {
    flex: 1;
}

.loot-toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.loot-toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.loot-toast.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media screen and (max-width: 768px) {
    .loot-results-container {
        padding: 15px;
    }
    
    .loot-section {
        margin-bottom: 20px;
    }
    
    .loot-session-block p {
        font-size: 13px;
        gap: 10px;
    }
    
    .loot-players-block {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .loot-damage-healing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .loot-transfer-item {
        align-items: center;
        gap: 10px;
    }
    
    .loot-transfer-copy {
        margin-left: 0;
        align-self: center;
    }
    
    #blessPopup,
    #levelPopup,
    #eliminarPopup,
    #costPopup,
    #extraCostPopup {
        max-width: 90%;
        padding: 15px;
    }
    
    .loot-copy-btn {
        width: 35px;
        height: 35px;
    }
    
    .loot-copy-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .loot-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .loot-toast {
        min-width: auto;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .textareaForm {
        font-size: 12px;
    }
    
    .loot-section h3 {
        font-size: 16px;
    }
    
    .loot-section h4 {
        font-size: 14px;
    }
    
    .loot-session-block p {
        font-size: 12px;
    }
    
    .loot-player-card p {
        font-size: 12px;
    }
    
    .loot-transfer-text {
        font-size: 12px;
    }

    .loot-copy-btn {
        width: 32px;
        height: 32px;
    }
    
    .loot-copy-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   SCROLLBAR PERSONALIZADO (OPCIONAL)
   ======================================== */
#blessPopup::-webkit-scrollbar,
#levelPopup::-webkit-scrollbar,
#eliminarPopup::-webkit-scrollbar,
#costPopup::-webkit-scrollbar,
#extraCostPopup::-webkit-scrollbar {
    width: 8px;
}

#blessPopup::-webkit-scrollbar-track,
#levelPopup::-webkit-scrollbar-track,
#eliminarPopup::-webkit-scrollbar-track,
#costPopup::-webkit-scrollbar-track,
#extraCostPopup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#blessPopup::-webkit-scrollbar-thumb,
#levelPopup::-webkit-scrollbar-thumb,
#eliminarPopup::-webkit-scrollbar-thumb,
#costPopup::-webkit-scrollbar-thumb,
#extraCostPopup::-webkit-scrollbar-thumb {
    background: rgba(49, 67, 226, 0.6);
    border-radius: 10px;
}

#blessPopup::-webkit-scrollbar-thumb:hover,
#levelPopup::-webkit-scrollbar-thumb:hover,
#eliminarPopup::-webkit-scrollbar-thumb:hover,
#costPopup::-webkit-scrollbar-thumb:hover,
#extraCostPopup::-webkit-scrollbar-thumb:hover {
    background: rgba(49, 67, 226, 0.8);
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Ocultar elementos */
.hidden {
    display: none !important;
}

/* Espaciado */
.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}