/* Silver Bullion Stock Checker - Custom Styles */
/* Steel/silver theme on Pico.css v2.0.6 */

/* ============================================
   1. COLOR PALETTE — Silver/Steel (Blue Grey)
   ============================================ */

:root {
    /* Primary: Material Design Blue Grey */
    --pico-primary: #546e7a;
    --pico-primary-hover: #455a64;
    --pico-primary-focus: rgba(84, 110, 122, 0.25);
    --pico-primary-inverse: #fff;

    /* Semantic tokens — light mode */
    --silver-green: #2e7d32;
    --silver-green-bg: #e8f5e9;
    --silver-red: #c62828;
    --silver-red-bg: #ffebee;
    --silver-amber: #e65100;
    --silver-amber-bg: #fff3e0;
    --silver-gray: #546e7a;
    --silver-gray-bg: #eceff1;
    --silver-hero-bg: #eceff1;
    --silver-section-border: #cfd8dc;

    /* Composition bar colors */
    --comp-stocks: #546e7a;
    --comp-etfs: #78909c;
    --comp-structured: #8d6e63;
    --comp-cash: #a1887f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --pico-primary: #90a4ae;
        --pico-primary-hover: #b0bec5;
        --pico-primary-focus: rgba(144, 164, 174, 0.25);
        --pico-primary-inverse: #1a1a2e;

        --silver-green: #66bb6a;
        --silver-green-bg: rgba(46, 125, 50, 0.15);
        --silver-red: #ef5350;
        --silver-red-bg: rgba(198, 40, 40, 0.15);
        --silver-amber: #ffa726;
        --silver-amber-bg: rgba(230, 81, 0, 0.12);
        --silver-gray: #90a4ae;
        --silver-gray-bg: rgba(84, 110, 122, 0.2);
        --silver-hero-bg: rgba(144, 164, 174, 0.08);
        --silver-section-border: #37474f;

        --comp-stocks: #90a4ae;
        --comp-etfs: #78909c;
        --comp-structured: #a1887f;
        --comp-cash: #8d6e63;
    }
}


/* ============================================
   2. BADGES — Tinted background + colored text
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    border: 1px solid currentColor;
    transition: all var(--pico-transition);
}

.badge-green {
    background-color: var(--silver-green-bg);
    color: var(--silver-green);
}

.badge-amber {
    background-color: var(--silver-amber-bg);
    color: var(--silver-amber);
}

.badge-red {
    background-color: var(--silver-red-bg);
    color: var(--silver-red);
}

.badge-gray {
    background-color: var(--silver-gray-bg);
    color: var(--silver-gray);
}


/* ============================================
   3. CSS AVAILABILITY BARS
   ============================================ */

.availability-bar {
    display: flex;
    gap: 3px;
    margin: 0.5rem 0;
    height: 1.5rem;
    align-items: stretch;
}

.bar-segment {
    flex: 1;
    border-radius: 2px;
    transition: all var(--pico-transition);
}

.bar-filled {
    background-color: var(--silver-green);
}

.bar-empty {
    background-color: var(--silver-gray-bg);
}


/* ============================================
   4. NAVIGATION — Active state reinforcement
   ============================================ */

nav [aria-current="page"] {
    font-weight: 600;
}


/* ============================================
   5. HERO SECTION
   ============================================ */

.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-left: calc(-1 * var(--pico-spacing));
    margin-right: calc(-1 * var(--pico-spacing));
    padding-left: var(--pico-spacing);
    padding-right: var(--pico-spacing);
    background-color: var(--silver-hero-bg);
    border-bottom: 1px solid var(--silver-section-border);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--pico-muted-color);
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}


/* ============================================
   6. PRODUCT CARDS (article) & AGGREGATE STATS
   ============================================ */

article.product-card {
    margin-bottom: 1.5rem;
    transition: border-color var(--pico-transition);
}

article.product-card:hover {
    border-color: var(--pico-primary);
}

article.aggregate-stats {
    text-align: center;
}

.aggregate-percentage {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--pico-primary);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: 600;
    font-size: 1.25rem;
}


