/* TBredIQ premium design system.
 * Loaded after main.css; layers on glass cards, animated counters,
 * sparklines, shimmer loaders, gradient backgrounds, premium typography.
 *
 * Used across: index.html, picks.html, track detail, /history, /performance.
 */

/* ───── Premium type stack ───── */
.premium {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    letter-spacing: -0.011em;
}
.premium-display {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.mono { font-family: 'JetBrains Mono', 'Menlo', 'Consolas', monospace; font-feature-settings: 'tnum'; }

/* ───── Gradient mesh background (used on hero) ───── */
.bg-mesh {
    position: relative;
    background: #08070a;
    color: #f1f5f9;
    overflow: hidden;
}
.bg-mesh::before, .bg-mesh::after {
    content: '';
    position: absolute;
    width: 800px; height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}
.bg-mesh::before {
    background: radial-gradient(circle at center, #fbbf24 0%, transparent 60%);
    top: -200px; left: -200px;
    animation: mesh-drift-a 18s ease-in-out infinite alternate;
}
.bg-mesh::after {
    background: radial-gradient(circle at center, #d97706 0%, transparent 60%);
    bottom: -200px; right: -200px;
    animation: mesh-drift-b 22s ease-in-out infinite alternate;
}
.bg-mesh > * { position: relative; z-index: 1; }
@keyframes mesh-drift-a {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(180px, 80px) scale(1.15); }
}
@keyframes mesh-drift-b {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-120px, -60px) scale(1.1); }
}

