/* FLA Stock Widget — fla-stock-widget.css
   Brand colour: #DE075C  |  ZSE data, manual daily update
   Compatible with Astra + Spectra stack on fidelitylife.co.zw */

.fla-stock-widget {
    font-family: inherit;
    max-width: 680px;
    margin: 0 auto;
}

.fla-sw-loading,
.fla-sw-error {
    padding: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 14px;
    border: 1px solid #eee;
    border-radius: 10px;
}

.fla-sw-error { color: #c0392b; border-color: #f5c6cb; }

/* Card wrapper */
.fla-sw-card {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1.5rem;
    background: #fff;
}

/* Header row */
.fla-sw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 1.25rem;
}

.fla-sw-id {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fla-sw-logo {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #DE075C;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.fla-sw-ticker {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px;
    line-height: 1.2;
}

.fla-sw-company {
    font-size: 12px;
    color: #666;
    margin: 0 0 6px;
}

.fla-sw-exchange-badge {
    display: inline-block;
    font-size: 11px;
    background: #f4f4f4;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Price block */
.fla-sw-price-block { text-align: right; }

.fla-sw-price {
    font-size: 34px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.fla-sw-unit {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.fla-sw-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.fla-sw-badge-neg { background: #fde8e8; color: #922b21; }
.fla-sw-badge-pos { background: #e8f5e9; color: #1b5e20; }
.fla-sw-badge-neu { background: #f0f0f0; color: #555; }

/* Metrics grid */
.fla-sw-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
}

.fla-sw-metric {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px 12px;
}

.fla-sw-metric-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.fla-sw-metric-val {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* 52-week range bar */
.fla-sw-range-section {
    margin-bottom: 1.25rem;
}

.fla-sw-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.fla-sw-range-track {
    height: 4px;
    background: #ebebeb;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}

.fla-sw-range-fill {
    position: absolute;
    height: 100%;
    background: #DE075C;
    border-radius: 2px;
}

.fla-sw-range-current {
    text-align: center;
    font-size: 11px;
    color: #888;
}

/* Chart section */
.fla-sw-chart-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    margin-top: 0.25rem;
}

.fla-sw-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0.75rem;
}

.fla-sw-tab {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    background: transparent;
    color: #666;
    transition: all 0.15s;
}

.fla-sw-tab:hover { border-color: #DE075C; color: #DE075C; }

.fla-sw-tab.active {
    background: #DE075C;
    color: #fff;
    border-color: #DE075C;
}

.fla-sw-chart-wrap {
    position: relative;
    width: 100%;
    height: 180px;
}

/* Footer */
.fla-sw-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.fla-sw-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2e7d32;
    display: inline-block;
    margin-right: 5px;
    animation: fla-pulse 2.2s infinite;
}

@keyframes fla-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

.fla-sw-as-at {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
}

.fla-sw-source {
    font-size: 11px;
    color: #bbb;
}

/* Compact mode */
.fla-stock-widget[data-compact="true"] .fla-sw-metrics,
.fla-stock-widget[data-compact="true"] .fla-sw-range-section,
.fla-stock-widget[data-compact="true"] .fla-sw-chart-section {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .fla-sw-header { flex-direction: column; }
    .fla-sw-price-block { text-align: left; }
    .fla-sw-price { font-size: 28px; }
}
