/* halo_info_popup Overlay */
.halo_info_popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.halo_info_popup-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* halo_info_popup Container */
.halo_info_popup-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 16px;
    max-width: 750px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

/* halo_info_popup Header - FIXED */
.halo_info_popup-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.halo_info_popup-title-section {
    flex: 1;
    min-width: 0; /* Allow text to shrink */
    padding-right: 0.5rem; /* Add spacing from close button */
}

.halo_info_popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap; /* Allow wrapping if needed */
    word-break: break-word; /* Break long words */
    overflow-wrap: break-word; /* Ensure long titles wrap */
}

.halo_info_popup-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin: 0;
    word-break: break-word;
}

.halo_info_popup-close {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 36px;
    height: 36px;
    min-width: 36px; /* Prevent shrinking */
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Never shrink */
    font-weight: 300;
}

.halo_info_popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* halo_info_popup Body */
.halo_info_popup-body {
    padding: 2rem;
}

.halo_info_popup-section {
    margin-bottom: 1.5rem;
}

.halo_info_popup-section:last-child {
    margin-bottom: 0;
}

.halo_info_popup-section-title {
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.halo_info_popup-section-content {
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.6;
}

.halo_info_popup-section-content.empty {
    color: #64748b;
    font-style: italic;
}

/* halo_info_popup Badges */
.halo_info_popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.halo_info_popup-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.halo_info_popup-badge-mode {
    background: rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.halo_info_popup-badge-halo {
    background: rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.halo_info_popup-badge-mlg {
    background: rgba(251, 191, 36, 0.3);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.halo_info_popup-badge-favorite {
    background: rgba(236, 72, 153, 0.3);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f9a8d4;
}

.halo_info_popup-badge img {
    width: 16px;
    height: 16px;
}

/* halo_info_popup Footer */
.halo_info_popup-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.halo_info_popup-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.halo_info_popup-btn-primary {
    background: #45809e;
    color: #fff;
    border-color: #3b82f6;
}

.halo_info_popup-btn-primary:hover {
    background: #4595a0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.halo_info_popup-btn-secondary {
    background: rgb(22, 92, 142);
    color: #ffffff;
    border-color: #475569;
    text-decoration: none;
}

.halo_info_popup-btn-secondary:hover {
    background: rgba(22, 92, 142, 0.5);
    text-decoration: none;
}

/* Make list items clickable */
.game-item {
    cursor: pointer;
    user-select: none;
}

.game-item:hover {
    background: rgba(96, 165, 250, 0.15) !important;
}

.halo_info_popup-btn img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 0.5rem;
    display: inline-block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .halo_info_popup-container {
        max-height: 90vh;
        margin: 1rem;
    }

    .halo_info_popup-header {
        padding: 1.5rem;
    }

    .halo_info_popup-body {
        padding: 1.5rem;
    }

    .halo_info_popup-title {
        font-size: 1.5rem;
    }

    .halo_info_popup-footer {
        flex-direction: column;
    }

    .halo_info_popup-btn {
        width: 100%;
    }
}