/* Live Fonds – Modern Pastel Theme
   A cohesive, modern, pastel UI for all live-fonds Elementor widgets.
   Focus: clean cards, soft shadows, accessible contrast, subtle animations. */

:root {
    --lf-bg: #F8FAFC; /* slate-50-ish */
    --lf-card-bg: #FFFFFF; /* white card */
    --lf-surface: #F1F5F9; /* slate-100 */
    --lf-border: #E5E7EB; /* gray-200 */
    --lf-text: #0F172A; /* slate-900 */
    --lf-text-muted: #475569; /* slate-600 */
    --lf-primary: #6366F1; /* indigo-500 */
    --lf-primary-600: #5558E8; /* slightly darker */
    --lf-accent-1: #A5B4FC; /* indigo-200 */
    --lf-accent-2: #60A5FA; /* blue-400 */
    --lf-accent-3: #34D399; /* emerald-400 */
    --lf-accent-4: #F59E0B; /* amber-500 */
    --lf-danger: #F87171; /* red-400 */
    --lf-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
    --lf-radius: 14px;
    --lf-radius-sm: 10px;
    --lf-gap: 16px;
}

/* Generic card wrapper applied to all widgets */
.lf-panel {
    background: var(--lf-card-bg);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius);
    padding: 18px 18px 16px;
    box-shadow: var(--lf-shadow);
}

/* Unstyled panel (used when panel style is disabled) */
.lf-panel-unstyled {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Typography baseline inside widgets */
.lf-profile, .lf-price-chart, .lf-sectors-widget, .lf-countries-widget, .lf-holdings-widget, .lf-countries-map-widget, .lf-description-widget {
    color: var(--lf-text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.lf-profile h3, .lf-price-chart h3, .lf-sectors-title, .lf-countries-title, .lf-holdings-title, .lf-price-chart-title, .lf-description-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--lf-text);
}

/* Subtle top accent */
.lf-panel::before {
    content: "";
    display: block;
    height: 4px;
    margin: -18px -18px 14px -18px;
    border-top-left-radius: var(--lf-radius);
    border-top-right-radius: var(--lf-radius);
    /*background: linear-gradient(90deg, var(--lf-accent-1), var(--lf-accent-2), var(--lf-accent-3));*/
    opacity: 0.75;
}

/* Profile widget */
.lf-profile .lf-profile-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.lf-profile .lf-profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
    padding: 8px 10px;
    border: 1px dashed rgba(99, 102, 241, 0.18);
    border-radius: var(--lf-radius-sm);
    background: linear-gradient(0deg, rgba(99, 102, 241, 0.04), rgba(99, 102, 241, 0.04)), #fff;
}

.lf-profile .lf-profile-label {
    font-size: 12px;
    color: var(--lf-text-muted);
    letter-spacing: .02em;
    margin: 0;
    align-self: center;
}

.lf-profile .lf-profile-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--lf-text);
    margin: 0;
    align-self: center;
}

/* Price chart */
.lf-price-chart {
    position: relative;
    /*background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));*/
}

.lf-price-chart .lf-price-chart-canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.lf-price-chart .lf-price-chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--lf-text-muted);
    backdrop-filter: blur(1.5px);
}

.lf-price-chart .lf-price-chart-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 8px;
    border: 2px solid var(--lf-accent-2);
    border-top-color: transparent;
    animation: lf-spin 1s linear infinite;
}

@keyframes lf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sectors & Countries shared layout */
.lf-sectors-layout, .lf-countries-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
}

.lf-sectors-chart, .lf-countries-chart {
    display: grid;
    place-items: center;
    background: var(--lf-surface);
    border-radius: var(--lf-radius-sm);
    padding: 10px;
    border: 1px solid var(--lf-border);
}

.lf-sectors-loading, .lf-countries-loading {
    font-size: 12px;
    color: var(--lf-text-muted);
    margin-top: 8px;
}

/* Lists */
.lf-sectors-list, .lf-countries-list {
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-sm);
    padding: 8px 10px;
}

/* Items */
.lf-sector-item, .lf-country-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 6px;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
}

.lf-sector-item:last-child, .lf-country-item:last-child {
    border-bottom: 0;
}

.lf-sector-icon, .lf-country-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--lf-surface);
    display: grid;
    place-items: center;
    border: 1px solid var(--lf-border);
}

.lf-sector-row, .lf-country-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.lf-sector-name, .lf-country-name {
    font-size: 14px;
    color: var(--lf-text);
    font-weight: 600;
}

.lf-sector-percent, .lf-country-percent {
    font-size: 13px;
    color: var(--lf-text-muted);
}

.lf-sector-progress, .lf-country-progress {
    height: 8px;
    background: var(--lf-surface);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--lf-border);
}

.lf-sector-progress > span, .lf-country-progress > span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--lf-primary), var(--lf-accent-2));
}

/* Holdings list */
.lf-holdings-title {
    margin-bottom: 10px;
}

.lf-holdings-widget .lf-holdings-list {
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-sm);
    background: #fff;
    padding: 6px 10px;
}