/* ============================================
   7. SECTION SPACING
   ============================================ */

main > section + section {
    border-top: 1px solid var(--silver-section-border);
    padding-top: 2rem;
    margin-bottom: 3rem;
}


/* ============================================
   8. EXPANDABLE DETAILS
   ============================================ */

details.dealer-details {
    margin-top: 1rem;
}

details.dealer-details summary {
    cursor: pointer;
    font-weight: 600;
    transition: color var(--pico-transition);
}

details.dealer-details summary:hover {
    color: var(--pico-primary);
}

.dealer-list {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.dealer-item {
    margin-bottom: 0.5rem;
}

.dealer-name {
    font-weight: 500;
}

.dealer-link {
    font-size: 0.875rem;
    margin-left: 0.5rem;
}


/* ============================================
   9. STALENESS WARNING — Theme-aware
   ============================================ */

.staleness-warning {
    background-color: var(--silver-amber-bg);
    color: var(--silver-amber);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid currentColor;
    margin-bottom: 1rem;
}


/* ============================================
   10. LAST UPDATED
   ============================================ */

.last-updated {
    text-align: center;
    color: var(--pico-muted-color);
    margin: 2rem 0;
}


/* ============================================
   11. WIKIFOLIO BADGES (Portfolio page)
   ============================================ */

.wf-badges-container {
    text-align: center;
    margin-bottom: 2rem;
}

.wf-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    margin: 0.25rem 0.15rem;
    transition: all var(--pico-transition);
}

.wf-badge-outline {
    border: 1.5px solid var(--silver-gray);
    color: var(--pico-color);
}

.wf-badge-highlight {
    border: 1.5px solid var(--silver-green);
    color: var(--silver-green);
}


/* ============================================
   12. PORTFOLIO — Certificate price grid
   ============================================ */

.portfolio-performance-img {
    max-width: 100%;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1.5rem;
}

.cert-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem 0;
}

.cert-price-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.cert-price-label {
    color: var(--pico-muted-color);
}

.cert-price-meta {
    color: var(--pico-muted-color);
}

.cert-table td:last-child {
    text-align: right;
}


/* ============================================
   13. PORTFOLIO — Composition bar & legend
   ============================================ */

.composition-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
}

.comp-segment {
    height: 100%;
}

.comp-stocks {
    background-color: var(--comp-stocks);
}

.comp-etfs {
    background-color: var(--comp-etfs);
}

.comp-structured {
    background-color: var(--comp-structured);
}

.comp-cash {
    background-color: var(--comp-cash);
}

.comp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.comp-legend-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}


/* ============================================
   14. SECTION CTA
   ============================================ */

.section-cta {
    text-align: center;
    margin: 3rem 0;
}


/* ============================================
   15. CONTENT IMAGE
   ============================================ */

.content-img {
    max-width: 100%;
    border-radius: var(--pico-border-radius);
    margin: 1rem 0;
}


/* ============================================
   16. FOOTER POLISH
   ============================================ */

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    color: var(--pico-muted-color);
}


/* ============================================
   17. ANTI-COOKIE BANNER
   ============================================ */

.no-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #b0bec5 0%, #cfd8dc 40%, #eceff1 60%, #cfd8dc 80%, #b0bec5 100%);
    color: #263238;
    border-top: 2px solid #90a4ae;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    padding: 1rem 1.5rem;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.no-cookie-banner.dismissed {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.no-cookie-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.no-cookie-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.no-cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    color: #263238;
}

.no-cookie-content strong {
    color: #37474f;
}

.no-cookie-btn {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border: 2px solid #455a64;
    background: #546e7a;
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--pico-transition);
}

.no-cookie-btn:hover {
    background: #37474f;
    border-color: #37474f;
}


/* ============================================
   18. RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .aggregate-percentage {
        font-size: 3rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .availability-bar {
        height: 1rem;
    }

    .cert-price-grid {
        grid-template-columns: 1fr;
    }

    .cert-price-value {
        font-size: 1.5rem;
    }

    .no-cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .no-cookie-icon {
        font-size: 1.5rem;
    }
}
