/* =========================================================================
   500 Designs — Stock Quote (Finnhub) widget
   Base structural CSS only. Colors / typography / spacing / borders /
   shadows are driven by Elementor controls via inline selectors.
   ========================================================================= */

.d500-stock {
    display: block;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    border: 1px solid transparent;
}

.d500-stock *,
.d500-stock *::before,
.d500-stock *::after {
    box-sizing: inherit;
}

/* --- Header ---------------------------------------------------------------- */
.d500-stock__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.d500-stock__label {
    font-weight: 600;
    font-size: 15px;
}

.d500-stock__symbol {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Price + change row ---------------------------------------------------- */
.d500-stock__price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.d500-stock__price {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.d500-stock__change {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Details grid ---------------------------------------------------------- */
.d500-stock__details {
    list-style: none;
    margin: 0 0 12px;
    padding: 12px 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    border-top: 1px solid #f1f5f9;
}

.d500-stock__details li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    gap: 8px;
}

.d500-stock__details span {
    color: #64748b;
    font-weight: 500;
}

.d500-stock__details strong {
    font-weight: 600;
}

/* --- Footer / timestamp ---------------------------------------------------- */
.d500-stock__footer {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
}

/* --- States --------------------------------------------------------------- */
.d500-stock--error,
.d500-stock--notice {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.d500-stock--notice {
    background: #f0f9ff;
    color: #0c4a6e;
    border-color: #bae6fd;
}

.d500-stock--notice strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.d500-stock--notice p {
    margin: 0 0 6px;
    font-size: 13px;
}

.d500-stock--notice a {
    color: #0369a1;
    font-weight: 600;
    text-decoration: none;
}

.d500-stock--notice a:hover {
    text-decoration: underline;
}

/* --- Loading pulse (during AJAX refresh) ----------------------------------- */
.d500-stock.is-refreshing .d500-stock__price,
.d500-stock.is-refreshing .d500-stock__change,
.d500-stock.is-refreshing .d500-stock__details strong,
.d500-stock.is-refreshing .d500-stock__big-number,
.d500-stock.is-refreshing .d500-stock__ticker-price {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* =========================================================================
   SKIN 2 — Editorial / Hero
   Big number, currency offset, trend icon, side meta column.
   ========================================================================= */
.d500-stock--skin-2 {
    max-width: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 24px;
}

.d500-stock--skin-2 .d500-stock__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
}

.d500-stock--skin-2 .d500-stock__heading {
    margin: 0 0 24px;
    font-size: clamp(20px, 2.2vw, 32px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.d500-stock--skin-2 .d500-stock__big-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.d500-stock--skin-2 .d500-stock__big-currency {
    font-size: clamp(22px, 2vw, 32px);
    font-weight: 400;
    color: inherit;
    align-self: flex-start;
    margin-top: 0.3em;
}

.d500-stock--skin-2 .d500-stock__big-number {
    font-size: clamp(64px, 9vw, 128px);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1;
}

.d500-stock--skin-2 .d500-stock__trend {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    align-self: center;
}

.d500-stock--skin-2.d500-stock--up   .d500-stock__trend-down,
.d500-stock--skin-2.d500-stock--down .d500-stock__trend-up   { display: none; }
.d500-stock--skin-2 .d500-stock__trend-up,
.d500-stock--skin-2 .d500-stock__trend-down { display: inline-flex; }

.d500-stock--skin-2 .d500-stock__exch-line {
    font-size: clamp(14px, 1.1vw, 18px);
    color: #4b5563;
    margin-bottom: 200px;
}

.d500-stock--skin-2 .d500-stock__hero-meta {
    margin-top: auto;
}

.d500-stock--skin-2 .d500-stock__hero-date,
.d500-stock--skin-2 .d500-stock__disclaimer {
    font-size: clamp(13px, 1vw, 16px);
    color: #4b5563;
    line-height: 1.5;
}

.d500-stock--skin-2 .d500-stock__disclaimer {
    margin-top: 2px;
}

@media (max-width: 768px) {
    .d500-stock--skin-2 .d500-stock__hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .d500-stock--skin-2 .d500-stock__exch-line { margin-bottom: 0; }
    .d500-stock--skin-2 .d500-stock__big-number { font-size: clamp(56px, 16vw, 96px); }
}

/* =========================================================================
   SKIN 3 — Inline Ticker Strip
   ========================================================================= */
.d500-stock--skin-3 {
    display: inline-block;
    max-width: none;
    padding: 8px 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 999px;
}

.d500-stock--skin-3 .d500-stock__ticker {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.d500-stock--skin-3 .d500-stock__ticker-symbol {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
}

.d500-stock--skin-3 .d500-stock__ticker-price {
    font-weight: 700;
    font-size: 16px;
}

.d500-stock--skin-3 .d500-stock__ticker-change {
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================================
   SKIN 4 — Stat Card (Centered, soft direction tint)
   ========================================================================= */
.d500-stock--skin-4 {
    text-align: center;
    padding: 32px 28px;
}

.d500-stock--skin-4 .d500-stock__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.d500-stock--skin-4 .d500-stock__card-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.d500-stock--skin-4.d500-stock--up .d500-stock__card-pill   { background: #dcfce7; color: #166534; }
.d500-stock--skin-4.d500-stock--down .d500-stock__card-pill { background: #fee2e2; color: #991b1b; }

.d500-stock--skin-4 .d500-stock__card-company {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.d500-stock--skin-4 .d500-stock__price {
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.d500-stock--skin-4 .d500-stock__card-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    margin-top: 4px;
}

.d500-stock--skin-4.d500-stock--up .d500-stock__card-change   { background: #dcfce7; }
.d500-stock--skin-4.d500-stock--down .d500-stock__card-change { background: #fee2e2; }

.d500-stock--skin-4 .d500-stock__card-arrow {
    font-size: 14px;
}

.d500-stock--skin-4 .d500-stock__card-pct {
    font-weight: 600;
    opacity: 0.85;
}

.d500-stock--skin-4 .d500-stock__footer {
    margin-top: 14px;
    text-align: center;
    width: 100%;
}

/* =========================================================================
   SKIN 5 — Sidebar / Vertical
   ========================================================================= */
.d500-stock--skin-5 {
    max-width: 280px;
    padding: 18px 20px;
}

.d500-stock--skin-5 .d500-stock__side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.d500-stock--skin-5 .d500-stock__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.d500-stock--skin-5 .d500-stock__side-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: 8px;
}

.d500-stock--skin-5 .d500-stock__price {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.d500-stock--skin-5 .d500-stock__change {
    font-size: 13px;
    font-weight: 600;
}

.d500-stock--skin-5 .d500-stock__pct {
    opacity: 0.75;
}

.d500-stock--skin-5 .d500-stock__side-list {
    grid-template-columns: 1fr !important;
    padding-top: 10px;
    margin-bottom: 8px;
    gap: 0;
}

.d500-stock--skin-5 .d500-stock__side-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.d500-stock--skin-5 .d500-stock__side-list li:last-child {
    border-bottom: 0;
}

.d500-stock--skin-5 .d500-stock__footer {
    text-align: left;
}
