/**
 * Mashup Educacao - Estilos Complementares
 * Tribunal de Contas do Estado do Maranhao
 *
 * Paleta de Cores (Laranja / Ambar):
 *   - Primaria:    #9a3412 (orange-900)
 *   - Secundaria:  #ea580c (orange-600)
 *   - Accent:      #f97316 (orange-500)
 *   - Light:       #ffedd5 (orange-100)
 *   - Background:  #fff7ed (orange-50)
 */

/* ====== RESET & BASE ====== */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== SKELETON LOADING ====== */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
    animation: skeletonFadeIn 0.4s ease;
}

@keyframes skeletonFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shimmer base */
.skeleton-bar {
    background: linear-gradient(90deg, #f1f0ee 25%, #e8e5e0 37%, #f1f0ee 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.6s ease infinite;
    border-radius: 6px;
}

@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Pulsing dots */
.skeleton-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.skeleton-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    opacity: 0.4;
    animation: skeletonDotPulse 1.2s ease-in-out infinite;
}

.skeleton-dots span:nth-child(2) { animation-delay: 0.2s; }
.skeleton-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes skeletonDotPulse {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Skeleton for KPI numbers */
.skeleton-kpi .skeleton-bar.big {
    width: 55%;
    height: 32px;
    border-radius: 8px;
}

.skeleton-kpi .skeleton-bar.small {
    width: 30%;
    height: 8px;
}

/* Skeleton for chart areas */
.skeleton-chart {
    gap: 12px;
    padding: 16px 20px;
}

.skeleton-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 80%;
    height: 65%;
}

.skeleton-chart-bars .skeleton-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
}

/* Skeleton for tables */
.skeleton-table {
    align-items: stretch;
    padding: 12px 16px;
    gap: 0;
}

.skeleton-table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 1fr 0.6fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f0ee;
}

.skeleton-table-row:first-child {
    border-bottom: 2px solid #e8e5e0;
    padding-bottom: 12px;
    margin-bottom: 2px;
}

.skeleton-table-row .skeleton-bar {
    height: 12px;
    width: 85%;
}

/* ====== CUSTOMIZACOES QLIK ====== */
.qlik-object {
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 100%;
}

.qvobject {
    background-color: transparent !important;
    border: none !important;
    transition: all 0.3s;
}

.qv-object, .qv-inner-object {
    background-color: transparent !important;
    background: transparent !important;
}

/* ====== CARDS ====== */
.card-hover {
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1),
                box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(154, 52, 18, 0.10),
                0 4px 10px -3px rgba(154, 52, 18, 0.06);
}

/* KPI card com accent border esquerdo */
.kpi-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1),
                box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 50%, #9a3412 100%);
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(154, 52, 18, 0.10),
                0 4px 10px -3px rgba(154, 52, 18, 0.06);
}

.kpi-card:hover::before {
    opacity: 1;
}

/* ====== CHART CARDS ====== */
.chart-card {
    transition: box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
}

.chart-card:hover {
    box-shadow: 0 8px 20px -4px rgba(154, 52, 18, 0.08),
                0 2px 8px -2px rgba(154, 52, 18, 0.04);
}

/* ====== SEÇOES - TÍTULOS ====== */
.section-title {
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #ea580c, #f97316);
    border-radius: 2px;
    margin-top: 8px;
}

/* ====== FILTROS ALINHADOS ====== */
.filtro-row {
    display: grid;
    grid-template-columns: 100px 1px 1fr;
    align-items: center;
    column-gap: 12px;
}

.filtro-row .filtro-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 4px;
}

.filtro-row .filtro-divider {
    height: 32px;
    background: rgba(255, 255, 255, 0.20);
}

/* Skeleton for filter */
.skeleton-filter {
    flex-direction: row;
    gap: 6px;
    padding: 0 8px;
}

.skeleton-filter .skeleton-bar {
    height: 10px;
    border-radius: 4px;
}

/* ====== FONTE DE DADOS ====== */
.fonte-dados {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.fonte-dados:hover {
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.10);
    border-color: #f97316;
}

/* ====== TABS ====== */
.tab-button {
    position: relative;
    transition: color 0.2s ease;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fbbf24;
    transition: width 0.3s ease, left 0.3s ease;
}

/* Só mostra o ::after hover em abas NÃO ativas */
.tab-button:not(.border-orange-400):hover::after {
    width: 100%;
    left: 0;
}

/* ====== ANIMAÇÃO FADE-IN AO SCROLL ====== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-section {
    animation: fadeInUp 0.5s ease-out both;
}

/* ====== SCROLLBAR CUSTOM ====== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #ea580c;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9a3412;
}