/* ───── Glass card (frosted, used on dark backgrounds) ───── */
.glass {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.glass:hover {
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-1px);
}
.glass-light {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(28, 25, 23, 0.06);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* ───── Animated stat counter ───── */
.stat-card {
    padding: 18px 22px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(251, 191, 36, 0.15);
}
.stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 6px;
}
.stat-value {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f1f5f9;
    line-height: 1;
}
.stat-value.gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-value.green {
    background: linear-gradient(135deg, #d1fae5 0%, #34d399 50%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-suffix {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    margin-left: 6px;
    font-weight: 500;
}

/* ───── Premium button ───── */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #1c1917;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-premium::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(251, 191, 36, 0.45);
}
.btn-premium:hover::after { transform: translateX(100%); }
.btn-premium:active { transform: translateY(0); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 13px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ───── Live ticker (top-of-page strip) ───── */
.ticker {
    background: linear-gradient(90deg, #0c0a09 0%, #1c1917 50%, #0c0a09 100%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    padding: 8px 0;
    overflow: hidden;
    color: #fafaf7;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 500;
}
.ticker-track {
    display: inline-flex;
    animation: ticker-scroll 60s linear infinite;
    white-space: nowrap;
}
.ticker-item {
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.ticker-item .dot {
    display: inline-block; width: 7px; height: 7px;
    background: #22c55e; border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}
.ticker-item .dot.amber { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.ticker-item .dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ───── Shimmer loading skeleton ───── */
.shimmer {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer-pulse 1.6s ease-in-out infinite;
    border-radius: 4px;
}
.shimmer-light {
    background: linear-gradient(90deg, #f5f5f4 0%, #e7e5e4 50%, #f5f5f4 100%);
    background-size: 200% 100%;
    animation: shimmer-pulse 1.6s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes shimmer-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-row {
    height: 64px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ───── Sparkline chart container ───── */
.sparkline {
    width: 100%; height: 60px;
    display: block;
}
.sparkline path.line {
    fill: none;
    stroke: url(#spark-gradient);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.sparkline path.area {
    fill: url(#spark-area);
    stroke: none;
    opacity: 0.3;
}

/* ───── Pick card (for picks-embed enhancement) ───── */
.pick-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.pick-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #fbbf24, #d97706);
    opacity: 0.6;
}
.pick-card:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(15, 23, 42, 0.6);
}

/* ───── Animated entry stagger ───── */
.fade-up {
    opacity: 0;
    transform: translateY(12px);
    animation: fade-up-in 0.5s ease forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.10s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.20s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
@keyframes fade-up-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ───── Responsive ───── */
@media (max-width: 720px) {
    .stat-value { font-size: 24px !important; }
    .premium-display { font-size: 30px !important; }
    .stat-card { padding: 14px 16px; }
    .ticker { font-size: 11.5px; }
    .ticker-item { padding: 0 16px; }
    .btn-premium { padding: 12px 22px; font-size: 14px; }
    /* Force grids to stack */
    .grid-stack-mobile { grid-template-columns: 1fr !important; }
    .grid-stack-mobile-2 { grid-template-columns: repeat(2, 1fr) !important; }
    /* Hide nav links on small screens, keep brand + CTA */
    .nav-links-mobile-hide { display: none !important; }
    /* Wrap nav rows */
    nav .container.row { flex-wrap: wrap; gap: 8px; }
    /* Hero typography compress */
    h1.premium-display { font-size: 36px !important; line-height: 1.1; }
    /* Form fields full-width on mobile */
    .form-row-mobile-stack { display: flex !important; flex-direction: column !important; gap: 8px !important; }
    /* Tables — make them scrollable */
    .scroll-x-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Universal touch-friendly tap targets */
button, a.btn-premium, a.btn-ghost, input[type="submit"] {
    min-height: 40px;
}

/* Smooth scroll on the document */
html { scroll-behavior: smooth; }

/* Track-row hover lift on cards */
.track-row {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.track-row:hover {
    transform: translateX(4px);
    background: rgba(251,191,36,0.04);
    border-color: rgba(251,191,36,0.3) !important;
}

/* Sparkline-mini for track rows (inline) */
.spark-mini {
    width: 80px; height: 24px;
    display: inline-block;
}

/* Live data pulse (for "X picks today" badges) */
.live-pulse {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
}
.live-pulse::before {
    content: ''; display: inline-block;
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.8);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Number animation utility */
.num-tick { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

/* Premium horizontal divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    margin: 24px 0;
}

/* Tab pill (used in filter buttons) */
.tab-pill {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: -0.005em;
}
.tab-pill:hover {
    background: rgba(255,255,255,0.08);
    color: #f1f5f9;
}
.tab-pill.active {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #1c1917;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(251,191,36,0.25);
}

/* Confidence bar (for picks ML score visualization) */
.conf-bar {
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.conf-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    transition: width 0.6s ease-out;
}

/* ───── Search input ───── */
.search-input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}
.search-input:focus {
    outline: none;
    border-color: rgba(251,191,36,0.4);
    background: rgba(255,255,255,0.06);
}
.search-input::placeholder { color: rgba(255,255,255,0.4); }

/* ───── Toast notifications ───── */
.toast-host {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    display: flex; align-items: center; gap: 10px;
    min-width: 220px; max-width: 360px;
    animation: toast-in 0.3s ease, toast-out 0.3s ease forwards;
    animation-delay: 0s, 3s;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.warn { border-left: 3px solid #fbbf24; }
.toast.error { border-left: 3px solid #ef4444; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateX(40px); }
}

/* ───── Mobile hamburger drawer ───── */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #f1f5f9;
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
}
.hamburger svg { display: block; }

@media (max-width: 720px) {
    .hamburger { display: inline-flex; }
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 280px;
    max-width: 80vw;
    background: #0c0a09;
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: -12px 0 32px rgba(0,0,0,0.5);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 18px 22px;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-close {
    align-self: flex-end;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.mobile-drawer a {
    display: block;
    padding: 12px 8px;
    color: #f1f5f9;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.15s ease;
}
.mobile-drawer a:hover { color: #fbbf24; }
.mobile-drawer a.active { color: #fbbf24; }
.mobile-drawer .drawer-section {
    margin-top: 18px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ───── Scroll-to-top floating action button ───── */
.fab-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 90;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f1f5f9;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}
.fab-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.fab-top:hover {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.4);
}

/* ───── Live odds shift indicator (in-place fade animation) ───── */
.live-shift {
    transition: color 0.4s ease, opacity 0.4s ease;
}
@keyframes price-flash {
    0% { background-color: rgba(251,191,36,0.4); }
    100% { background-color: transparent; }
}
.price-flash { animation: price-flash 1.2s ease-out; }

/* ───── Onboarding wizard ───── */
.onboard-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.onboard-overlay.open { display: flex; }
.onboard-card {
    background: #0c0a09;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    animation: onboard-pop 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes onboard-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.onboard-progress {
    display: flex; gap: 6px; margin-bottom: 22px;
}
.onboard-dot {
    flex: 1; height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    transition: background 0.3s ease;
}
.onboard-dot.active { background: linear-gradient(90deg, #fbbf24, #d97706); }
.onboard-dot.done { background: rgba(251,191,36,0.5); }
.onboard-step h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}
.onboard-step p.lede {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin: 0 0 20px 0;
    line-height: 1.55;
}
.onboard-actions {
    display: flex; gap: 10px; justify-content: space-between;
    margin-top: 24px;
    align-items: center;
}
.onboard-skip {
    background: none; border: none;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 4px;
}
.onboard-skip:hover { color: #fbbf24; }

/* ───── Pricing page ───── */
.pricing-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}
.pricing-toggle button {
    padding: 8px 18px;
    border: none;
    background: none;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.pricing-toggle button.active {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #1c1917;
}
.tier-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 28px 26px;
    transition: all 0.25s ease;
    position: relative;
}
.tier-card.featured {
    border-color: rgba(251,191,36,0.4);
    box-shadow: 0 12px 36px rgba(251,191,36,0.1);
}
.tier-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #1c1917;
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* ───── Pace-shape diagram ───── */
.pace-track {
    position: relative;
    height: 120px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.2));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.pace-rail-marker {
    position: absolute;
    bottom: 0; top: 0;
    width: 1px;
    background: rgba(255,255,255,0.05);
}
.pace-runner {
    position: absolute;
    height: 22px;
    border-radius: 11px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 600;
    color: #1c1917;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
    cursor: pointer;
}
.pace-runner:hover { transform: scale(1.05); z-index: 10; }
.pace-runner.E  { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.pace-runner.EP { background: linear-gradient(135deg, #f59e0b, #d97706); }
.pace-runner.P  { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.pace-runner.S  { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.pace-legend {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 10.5px;
    color: rgba(255,255,255,0.55);
    margin-top: 12px;
}
.pace-legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 5px;
    vertical-align: -1px;
}

/* ───── Print mode ───── */
@media print {
    body, html { background: white !important; color: #000 !important; }
    nav, footer, .no-print { display: none !important; }
    .glass { background: white !important; border: 1px solid #ccc !important; box-shadow: none !important; backdrop-filter: none !important; }
    .bg-mesh { background: white !important; color: #000 !important; }
    .bg-mesh::before, .bg-mesh::after { display: none !important; }
    .premium-display, h1, h2, h3 { color: #000 !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .btn-premium, .btn-ghost, .tab-pill { display: none !important; }
}
