/* ===============================================
   Modal de Premios - Diseño Moderno con Cards
   =============================================== */

/* Backdrop */
#prizeDetailModal.modal {
    --bs-backdrop-opacity: 0.85;
}

/* Modal dialog */
#prizeDetailModal .modal-dialog {
    max-width: 500px;
    width: 90%;
}

/* Contenedor del modal - Fondo oscuro */
.prize-modal-content {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    background: var(--prize-modal-bg, #1a1d2e);
}

/* Botón cerrar - Minúsculo */
.prize-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.5);
    z-index: 10;
    border-radius: 8px;
}

.prize-modal-close svg {
    width: 20px;
    height: 20px;
}

.prize-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* Cuerpo del modal */
.prize-modal-body {
    padding: 2rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header - Título del sorteo con icono */
.prize-modal-label {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
    opacity: 1;
}

.prize-modal-label::before {
    content: "🏆";
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 2.25rem;
    align-self: stretch;
    line-height: 1;
}

/* Card HORARIO */
.prize-modal-time {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--prize-modal-time-bg, #2d2463);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.prize-modal-time::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.prize-modal-time svg {
    width: 56px;
    height: 56px;
    padding: 14px;
    background: var(--prize-modal-primary, #8b5cf6);
    border-radius: 12px;
    flex-shrink: 0;
    stroke: #ffffff;
    position: relative;
    z-index: 1;
}

.prize-modal-time-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
}

.prize-modal-time-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.prize-modal-time-value {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

/* Card PREMIO */
.prize-modal-name-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--prize-modal-prize-card-bg, #1a3d3a);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.prize-modal-name-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.prize-modal-icon {
    width: 56px;
    height: 56px;
    padding: 14px;
    background: var(--prize-modal-prize-icon-bg, #10b981);
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.prize-modal-icon svg {
    color: #ffffff;
    width: 28px;
    height: 28px;
}

.prize-modal-icon i {
    color: var(--prize-modal-icon-color, #ffffff);
    font-size: 28px;
}

/* Mostrar icono apropiado según tema */
.prize-modal-icon .icon-dark { display: none; }
[data-bs-theme="dark"] .prize-modal-icon .icon-light { display: none; }
[data-bs-theme="dark"] .prize-modal-icon .icon-dark { display: inline-block; }

.prize-modal-name-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.prize-modal-name-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.prize-modal-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--prize-modal-name-color, #ffffff);
    line-height: 1.2;
    word-wrap: break-word;
}

.prize-modal-name.has-solid {
    color: var(--prize-modal-name-color, #ffffff);
}

/* Botón gradiente */
.prize-modal-button {
    width: 100%;
    padding: 1.125rem 2rem;
    /* Gradiente fijo; solo cambia el color base si se define --prize-modal-btn-color */
    background: linear-gradient(
        135deg,
        color-mix(in oklab, var(--prize-modal-btn-color, #d946ef) 85%, white 15%) 0%,
        color-mix(in oklab, var(--prize-modal-btn-color, #3b82f6) 60%, black 40%) 100%
    );
    color: var(--prize-modal-btn-text, #ffffff);
    border: none;
    border-radius: 12px;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.prize-modal-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(217, 70, 239, 0.4);
}

.prize-modal-button:active {
    transform: translateY(0);
}

/* Animación de entrada */
.modal.fade .prize-modal-content {
    transform: scale(0.95) translateY(-20px);
    opacity: 0;
    transition: all 0.25s ease;
}

.modal.show .prize-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Responsivo Mobile */
@media (max-width: 576px) {
    #prizeDetailModal .modal-dialog {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .prize-modal-content {
        border-radius: 24px;
        margin: 1rem;
    }

    .prize-modal-body {
        padding: 1.5rem 1.25rem 1.25rem;
        gap: 1rem;
    }

    .prize-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 28px;
        height: 28px;
    }

    .prize-modal-close svg {
        width: 18px;
        height: 18px;
    }

    .prize-modal-label {
        font-size: 1.125rem;
        padding-right: 2.5rem;
    }

    .prize-modal-label::before {
        font-size: 1.875rem;
    }

    .prize-modal-time,
    .prize-modal-name-wrapper {
        padding: 1rem 1.125rem;
        gap: 0.875rem;
    }

    .prize-modal-time svg,
    .prize-modal-icon {
        width: 48px;
        height: 48px;
        padding: 11px;
    }

    .prize-modal-time svg {
        width: 48px;
        height: 48px;
    }

    .prize-modal-icon svg {
        width: 26px;
        height: 26px;
    }

    .prize-modal-icon i {
        font-size: 26px;
    }

    .prize-modal-time-label,
    .prize-modal-name-label {
        font-size: 0.625rem;
        letter-spacing: 1.2px;
    }

    .prize-modal-time-value {
        font-size: 1.625rem;
    }

    .prize-modal-name {
        font-size: 1.375rem;
    }

    .prize-modal-button {
        padding: 0.9375rem 1.75rem;
        font-size: 1rem;
        margin-top: 0.25rem;
    }
}

/* Tema claro */
[data-bs-theme="light"] #prizeDetailModal .prize-modal-content {
    background: var(--prize-modal-bg, #ffffff);
}

[data-bs-theme="light"] #prizeDetailModal .prize-modal-close {
    color: rgba(0, 0, 0, 0.5);
}

[data-bs-theme="light"] #prizeDetailModal .prize-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.8);
}

[data-bs-theme="light"] #prizeDetailModal .prize-modal-label {
    color: var(--bs-body-color);
}

/* Fallback para temas */
@media (prefers-color-scheme: light) {
    html:not([data-bs-theme="dark"]) #prizeDetailModal .prize-modal-content {
        background: var(--prize-modal-bg, #ffffff);
    }

    html:not([data-bs-theme="dark"]) #prizeDetailModal .prize-modal-close {
        color: rgba(0, 0, 0, 0.5);
    }

    html:not([data-bs-theme="dark"]) #prizeDetailModal .prize-modal-close:hover {
        background: rgba(0, 0, 0, 0.05);
        color: rgba(0, 0, 0, 0.8);
    }

    html:not([data-bs-theme="dark"]) #prizeDetailModal .prize-modal-label {
        color: var(--bs-body-color);
    }
}
