/* Repromeda Statistiky - Light Theme Extensions */

/* Filter Panel */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-secondary);
}

.filter-header:hover {
    background: var(--bg-hover);
}

.filter-header .iconify {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.filter-panel.open .filter-header .iconify {
    transform: rotate(180deg);
}

.filter-body {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border-light);
}

.filter-panel.open .filter-body {
    display: block;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}

.filter-group {
    flex: 1;
    min-width: 140px;
}

.filter-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.glass-select, .glass-date, .glass-input-sm {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    width: 100%;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.glass-select:focus, .glass-date:focus, .glass-input-sm:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.glass-select option {
    background: white;
    color: var(--text-primary);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.btn-filter {
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.btn-filter-apply {
    background: var(--color-primary);
    color: white;
}

.btn-filter-apply:hover {
    background: #2563eb;
}

.btn-filter-reset {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-filter-reset:hover {
    background: var(--bg-hover);
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.btn-export:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.kpi-card.kpi-primary::before { background: var(--color-primary); }
.kpi-card.kpi-accent::before { background: var(--color-info); }
.kpi-card.kpi-success::before { background: var(--color-success); }
.kpi-card.kpi-warning::before { background: var(--color-warning); }
.kpi-card.kpi-danger::before { background: var(--color-danger); }

.kpi-label {
    font-size: 0.675rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-card.kpi-primary .kpi-value { color: var(--color-primary); }
.kpi-card.kpi-accent .kpi-value { color: var(--color-info); }
.kpi-card.kpi-success .kpi-value { color: var(--color-success); }
.kpi-card.kpi-warning .kpi-value { color: #b45309; }
.kpi-card.kpi-danger .kpi-value { color: var(--color-danger); }

.kpi-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.kpi-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.75rem;
    opacity: 0.08;
    color: var(--text-secondary);
}

/* Chart containers */
.chart-container-lg { position: relative; height: 320px; }
.chart-container-md { position: relative; height: 240px; }
.chart-container-sm { position: relative; height: 160px; }

/* Funnel */
.funnel {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.funnel-label {
    width: 130px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.funnel-bar-wrap {
    flex: 1;
    position: relative;
}

.funnel-bar {
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    transition: width 0.4s ease;
    min-width: 36px;
}

.funnel-pct {
    font-size: 0.675rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Flow */
.flow-diagram {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 1rem 0;
}

.flow-node {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    text-align: center;
    min-width: 90px;
    flex-shrink: 0;
}

.flow-node-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.flow-node-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.flow-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0 0.15rem;
    flex-shrink: 0;
}

/* Heatmap */
.heatmap-grid {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    gap: 3px;
}

.heatmap-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.heatmap-cell {
    aspect-ratio: 1.8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-height: 26px;
    transition: transform 0.1s;
    border: 1px solid transparent;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 1;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Section divider */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Active filter tags */
.active-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-primary-light);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 6px;
    font-size: 0.675rem;
    color: var(--color-primary);
}

.filter-tag .remove {
    cursor: pointer;
    opacity: 0.5;
}

.filter-tag .remove:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 767.98px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-value { font-size: 1.35rem; }
    .filter-group { min-width: 110px; }
    .funnel-label { width: 70px; font-size: 0.65rem; }
    .flow-diagram { flex-wrap: wrap; }
    .heatmap-grid { grid-template-columns: 50px repeat(5, 1fr); }
}
