/* =========================================
   POPUP SYSTEM STYLES (ARANDOR THEME)
   ========================================= */

/* Variables de Color (Basadas en el tema CSS principal si es posible, o hardcoded) */
:root {
    --popup-bg: #1a1a2e;
    /* Fondo oscuro azulado */
    --popup-border: 2px solid #7b2cbf;
    /* Borde violeta */
    --popup-glow: 0 0 15px rgba(123, 44, 191, 0.5);
    --popup-text: #e0e0e0;
    --popup-accent: #9d4edd;
}

/* 1. Overlay (Fondo oscuro) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.hidden {
    display: none;
    pointer-events: none;
}

/* 2. Contenedor Principal */
.popup-container {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(40, 20, 60, 0.95));
    border: var(--popup-border);
    box-shadow: var(--popup-glow), inset 0 0 20px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--popup-text);
    font-family: 'Courier New', Courier, monospace;
    /* Acorde al estilo terminal */
}

/* 3. Header y Título */
.popup-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-bottom: 1px solid #5a189a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    margin: 0;
    font-size: 1.4rem;
    color: #c77dff;
    text-shadow: 0 0 5px #7b2cbf;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-close-x {
    background: none;
    border: none;
    color: #aa99aa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.popup-close-x:hover {
    color: #ff4d4d;
}

/* 4. Cuerpo y Contenido */
.popup-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.popup-image-container {
    margin-bottom: 20px;
    width: 100%;
    max-height: 350px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #5a189a;
    background-color: black;
}

.popup-image-container img {
    max-width: 100%;
    object-fit: fill;
    transition: opacity 0.3s;
}

.popup-game-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cccccc;
    width: 100%;
}

.popup-game-content strong {
    color: #e0aaff;
}

.popup-game-content ul {
    text-align: left;
    padding-left: 20px;
}

/* 5. Footer y Botones */
.popup-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid #5a189a;
    display: flex;
    justify-content: space-between;
    /* Distribuye espacio (Anterior <-> Siguiente) */
    align-items: center;
    gap: 10px;
}

/* Si solo hay un botón, centrarlo o usar margin-left auto */
.popup-footer:has(button:only-child) {
    justify-content: flex-end;
}

.btn-popup {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-primary {
    background-color: #5a189a;
    color: white;
    border-color: #7b2cbf;
    box-shadow: 0 0 10px rgba(123, 44, 191, 0.4);
}

.btn-primary:hover {
    background-color: #7b2cbf;
    box-shadow: 0 0 15px rgba(123, 44, 191, 0.8);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: #aaa;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: #ccc;
}

/* 6. Paginación (Puntos) */
.popup-pagination {
    display: flex;
    justify-content: center;
    padding-bottom: 10px;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.4);
}

.popup-dot {
    width: 8px;
    height: 8px;
    background-color: #444;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.popup-dot.active {
    background-color: #c77dff;
    box-shadow: 0 0 5px #c77dff;
}

/* 7. Utilidades y Animaciones */
.hidden {
    display: none !important;
}

/* Fade In Overlay */
.fade-in {
    opacity: 1 !important;
}

.fade-out {
    opacity: 0 !important;
}

/* Scale In Container */
.scale-in {
    transform: scale(1) !important;
}

.scale-out {
    transform: scale(0.9) !important;
}

.fade-out-quick {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

/* Media Queries para móviles */
@media (max-width: 600px) {
    .popup-container {
        width: 95%;
        max-height: 90vh;
    }

    .popup-title {
        font-size: 1.2rem;
    }
}