/* Estilos para el dashboard de inflación */

/* Autocomplete de artículos (solo en pantalla de inflación) */
.inflation-page .form-group {
    position: relative;
}

.inflation-page #view_articles .article-search-row {
    position: relative;
    z-index: 12;
}

.inflation-page #view_articles .article-search-card,
.inflation-page #view_articles .article-search-card .card-body {
    overflow: visible;
}

.inflation-page #article_detail_container {
    position: relative;
    z-index: 1;
}

.inflation-page .autocomplete-results {
    position: absolute;
    z-index: 1200;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    margin-top: 2px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.inflation-page .autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    color: #2c3e50;
    transition: background 0.2s;
}

.inflation-page .autocomplete-item:last-child {
    border-bottom: none;
}

.inflation-page .autocomplete-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* KPI Cards - Colores según inflación */
.card-stats .card-title.text-success {
    color: #18ce0f !important;
}

.card-stats .card-title.text-warning {
    color: #FFA534 !important;
}

.card-stats .card-title.text-danger {
    color: #f96332 !important;
}

.card-stats .card-title.text-muted {
    color: #94a3b8 !important;
}

/* Botones de granularidad */
.granularity-btn {
    border-color: #2CA8FF;
    color: #2CA8FF;
}

.granularity-btn.active {
    background-color: #2CA8FF;
    color: white;
}

.granularity-btn:hover {
    background-color: rgba(44, 168, 255, 0.1);
}

/* Gráfico por artículo: separar leyenda/ejes de las notas inferiores */
.inflation-page #article_detail_container .article-detail-body {
    padding-bottom: 1.25rem;
}

.inflation-page #article_detail_container .article-chart-wrap {
    position: relative;
    width: 100%;
    height: 420px;
    max-height: 420px;
    margin-bottom: 1.25rem;
}

.inflation-page #article_detail_container .article-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.inflation-page #article_detail_container .article-detail-notes {
    margin-top: 0;
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
    line-height: 1.55;
    clear: both;
}

.inflation-page #article_detail_container .article-range-summary {
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.inflation-page #article_detail_container .article-range-summary-title {
    color: var(--secondary-color, #2c3e50);
    font-weight: 600;
}

.inflation-page #article_detail_container .article-range-summary-table th,
.inflation-page #article_detail_container .article-range-summary-table td {
    color: #2c3e50;
    vertical-align: middle;
}

.inflation-page #article_detail_container .article-range-summary-table .text-success {
    color: #18ce0f !important;
}

.inflation-page #article_detail_container .article-range-summary-table .text-danger {
    color: #f96332 !important;
}

.inflation-page #article_detail_container .article-range-summary-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.inflation-page #article_detail_container .article-range-summary-table thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
    white-space: nowrap;
}

.inflation-page #article_detail_container .article-range-summary-table .summary-period-col {
    min-width: 5.5rem;
    white-space: nowrap;
}

.inflation-page #article_detail_container .article-range-total {
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.inflation-page #article_detail_container .article-range-total-title {
    color: var(--secondary-color, #2c3e50);
    font-weight: 600;
}

.inflation-page #article_detail_container .article-range-total-table th,
.inflation-page #article_detail_container .article-range-total-table td {
    color: #2c3e50;
    vertical-align: middle;
}

/* Animaciones suaves */
.view-container {
    animation: fadeIn 0.3s ease-in;
}

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

/* Tabla de rubros */
#table_categories_body tr {
    transition: background 0.2s;
}

#table_categories_body tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Icono en KPIs */
.icon-big i {
    font-size: 3em;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .inflation-page .autocomplete-results {
        max-height: 200px;
    }

    .inflation-page #article_detail_container .article-chart-wrap {
        height: 300px;
        max-height: 300px;
        margin-bottom: 1rem;
    }
    
    .granularity-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}
