
body.statistics-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.statistics-page .modal-overlay {
    position: static;
    width: 100%;
    max-width: 900px;
    padding: 0;
    background: none;
}

.statistics-page .modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    padding: 24px;
    animation: fadeIn 0.3s ease-out;
}

.statistics-page .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.statistics-page .modal-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.statistics-page .close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}

.statistics-page .close-modal:hover {
    color: #333;
}

.statistics-page .statistics-container h3, .statistics-page .video-management-container h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #079e37;
    display: inline-block;
}

.statistics-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.statistics-page .stat-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.statistics-page .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.statistics-page .stat-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.statistics-page .stat-card p {
    font-size: 2.5rem;
    font-weight: 700;
    color: #079e37;
    margin: 0;
}

#inline-details-container {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.inline-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.inline-details-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.inline-details-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}

.inline-details-close-btn:hover {
    color: #333;
}

.daily-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.daily-details-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
}

.daily-details-list li:last-child {
    border-bottom: none;
}

.daily-details-list .date {
    font-weight: 500;
    color: #333;
}

.daily-details-list .count {
    font-weight: 600;
    color: #079e37;
    background-color: #e6f6eb;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.statistics-page #video-upload-form {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.statistics-page #video-upload-form label {
    font-weight: 500;
    color: #333;
}

.statistics-page #video-upload-form input[type="file"] {
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px;
}

.statistics-page #video-upload-form button {
    background-color: #079e37;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.statistics-page #video-upload-form button:hover {
    background-color: #056e28;
}

.statistics-page .video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.video-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 150px; /* Altura fija para todas las miniaturas */
    background-color: #000; /* Fondo negro por si el video no carga */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}


.video-item video,
.video-item img {
    display: block;
    width: 100%;
    height: 100%; /* El video o imagen llena la miniatura */
    object-fit: cover; /* El video o imagen cubre el espacio sin deformarse */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Permitir que el clic llegue al video-item */
}

.video-item:hover .video-overlay {
    opacity: 1;
}
/* boton de eliminar video */
.delete-video-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #dc3545; /* Rojo para indicar peligro/eliminar */
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px; /* Botón más grande y fácil de presionar */
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 5; /* Asegurarse de que esté por encima del overlay */
}
/*
.video-item:hover .delete-video-btn {
    opacity: 1;
    transform: scale(1.1);
}
*/
.delete-video-btn:hover {
    background-color: #c82333; /* Rojo más oscuro al pasar el mouse */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    body.statistics-page {
        padding: 10px;
    }

    .statistics-page .video-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .video-item {
        height: 120px;
    }

    .delete-video-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .statistics-page #video-upload-form,
    .statistics-page #youtube-video-form {
        flex-direction: column;
        align-items: stretch;
    }
}

.statistics-page #youtube-video-form {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 0; /* Ajustado para que el divisor controle el espacio */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.statistics-page #youtube-video-form label {
    font-weight: 500;
    color: #333;
    width: 100%; /* Ocupa todo el ancho en móvil */
    margin-bottom: -10px; /* Reduce espacio con el input */
}

.statistics-page #youtube-video-form input[type="url"] {
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px;
    min-width: 200px;
    font-size: 16px; /* Para evitar el auto-zoom en iOS */
}

.statistics-page #youtube-video-form button {
    background-color: #22971e;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.statistics-page #youtube-video-form button:hover {
    background-color: #f9131b;
}

.form-divider {
    border: none;
    height: 1px;
    background-color: #e9ecef;
    margin: 24px 0;
}

/* --- Statistics Video Player Modal --- */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#statistics-video-modal.active {
    display: flex; /* Shown when active */
}

#statistics-video-modal .video-modal-content {
    position: relative;
    width: 90vw;
    max-width: 900px;
    background: black;
    border-radius: 12px;
    padding: 0;
    line-height: 0; /* Remove extra space */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#statistics-video-modal .video-modal-body video,
#statistics-video-modal .video-modal-body iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 12px;
    border: none;
}

#statistics-video-modal .close-video-modal-btn {
    position: absolute;
    top: -45px; 
    right: -15px;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3010;
    padding: 5px;
    transition: transform 0.2s ease;
}

#statistics-video-modal .close-video-modal-btn:hover {
    transform: scale(1.2);
}
