/* public/app/css/stats-modal-styles.css */

/* Z-index fix to appear above the editor modal */
#stats-modal {
    z-index: 1070;
}

.stats-container {
    background: #2c3e50; /* Dark background */
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Stronger shadow for dark theme */
    width: 90%;
    max-width: 600px;
    color: #ecf0f1; /* Light text */
    animation: slide-down 0.5s ease-out;
    border: 1px solid #4a6a8a;
    /* Flex properties for scrolling body */
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Max height for desktop */
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #3498db; /* Accent color border */
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.stats-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: #ffffff; /* White title */
}

.stats-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto; /* Enable vertical scroll */
    padding-right: 15px; /* Space for scrollbar */
}

.stats-section h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ecf0f1; /* Light text */
    border-left: 4px solid #3498db; /* Accent color */
    padding-left: 10px;
}

.fichas-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.ficha-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    background: #34495e; /* Slightly lighter dark background */
    border: 1px solid #4a6a8a;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ficha-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ficha-stat-item .ficha-img {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    border: 2px solid #ecf0f1;
}

.ficha-stat-item .frecuencia {
    font-size: 1.2em;
    font-weight: 700;
    color: #f1c40f; /* Highlight color for frequency */
}

.ficha-stat-item .frecuencia-label {
    font-size: 0.8em;
    color: #bdc3c7; /* Lighter grey for readability */
}

.error-msg {
    color: #e74c3c;
    text-align: center;
    width: 100%;
}

/* Animación para el modal */
@keyframes slide-down {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    /* Remove padding from the overlay to allow true full-screen */
    #stats-modal {
        padding: 0;
    }

    .stats-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 15px;
        padding-top: calc(15px + env(safe-area-inset-top)); /* Safe area for notch */
    }

    .stats-header {
        /* Padding is now on the container, so this is not needed */
        padding-top: 0;
    }
}
