/* Bright Market Lab — StockSt public theme */

:root {
    --canvas: #EEF3F7;
    --ink: #0F172A;
    --ink-muted: #475569;
    --brand: #0F766E;
    --brand-dark: #115E59;
    --brand-soft: rgba(15, 118, 110, 0.12);
    --accent: #EA580C;
    --accent-dark: #C2410C;
    --accent-soft: rgba(234, 88, 12, 0.12);
    --up: #0F766E;
    --down: #E11D48;
    --surface: #FFFFFF;
    --border: #D5DEE7;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    --radius: 8px;
    --font-display: "Sora", system-ui, sans-serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;
    --nav-height: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.stockst-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--canvas);
    background-image:
        linear-gradient(rgba(15, 118, 110, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 118, 110, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    display: flex;
    flex-direction: column;
}

body.stockst-body main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, .display-font {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-dark);
}

.text-muted,
.text-secondary {
    color: var(--ink-muted) !important;
}

/* —— Nav —— */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(238, 243, 247, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    min-height: var(--nav-height);
}

.site-nav .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--ink) !important;
    letter-spacing: -0.03em;
}

.site-nav .navbar-brand img.logo {
    height: 36px;
    width: auto;
}

.site-nav .nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-muted) !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: 6px;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--brand) !important;
    background: var(--brand-soft);
}

.site-nav .navbar-toggler {
    border-color: var(--border);
}

.site-nav .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem var(--brand-soft);
}

/* —— Footer —— */
.site-footer {
    margin-top: auto;
    background: var(--ink);
    color: rgba(255, 255, 255, 0.78);
    padding: 2.5rem 0 1.75rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
    color: #5EEAD4;
}

.site-footer .brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.site-footer .footer-meta {
    font-size: 0.9rem;
    opacity: 0.75;
}

/* —— Buttons —— */
.btn-brand,
.btn-primary-teen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius);
    border: none;
    background: var(--brand);
    color: #fff !important;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-brand:hover,
.btn-primary-teen:hover {
    background: var(--brand-dark);
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-accent,
.btn-secondary-teen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: #fff !important;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-accent:hover,
.btn-secondary-teen:hover {
    background: var(--accent-dark);
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius);
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: transparent;
    color: #fff !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
    background: #fff;
    color: var(--brand) !important;
    transform: translateY(-2px);
}

.btn-outline-brand {
    font-family: var(--font-display);
    font-weight: 600;
    border: 2px solid var(--brand);
    color: var(--brand) !important;
    background: transparent;
    border-radius: var(--radius);
    padding: 0.65rem 1.2rem;
}

.btn-outline-brand:hover {
    background: var(--brand);
    color: #fff !important;
}

/* Bootstrap primary override on public pages */
body.stockst-body .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    font-family: var(--font-display);
    font-weight: 600;
}

body.stockst-body .btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

body.stockst-body .btn-secondary {
    background: var(--ink-muted);
    border-color: var(--ink-muted);
}

body.stockst-body .btn-success {
    background: var(--up);
    border-color: var(--up);
}

body.stockst-body .btn-danger {
    background: var(--down);
    border-color: var(--down);
}

/* —— Forms & surfaces —— */
body.stockst-body .card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
}

body.stockst-body .card-header.bg-primary,
body.stockst-body .bg-primary {
    background: var(--brand) !important;
}

body.stockst-body .form-control,
body.stockst-body .form-select {
    border-radius: var(--radius);
    border-color: var(--border);
    padding: 0.7rem 0.95rem;
}

body.stockst-body .form-control:focus,
body.stockst-body .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem var(--brand-soft);
}

body.stockst-body .table {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

body.stockst-body .table > :not(caption) > * > * {
    border-color: var(--border);
}

body.stockst-body .breadcrumb {
    background: transparent;
    padding: 0;
}

body.stockst-body .alert {
    border-radius: var(--radius);
    border: none;
}

body.stockst-body .page-shell {
    padding: 1.75rem 0 3rem;
}

body.stockst-body .section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin-bottom: 0.5rem;
    text-align: center;
}

body.stockst-body .section-lead {
    text-align: center;
    color: var(--ink-muted);
    max-width: 36rem;
    margin: 0 auto 2rem;
}

.price-up,
.price-change-percent.price-up {
    color: var(--up) !important;
    font-weight: 600;
}

.price-down,
.price-change-percent.price-down {
    color: var(--down) !important;
    font-weight: 600;
}

/* —— Homepage hero —— */
.hero-lab {
    position: relative;
    min-height: min(88vh, 720px);
    display: flex;
    align-items: center;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

/* Compact hero on homepage so people + learning fit above the fold */
body.page-home .hero-lab {
    min-height: 0;
    padding: 2.25rem 0 2rem;
}

body.page-home .hero-lab .brand-mark {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    margin-bottom: 0.4rem;
}

body.page-home .hero-lab .hero-headline {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    margin-bottom: 0.45rem;
}

body.page-home .hero-lab .hero-support {
    font-size: 1rem;
    margin-bottom: 1rem;
    max-width: 42ch;
}

body.page-home .lab-section.above-fold {
    padding: 1.75rem 0 1.5rem;
}

body.page-home .lab-section.above-fold .section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
    text-align: left;
    margin-bottom: 0.25rem;
}

