/* Asegurar que la página de analytics pueda desplazarse aun con el layout base 
#content {
    height: auto !important;
    min-height: 100vh;
    overflow: hidden !important;
}
body {
    min-height: 100vh;
    overflow-y: auto;
}    

*/
@media (min-width: 768px) {
    .page-analytics #content {
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
}




.page-analytics html {
    scroll-behavior: smooth;
}

.page-analytics html,
.page-analytics body {
    height: auto;
    overflow-y: auto;
}


.page-analytics .analytics-container {
    padding: 16px;
    margin: 0 auto;
    padding-bottom: 40px;
    /* permitir desplazamiento */
    /* eliminar restricciones que ocultaban el scroll */
    /*max-height: calc(100vh - 20px);*/
    /*margin-bottom: 20px;*/
}

.page-analytics #sidebar {
    position: sticky;
    top: 0;
}



/* (nav flotante eliminado) */

.metrics-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    overflow: visible;
}

.metrics-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.metrics-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metrics-value {
    font-size: 18px;
    font-weight: 500;
    color: #7f8c8d;
}

.metrics-filtered {
    font-size: 24px;
    font-weight: 700;
    color: #27ae60;
}

.metrics-separator {
    font-size: 20px;
    font-weight: 500;
    color: #95a5a6;
    margin: 0 8px;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: #3498db;
    padding: 5px 15px;
    border-radius: 20px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metrics-percentage {
    font-size: 14px;
    font-weight: 500;
    color: #95a5a6;
}

.filter-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 10px;
    margin-bottom: 15px;
    padding: 15px;
    margin-bottom: 20px;
}



.chart-container,
.table-container {
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px;
    margin-bottom: 20px;
    height: 350px;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 30px;
}

.rating-bar,
.reviews-bar {
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
    max-width: 70%;
}

.table-sm td,
.table-sm th {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
}

.table-sm th:nth-child(1) {
    width: 30%;
}

.table-sm th:nth-child(2) {
    width: 15%;
}

.table-sm th:nth-child(3) {
    width: 25%;
}

.table-sm th:nth-child(4) {
    width: 30%;
}

.table-responsive thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.sortable {
    cursor: pointer;
    position: relative;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable i {
    font-size: 0.8rem;
    margin-left: 5px;
    opacity: 0.5;
}

.sortable.sort-asc i:before {
    content: "\f0de";
    /* fa-sort-up */
    opacity: 1;
}

.sortable.sort-desc i:before {
    content: "\f0dd";
    /* fa-sort-down */
    opacity: 1;
}

.rating-bar {
    background-color: #f1c40f;
}

.reviews-bar {
    background-color: #3498db;
}

.correlation-bar {
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
    background-color: #9b59b6;
    margin-left: 5px;
    max-width: 70%;
}

.chart-title {
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 10;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

canvas {
    margin-top: 50px;
}

.metrics-subtitle {
    font-size: 14px;
    color: #7f8c8d;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.category-selector {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.insights-card {
    background-color: #f0f7ff;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.insights-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.insights-content {
    font-size: 14px;
    color: #34495e;
    line-height: 1.5;
}

.source-distribution {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.source-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.source-google {
    background-color: #4285F4;
}

.source-tripadvisor {
    background-color: #00af87;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.progress-bar-container {
    width: 100%;
    background-color: #ecf0f1;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #3498db;
    border-radius: 10px;
}

@media (max-width: 767.98px) {

    .page-analytics html,
    .page-analytics body {
        overflow: hidden;
        height: 100%;
    }


    .page-analytics #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: var(--sidebar-collapsed-width);
        height: 100dvh;
        z-index: 1200;
    }

    /* Contenido analytics: corre REALMENTE */
    .page-analytics .analytics-container {
        padding-left: calc(var(--sidebar-collapsed-width) + 12px);
        padding-right: 12px;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
        max-height: none;
    }

    .page-analytics #content {
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

}