/* Override inline ID-scoped defaults with important rules */
[id^="lf-holdings-"] .lf-holding-item {
    padding: 12px 0 !important;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.06) !important;
}

[id^="lf-holdings-"] .lf-holding-row {
    gap: 12px !important;
}

[id^="lf-holdings-"] .lf-holding-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--lf-text) !important;
}

[id^="lf-holdings-"] .lf-holding-percent {
    font-size: 13px !important;
    color: var(--lf-text-muted) !important;
}

[id^="lf-holdings-"] .lf-holding-progress {
    height: 8px !important;
    background: var(--lf-surface) !important;
    border-radius: 6px !important;
    border: 1px solid var(--lf-border) !important;
}

[id^="lf-holdings-"] .lf-holding-progress > span {
    background: linear-gradient(90deg, var(--lf-primary), var(--lf-accent-3)) !important;
}

[id^="lf-holdings-"] .lf-holdings-more {
    background: var(--lf-surface) !important;
    color: var(--lf-text) !important;
    border-radius: 8px !important;
    border: 1px solid var(--lf-border) !important;
    transition: background .2s ease, transform .05s ease;
}

[id^="lf-holdings-"] .lf-holdings-more:hover {
    background: #E2E8F0 !important;
}

[id^="lf-holdings-"] .lf-holdings-more:active {
    transform: translateY(1px);
}

/* Small utility tweaks */
.lf-muted {
    color: var(--lf-text-muted);
}

.lf-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    font-size: 12px;
    color: var(--lf-text-muted);
}

/* Scrollbar polish for lists */
.lf-sectors-list, .lf-countries-list {
    scrollbar-width: thin;
    scrollbar-color: var(--lf-accent-1) #fff;
}

.lf-sectors-list::-webkit-scrollbar, .lf-countries-list::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.lf-sectors-list::-webkit-scrollbar-thumb, .lf-countries-list::-webkit-scrollbar-thumb {
    background: var(--lf-accent-1);
    border-radius: 8px;
    border: 2px solid #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .lf-sectors-layout, .lf-countries-layout {
        grid-template-columns: 1fr;
    }

    .lf-profile .lf-profile-row {
        grid-template-columns: 1fr;
    }
}

/* Ensure all widget headings share the same font */
.lf-profile h1, .lf-profile h2, .lf-profile h3, .lf-profile h4, .lf-profile h5, .lf-profile h6,
.lf-price-chart h1, .lf-price-chart h2, .lf-price-chart h3, .lf-price-chart h4, .lf-price-chart h5, .lf-price-chart h6,
.lf-sectors-widget h1, .lf-sectors-widget h2, .lf-sectors-widget h3, .lf-sectors-widget h4, .lf-sectors-widget h5, .lf-sectors-widget h6,
.lf-countries-widget h1, .lf-countries-widget h2, .lf-countries-widget h3, .lf-countries-widget h4, .lf-countries-widget h5, .lf-countries-widget h6,
.lf-holdings-widget h1, .lf-holdings-widget h2, .lf-holdings-widget h3, .lf-holdings-widget h4, .lf-holdings-widget h5, .lf-holdings-widget h6,
.lf-countries-map-widget h1, .lf-countries-map-widget h2, .lf-countries-map-widget h3, .lf-countries-map-widget h4, .lf-countries-map-widget h5, .lf-countries-map-widget h6,
.lf-description-widget h1, .lf-description-widget h2, .lf-description-widget h3, .lf-description-widget h4, .lf-description-widget h5, .lf-description-widget h6 {
    font-family: inherit;
}

/* Timeframe button bar for Price Chart */
.lf-price-chart .lf-timeframe {
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    background: rgba(99, 102, 241, 0.06);
    padding: 6px;
    display: inline-flex;
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-sm);

}

.lf-timeframe-btn {
    appearance: none;
    border: 1px solid var(--lf-border);
    background: #fff;
    color: var(--lf-text);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.lf-timeframe-btn:hover {
    border-color: var(--lf-accent-2);
    box-shadow: 0 1px 2px rgba(2, 6, 23, 0.05);
}

/* Disabled state for timeframe buttons */
.lf-timeframe-btn.disabled, .lf-timeframe-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
    color: var(--lf-text-muted);
    border-color: var(--lf-border);
    box-shadow: none;
}
.lf-timeframe-btn.disabled:hover, .lf-timeframe-btn[disabled]:hover {
    border-color: var(--lf-border);
    box-shadow: none;
}

.lf-timeframe-btn.active {
    background: var(--lf-primary);
    border-color: var(--lf-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.lf-timeframe-btn:focus {
    outline: 2px solid var(--lf-accent-2);
    outline-offset: 1px;
}


/* Price Chart header: title left, timeframe right */
.lf-price-chart .lf-price-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.lf-price-chart .lf-price-chart-header .lf-price-chart-title {
    margin: 0;
}
.lf-price-chart .lf-price-chart-header .lf-timeframe {
    margin: 0;
}
