﻿.statistics-modal-overlay {
    position: absolute;
    top: 15px;
    bottom: 50px; /* Add bottom spacing to account for primaryControls */
    width: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease-in-out;
}

/* For screens wider than 768px (when ad banner is visible) */
@media (min-width: 769px) {
    .statistics-modal-overlay {
        width: calc(100% - 302px);
        /* Subtract ad banner width */
    }
}

.statistics-modal-overlay.visible {
    background: rgba(0, 0, 0, 0.0);
}

.statistics-modal {
    background-color: #fff;
    border-radius: 10px;
    width: 99%;
    height: 100%; /* Change from 100vh to 100% */
    max-height: 100%; /* Change from 90vh to 100% */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.98);
    transition: all 0.3s ease-in-out;
    will-change: transform, opacity;
}

.statistics-modal h2 {
    text-align: center;
    background-color: #1A6D1A;
    color: #fff;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Add this */
}

.statistics-modal .modal-close {
    position: absolute;
    right: 1px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 5px;
    /* Remove top: 50% and transform: translateY(-50%) */
}


.statistics-modal-overlay.visible .statistics-modal {
    opacity: 1;
    transform: scale(1);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading spinner */
.loading-spinner {
    position: fixed; /* Change to fixed positioning */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto; /* Use margin auto for centering */
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #145214;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}


.loading-spinner.visible {
    opacity: 1;
}

.statistics-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.statistics-content iframe {
    width: 100%;
    height: 100%;
    /* This ensures it takes the height of its container */
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    flex: 1;
    overflow: auto;
    border-radius: 0 0 10px 10px;
}

.statistics-content iframe.loaded {
    opacity: 1;
}

.google-login-container-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20%;
}

@media (max-width: 750px) {
    .google-login-container-stats {
        display: grid;
    }
}