/* Overlay container */
#overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Details button and Statistics button */
#details-button, #statistics-button {
    position: absolute;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

#details-button {
    left: 20px;
    opacity: 1;
    transform: scale(1);
}

#statistics-button {
    left: 80px;
}

#details-button.visible, #statistics-button.visible {
    opacity: 1;
    transform: scale(1);
}

#details-button:hover, #statistics-button:hover {
    background: linear-gradient(135deg, #9d66ff 0%, #8b45ff 100%);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.6);
    transform: scale(1.05);
}

#details-button:active, #statistics-button:active {
    transform: scale(0.95);
}

/* Button icon */
#button-icon, #stats-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
}

#details-button:hover #button-icon, #statistics-button:hover #stats-icon {
    transform: scale(1.1);
}

/* Popup window shared styles */
#popup-window, #info-popup-window {
    position: absolute;
    background: rgba(18, 18, 18, 0.95);
    border: 2px solid #8b5cf6;
    border-radius: 16px;
    padding: 24px;
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
}

/* Statistics Popup (Full screen minus margins) */
#popup-window {
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 90px;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

#popup-window.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

#popup-window.closing {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s ease;
}

/* Info Popup (Centered, 60% width, ~90% of stats popup height) */
#info-popup-window {
    width: 60%;
    height: calc(80% - 88px);
    top: calc(50% - 35px);
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2000; /* Always on top */
}

#info-popup-window.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    visibility: visible;
}

#info-popup-window.closing {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s ease;
}

/* Popup content containers */
#popup-window {
    display: flex;
    flex-direction: row;
}

#info-popup-window {
    display: block;
    overflow-y: auto;
}

#info-content {
    color: #ddd;
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    padding: 5px;
    line-height: 1.6;
}

#info-content h2 {
    color: #8b5cf6;
    margin-top: 0;
}

#info-content ul {
    padding-left: 20px;
}

#info-content li {
    margin-bottom: 8px;
}

#info-content a.paper-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid #8b5cf6;
    color: #8b5cf6;
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#info-content a.paper-link:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: transparent;
    color: #fff;
}

#info-content a.paper-link:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

#stat-1, #stat-2 {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    color: #ddd;
    font-family: Inter, Arial, sans-serif; /* fuente del popup */
    font-size: 14px;
    position: relative;
    padding: 5px;
}

/* #stat-1 {
    border-right: 1px solid rgba(139, 92, 246, 0.3);
} */

/* Custom scrollbar for popup content */
#stat-1::-webkit-scrollbar,
#stat-2::-webkit-scrollbar,
#info-popup-window::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#stat-1::-webkit-scrollbar-track,
#stat-2::-webkit-scrollbar-track,
#info-popup-window::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

#stat-1::-webkit-scrollbar-thumb,
#stat-2::-webkit-scrollbar-thumb,
#info-popup-window::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

#stat-1::-webkit-scrollbar-thumb:hover,
#stat-2::-webkit-scrollbar-thumb:hover,
#info-popup-window::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

#stat-1::-webkit-scrollbar-corner,
#stat-2::-webkit-scrollbar-corner,
#info-popup-window::-webkit-scrollbar-corner {
    background: rgba(18, 18, 18, 0.95);
}

#stat-1,
#stat-2,
#info-popup-window {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) rgba(139, 92, 246, 0.1);
}