body.page-home .lab-section.above-fold .section-lead {
    text-align: left;
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

body.page-home .people-thumbs .celebrity-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
}

body.page-home .people-thumbs .celebrity-image {
    width: 88px;
    min-width: 88px;
    height: 88px;
    flex-shrink: 0;
}

body.page-home .people-thumbs .celebrity-info {
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
}

body.page-home .people-thumbs .celebrity-name {
    font-size: 0.95rem;
}

body.page-home .people-thumbs .current-price {
    font-size: 0.95rem;
}

body.page-home .people-thumbs .celebrity-meta,
body.page-home .people-thumbs .action-buttons-stock .sell-btn,
body.page-home .people-thumbs .action-buttons-stock .info-btn {
    display: none;
}

body.page-home .people-thumbs .action-buttons-stock .buy-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
}

body.page-home .people-thumbs .celebrity-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.hero-lab::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 118, 110, 0.55) 55%, rgba(234, 88, 12, 0.35) 100%),
        url("/static/images/stock-market-buy-sell.jpeg") center/cover no-repeat;
    z-index: -1;
}

.hero-lab .brand-mark {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 0.75rem;
    line-height: 1.05;
    animation: heroFade 0.7s ease both;
}

.hero-lab .hero-headline {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
    max-width: 28ch;
    animation: heroFade 0.7s ease 0.1s both;
}

.hero-lab .hero-support {
    font-size: 1.1rem;
    max-width: 36ch;
    margin: 0 0 1.75rem;
    opacity: 0.92;
    animation: heroFade 0.7s ease 0.18s both;
}

.hero-lab .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: heroFade 0.7s ease 0.26s both;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-row-item {
    animation: stockRise 0.45s ease both;
}

.stock-row-item:nth-child(1) { animation-delay: 0.05s; }
.stock-row-item:nth-child(2) { animation-delay: 0.1s; }
.stock-row-item:nth-child(3) { animation-delay: 0.15s; }
.stock-row-item:nth-child(4) { animation-delay: 0.2s; }
.stock-row-item:nth-child(5) { animation-delay: 0.25s; }
.stock-row-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes stockRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content sections */
.lab-section {
    padding: 3.5rem 0;
}

.lab-section.surface {
    background: var(--surface);
}

.lab-section.tint {
    background: var(--brand-soft);
}

.celebrity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.celebrity-card:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
}

.celebrity-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--brand), #134E4A);
}

.stocks-preview .stocks-preview-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center top;
    display: block;
    background: linear-gradient(135deg, var(--brand), #134E4A);
}

.celebrity-card-link {
    display: block;
    color: inherit;
}

.celebrity-card-link:hover .celebrity-name {
    color: var(--brand);
}

/* —— Stock quote / trading profile —— */
.stock-quote-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand), #134E4A);
}

.stock-quote-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.stock-quote-chart.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
}

.stock-stat {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.stock-stat-label {
    font-size: 0.85rem;
    color: var(--muted, #6b7280);
    margin-bottom: 0.2rem;
}

.stock-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

a.stock-term-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

a.stock-term-link:hover {
    color: var(--brand);
}

.stock-trade-rail {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stock-trade-rail .nav-link {
    font-size: 0.95rem;
}

.stock-trade-rail .nav-link.active {
    background: var(--brand) !important;
}

.celebrity-info {
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.celebrity-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0;
}

.celebrity-symbol-large {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.04em;
}

.current-price {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
}

.celebrity-meta {
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.celebrity-meta p {
    margin-bottom: 0.2rem;
}

.meta-label {
    font-weight: 600;
    color: var(--ink);
}

.action-buttons-stock {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.action-buttons-stock .btn {
    flex: 1;
    font-family: var(--font-display);
    font-weight: 600;
}

.learn-step {
    text-align: center;
    padding: 1rem;
}

.learn-step .step-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.25rem;
}

.education-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.education-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.auth-panel {
    max-width: 480px;
    margin: 0 auto;
}

#showcase-inner {
    background: linear-gradient(120deg, #0F172A, #0F766E);
    color: #fff;
    border-radius: 0;
}

#showcase-inner h1 {
    color: #fff;
    font-family: var(--font-display);
}

.auth-panel .card-header {
    background: var(--brand) !important;
    color: #fff;
    border: none;
}

@media (max-width: 767.98px) {
    .hero-lab {
        min-height: 78vh;
        padding: 2.5rem 0;
    }

    body.page-home .hero-lab {
        min-height: 0;
        padding: 1.75rem 0 1.5rem;
    }

    body.page-home .people-thumbs .celebrity-card {
        flex-direction: column;
    }

    body.page-home .people-thumbs .celebrity-image {
        width: 100%;
        height: 110px;
    }

    .site-nav .navbar-brand {
        font-size: 1.15rem;
    }
}
