/* ==========================================================================
   India LPG Price Tracker — Price Overview (Table + Chart)
   Same light-theme token language as style.css, plus a classic
   "stacked card" responsive table pattern for small screens.
   ========================================================================== */

.lpt-ov-widget {
    position: relative;
    max-width: 900px;
    margin: 30px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(160deg, #ffffff 0%, #fbfbfd 100%);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 25px 60px -25px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.04);
    border: 1px solid #eef0f4;
    overflow: hidden;
}
.lpt-ov-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fb7a3c, #f43f5e, #8b5cf6, #06b6d4, #f59e0b);
    background-size: 300% 100%;
    animation: lpt-ov-flow 7s linear infinite;
}
@keyframes lpt-ov-flow { 0% { background-position: 0% 0; } 100% { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .lpt-ov-widget::before { animation: none; } }

.lpt-ov-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.lpt-ov-heading-group { display: flex; flex-direction: column; gap: 6px; }
.lpt-ov-title {
    margin: 0;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.lpt-ov-updated { font-size: 12px; color: #64748b; font-weight: 500; }

.lpt-ov-type-toggle { display: inline-flex; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 3px; gap: 2px; }
.lpt-ov-type-btn {
    border: none; background: transparent; padding: 8px 14px; font-size: 13px; font-weight: 600;
    color: #64748b; border-radius: 8px; cursor: pointer; transition: all 0.15s ease; font-family: inherit;
}
.lpt-ov-type-btn.active { background: #fff; color: #0f172a; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08); }

/* Stat cards */
.lpt-ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.lpt-ov-stat {
    border-radius: 14px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid transparent;
}
.lpt-ov-stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
.lpt-ov-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 16px; font-weight: 700;
}
.lpt-ov-stat-amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.lpt-ov-stat-rose { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.lpt-ov-stat-green { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.lpt-ov-stat-violet { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }

/* Controls */
.lpt-ov-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lpt-ov-tabs { display: inline-flex; gap: 6px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 3px; }
.lpt-ov-tab {
    border: none; background: transparent; padding: 8px 16px; font-size: 13px; font-weight: 600;
    color: #64748b; border-radius: 8px; cursor: pointer; transition: all 0.15s ease; font-family: inherit;
}
.lpt-ov-tab.active { background: #fff; color: #b45309; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08); }

.lpt-ov-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lpt-ov-search {
    padding: 9px 14px; font-size: 13.5px; border: 1px solid #e2e8f0; border-radius: 9px;
    background: #f8fafc; color: #0f172a; min-width: 180px; font-family: inherit; outline: none;
}
.lpt-ov-search:focus { border-color: #f59e0b; background: #fff; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14); }
.lpt-ov-export-btn {
    padding: 9px 14px; font-size: 13px; font-weight: 600; border-radius: 9px; cursor: pointer;
    background: #fff; color: #334155; border: 1px solid #e2e8f0; font-family: inherit; transition: all 0.15s ease;
}
.lpt-ov-export-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Table */
.lpt-ov-table-wrap { overflow-x: auto; border: 1px solid #eef0f4; border-radius: 14px; }
.lpt-ov-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lpt-ov-table thead th {
    text-align: left; padding: 12px 16px; background: #f8fafc; color: #64748b;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid #eef0f4; white-space: nowrap;
}
.lpt-ov-sortable { cursor: pointer; user-select: none; }
.lpt-ov-sortable:hover { color: #b45309; }
.lpt-ov-sort-icon { display: inline-block; margin-left: 4px; font-size: 9px; opacity: 0.6; }
.lpt-ov-sort-icon.asc::after { content: '▲'; }
.lpt-ov-sort-icon.desc::after { content: '▼'; }

.lpt-ov-table tbody td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; color: #1e293b; font-variant-numeric: tabular-nums; }
.lpt-ov-table tbody tr:last-child td { border-bottom: none; }
.lpt-ov-table tbody tr:hover { background: #fafbfd; }
.lpt-ov-table td.lpt-ov-state-cell { font-weight: 600; font-variant-numeric: normal; }
.lpt-ov-loading, .lpt-ov-empty { text-align: center; color: #94a3b8; padding: 28px 16px !important; }

.lpt-ov-trend-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.lpt-ov-trend-up { background: #fef2f2; color: #dc2626; }
.lpt-ov-trend-down { background: #ecfdf5; color: #059669; }
.lpt-ov-trend-flat { background: #f1f5f9; color: #64748b; }

/* Chart */
.lpt-ov-chart-wrap { border: 1px solid #eef0f4; border-radius: 14px; padding: 16px; background: #fbfcfe; }
.lpt-ov-chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lpt-ov-chart-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #475569; cursor: pointer; }
.lpt-ov-chart-hint { font-size: 11.5px; color: #94a3b8; }
.lpt-ov-chart-holder { position: relative; width: 100%; }
#lpt-ov-chart { width: 100% !important; }

/* ---- Mobile: table becomes stacked cards ---- */
@media (max-width: 640px) {
    .lpt-ov-widget { padding: 18px; border-radius: 16px; }
    .lpt-ov-stats { grid-template-columns: 1fr 1fr; }
    .lpt-ov-header { flex-direction: column; align-items: stretch; }
    .lpt-ov-controls { flex-direction: column; align-items: stretch; }
    .lpt-ov-filters { justify-content: space-between; }
    .lpt-ov-search { flex: 1; min-width: 0; }

    .lpt-ov-table thead { display: none; }
    .lpt-ov-table, .lpt-ov-table tbody, .lpt-ov-table tr, .lpt-ov-table td { display: block; width: 100%; }
    .lpt-ov-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid #f1f5f9;
    }
    .lpt-ov-table tbody tr:last-child { border-bottom: none; }
    .lpt-ov-table td {
        border: none !important;
        padding: 4px 0 !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .lpt-ov-table td::before {
        content: attr(data-label);
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #94a3b8;
    }
    .lpt-ov-table td.lpt-ov-state-cell {
        padding-bottom: 6px !important;
        border-bottom: 1px dashed #eef0f4 !important;
        margin-bottom: 4px;
    }
    .lpt-ov-table td.lpt-ov-state-cell::before { display: none; }
    .lpt-ov-table td.lpt-ov-state-cell { font-size: 14.5px; }
}
