/* ==========================================================================
   CARDS — Card styles, stat cards, metric cards, paper cards, feature cards,
   hero sections, tool cards, tech badges, status badges, about page cards,
   contact form, onboarding tour, alerts panel
   Split from custom.css
   ========================================================================== */

/* Inline status badges for project cards */
.status-badge-inline {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge-inline.status-active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.status-badge-inline.status-research {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.15);
}

.status-badge-inline.status-new {
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.15);
}

.status-badge-inline.status-coming {
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
}

.status-badge-inline.status-beta {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.status-badge-inline.status-publication {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.15);
}

.status-badge-inline.status-complete {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

.status-badge-inline.status-version {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.3px;
    transition: background 0.2s ease, color 0.2s ease;
}

.status-badge-inline.status-version:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
}

/* Light mode version badge */
body:not(.dark-mode) .status-badge-inline.status-version,
[data-bs-theme="light"] .status-badge-inline.status-version {
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
}

body:not(.dark-mode) .status-badge-inline.status-version:hover,
[data-bs-theme="light"] .status-badge-inline.status-version:hover {
    background: rgba(100, 116, 139, 0.2);
    color: #475569;
}

/* Version popover styling */
.popover {
    --bs-popover-bg: #1e293b;
    --bs-popover-border-color: #334155;
    --bs-popover-header-bg: #0f172a;
    --bs-popover-header-color: #e2e8f0;
    --bs-popover-body-color: #cbd5e1;
    font-size: 0.85rem;
}

/* Prevent popover scroll from bubbling to page */
.popover .popover-body {
    overscroll-behavior: contain;
}

body:not(.dark-mode) .popover,
[data-bs-theme="light"] .popover {
    --bs-popover-bg: #ffffff;
    --bs-popover-border-color: #e2e8f0;
    --bs-popover-header-bg: #f8fafc;
    --bs-popover-header-color: #1e293b;
    --bs-popover-body-color: #475569;
}

/* Compact expandable project cards */
.project-card-compact {
    background: #1e293b;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 140px;
}

.project-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--card-accent, #3b82f6);
    height: auto;
    min-height: 200px;
    z-index: 10;
}

.project-card-compact .card-preview {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.project-card-compact:hover .card-preview {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.75rem;
}

.project-card-compact .card-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-card-compact .stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.project-card-compact .stat-value {
    font-size: 1rem;
    font-weight: 700;
}

.project-card-compact .stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.project-card-compact.fingnn { --card-accent: #60a5fa; }
.project-card-compact.finmech { --card-accent: #a78bfa; }
.project-card-compact.finnews { --card-accent: #f59e0b; }
.project-card-compact.conformalrl { --card-accent: #14b8a6; }
.project-card-compact.diffaugment { --card-accent: #f43f5e; }
.project-card-compact.finfed { --card-accent: #22c55e; }
.project-card-compact.finworld { --card-accent: #6366f1; }
.project-card-compact.finfoundation { --card-accent: #64748b; }
.project-card-compact.causalrl { --card-accent: #f97316; }
.project-card-compact.finesg { --card-accent: #10b981; }
.project-card-compact.finneuro { --card-accent: #ec4899; }
.project-card-compact.finattack { --card-accent: #ef4444; }
.project-card-compact.finmeta { --card-accent: #06b6d4; }
.project-card-compact.finsim { --card-accent: #8b5cf6; }
.project-card-compact.finregime { --card-accent: #eab308; }

.project-card-compact .expand-hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    font-size: 0.65rem;
    color: #475569;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.project-card-compact:hover .expand-hint {
    opacity: 0;
}

/* Landing hero sections for Phase 10/12/14 modules */
.landing-hero { margin-bottom: 2rem; }
.landing-hero .landing-badge { font-size: 1.1rem; padding: 0.4rem 1rem; }
.landing-hero .landing-version { color: #64748b; margin-left: 0.75rem; font-size: 0.85rem; }
.landing-hero h2 { margin-bottom: 0.5rem; }
.landing-hero .landing-subtitle { color: #94a3b8; font-size: 1.1rem; }
.landing-hero .landing-methodology {
    color: #94a3b8; line-height: 1.6; padding: 1.25rem;
    background: rgba(255,255,255,0.02); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.landing-divider { border-color: #334155; margin: 2rem 0; }

/* Page layout classes for Phase 10/12 module pages */
.page-container {
    padding: 0;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header .page-title {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.page-header .page-description {
    color: #94a3b8;
    margin-bottom: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Metric card */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    color: var(--text-primary);
    font-size: clamp(1.1rem, 2.5vw, 1.625rem);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-delta {
    font-size: clamp(0.65rem, 1.5vw, 0.875rem);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.metric-delta.positive { color: #34d399; }
.metric-delta.negative { color: #f87171; }

/* Base card */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
}

.card-header {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1e1b4b 100%);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233b82f6' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-title {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #60a5fa;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-subtle-accessible, #8896a6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Feature Cards */
.feature-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--text-subtle-accessible, #8896a6);
    line-height: 1.5;
}

/* Tool Cards Container - Single row on desktop */
.trading-tools-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.tool-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tool-card-clickable { cursor: pointer; }

.tool-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(59, 130, 246, 0.3);
}

.tool-card .feature-title {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.tool-card .feature-desc {
    font-size: 0.8rem;
}

/* Tech Stack Badges */
.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-subtle-accessible, #8896a6);
    margin: 0.25rem;
}

.tech-badge-icon {
    color: #60a5fa;
}

/* Version History Modal */
.version-tag {
    display: inline-block;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    font-size: 1rem;
}

.version-item {
    padding: 0.5rem 0;
}

/* Performance Chart Card */
.perf-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
}

/* Live ticker with auto-scroll */
.live-ticker {
    display: flex;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, rgba(30, 30, 46, 0.8), rgba(30, 30, 46, 0.4));
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.2);
    position: relative;
}

.live-ticker::before,
.live-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.live-ticker::before {
    left: 0;
    background: linear-gradient(90deg, rgba(30, 30, 46, 1), transparent);
}

.live-ticker::after {
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(30, 30, 46, 1));
}

.ticker-track {
    display: flex;
    gap: 1.5rem;
    animation: ticker-scroll 25s linear infinite;
    padding-right: 1.5rem;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-symbol {
    font-weight: 600;
    color: #e2e8f0;
}

.ticker-price {
    color: #94a3b8;
}

.ticker-change {
    font-size: 0.875rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.ticker-up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.ticker-down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

@keyframes ticker-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ticker-live {
    animation: ticker-pulse 1s ease-in-out infinite;
}

/* About page -- animated gradient hero */
.about-hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    min-height: 340px;
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.about-gradient-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 25%, rgba(99, 102, 241, 0.35) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 70%, rgba(20, 184, 166, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 50% 10%, rgba(167, 139, 250, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 85% 20%, rgba(96, 165, 250, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    background-size: 200% 200%;
    animation: about-mesh-shift 12s ease-in-out infinite alternate;
    filter: blur(40px);
    opacity: 0.85;
}
@keyframes about-mesh-shift {
    0%   { background-position: 0% 0%; }
    25%  { background-position: 50% 30%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 30% 80%; }
    100% { background-position: 60% 20%; }
}
.about-hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}
.about-hero-name {
    font-size: 2rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}
.about-hero-title {
    font-size: 1.05rem;
    color: rgba(226, 232, 240, 0.7);
    margin-bottom: 1.25rem;
}
.about-hero-bio {
    color: rgba(203, 213, 225, 0.85);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
/* Light mode hero */
body.theme-light .about-hero-card { background: #f0f3f7; border-color: rgba(0,0,0,0.12); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
body.theme-light .about-gradient-mesh {
    background:
        radial-gradient(ellipse 60% 50% at 15% 25%, rgba(99, 102, 241, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 70%, rgba(20, 184, 166, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 50% 10%, rgba(167, 139, 250, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 85% 20%, rgba(96, 165, 250, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    background-size: 200% 200%;
    filter: blur(50px);
    opacity: 0.7;
}
/* Contact form card -- reuses hero card structure with shifted gradient */
.contact-card {
    min-height: auto;
    padding: 2.5rem 2.5rem;
}
.contact-gradient-mesh {
    background:
        radial-gradient(ellipse 55% 50% at 80% 30%, rgba(99, 102, 241, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 50% 55% at 20% 65%, rgba(20, 184, 166, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 90%, rgba(167, 139, 250, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 10% 20%, rgba(96, 165, 250, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 75% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 70%) !important;
    background-size: 200% 200%;
    animation: about-mesh-shift 15s ease-in-out infinite alternate-reverse;
}
body.theme-light .contact-gradient-mesh {
    background:
        radial-gradient(ellipse 55% 50% at 80% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 50% 55% at 20% 65%, rgba(20, 184, 166, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 90%, rgba(167, 139, 250, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 10% 20%, rgba(96, 165, 250, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 75% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 70%) !important;
    background-size: 200% 200%;
    filter: blur(50px);
    opacity: 0.7;
}

body.theme-light .about-hero-name { color: #0f172a; }
body.theme-light .about-hero-title { color: #475569; }
body.theme-light .about-hero-bio { color: #475569; }

/* About page links */
.about-links { display: flex; gap: 1rem; flex-wrap: wrap; overflow: visible; }
.about-link {
    display: inline-flex; align-items: center; gap: 0.25rem;
    color: #60a5fa; text-decoration: none; font-size: 0.9rem;
    padding: 0.4rem 0.75rem; border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px; transition: all 0.15s;
}
.about-link:hover {
    background: rgba(96, 165, 250, 0.1); border-color: #60a5fa; color: #93c5fd;
}
body.theme-light .about-link { color: #2563eb; border-color: rgba(37, 99, 235, 0.3); }
body.theme-light .about-link:hover { background: rgba(37, 99, 235, 0.08); color: #1d4ed8; }

/* About link inline descriptions */
.about-link { white-space: nowrap; }

/* About page link cards */
.about-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: #3b82f6 !important;
}

/* Auto-refresh controls */
.header-controls {
    background: rgba(255,255,255,0.03);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}

.refresh-slider .rc-slider-track {
    background: #3b82f6 !important;
}

.refresh-slider .rc-slider-handle {
    border-color: #3b82f6 !important;
    background: #3b82f6 !important;
}

.refresh-slider .rc-slider-rail {
    background: #2a2a3a !important;
}

.auto-refresh-switch .form-check-input:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Pulse animation for live indicator */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* PDF Export Button */
.pdf-export-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pdf-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Excel Export Button */
.excel-export-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
}

/* Onboarding Tour */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

.tour-tooltip {
    position: fixed;
    background: #1e1e2e;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 350px;
    z-index: 10001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.tour-progress {
    display: flex;
    gap: 4px;
    margin-top: 1rem;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
}

.tour-dot.active {
    background: #3b82f6;
}

/* Enhanced Onboarding Tour */
.tour-spotlight {
    position: fixed;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    z-index: 9999;
    transition: all 0.3s ease;
    border: 2px solid #60a5fa;
}

.tour-tooltip.visible {
    opacity: 1;
    transform: scale(1);
}

.tour-step-counter {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.tour-progress {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tour-dot:hover {
    transform: scale(1.2);
}

.tour-dot.active {
    background: #3b82f6;
    width: 10px;
    height: 10px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.tour-dot.completed {
    background: #22c55e;
}

.tour-btn-group {
    display: flex;
    gap: 0.5rem;
}

@keyframes tour-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

.tour-highlight-pulse {
    animation: tour-pulse 2s ease-in-out infinite;
}

/* 18. Tour tooltip light mode */
body.theme-light .tour-tooltip {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Alerts Panel */
.alerts-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: #1e1e2e;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 1rem;
    z-index: 100;
}

.alert-item {
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.alert-item.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

/* Breadcrumb navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-item:hover {
    color: #60a5fa;
}

.breadcrumb-separator {
    color: #475569;
}

.breadcrumb-current {
    color: #f1f5f9;
    font-weight: 500;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.contact-input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
    border-radius: 0.5rem !important;
    padding: 0.65rem 1rem !important;
    color: #e2e8f0 !important;
    width: 100% !important;
    font-size: 0.85rem !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.contact-input:focus {
    border-color: rgba(96, 165, 250, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1) !important;
    outline: none !important;
}

.contact-input::placeholder {
    color: #475569 !important;
}

.contact-input.is-invalid,
.contact-input:invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.contact-textarea {
    resize: vertical !important;
    min-height: 120px;
}

.contact-submit-btn {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    color: #93c5fd;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    width: fit-content;
}

.contact-submit-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}

.contact-submit-btn:active {
    background: rgba(96, 165, 250, 0.25);
}

/* Light mode contact form */
body.theme-light .contact-input {
    background: rgba(241, 245, 249, 0.8) !important;
    border: 1px solid rgba(203, 213, 225, 0.5) !important;
    color: #0f172a !important;
}

body.theme-light .contact-input:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15) !important;
}

body.theme-light .contact-input::placeholder {
    color: #94a3b8 !important;
}

body.theme-light .contact-submit-btn {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    color: #2563eb;
}

body.theme-light .contact-submit-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.35);
}

/* ============================================
   HERO METRICS DASHBOARD
   ============================================ */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hero-metric-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.hero-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--metric-accent, #3b82f6);
}

.hero-metric-card.positive { --metric-accent: #22c55e; }
.hero-metric-card.negative { --metric-accent: #ef4444; }
.hero-metric-card.neutral { --metric-accent: #60a5fa; }

.hero-metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.hero-metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}

.hero-metric-change {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.hero-metric-change.positive { color: #22c55e; }
.hero-metric-change.negative { color: #ef4444; }

/* ============================================
   TIME RANGE FILTER BUTTONS
   ============================================ */
.time-range-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.time-filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #2a2a3a;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.time-filter-btn:hover {
    border-color: #3b82f6;
    color: #60a5fa;
}

.time-filter-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #60a5fa;
}

body.theme-light .time-filter-btn {
    border-color: #e2e8f0;
    color: #475569;
}

body.theme-light .time-filter-btn:hover,
body.theme-light .time-filter-btn.active {
    border-color: #1d4ed8;
    color: #1d4ed8;
}

/* ============================================
   EXPORT BUTTONS
   ============================================ */
.export-buttons {
    display: inline-flex;
    gap: 0.5rem;
    margin-left: 1rem;
    vertical-align: middle;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #2a2a3a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.export-btn.csv {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.export-btn.csv:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    transform: translateY(-1px);
}

.export-btn.pdf {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.export-btn.pdf:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
}

/* 24. Export button borders light mode */
body.theme-light .export-btn {
    border-color: #cbd5e1 !important;
}

/* Light mode card overrides */
body.theme-light .card {
    background: var(--bg-card);
    border-color: #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Light mode feature cards */
body.theme-light .feature-card {
    background: #f8fafc !important;
    border-color: #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .feature-title {
    color: #0f172a !important;
}

body.theme-light .feature-desc {
    color: #475569 !important;
}

/* Light mode hero and stats */
body.theme-light .hero-stat-value,
body.theme-light .hero-stat-label {
    color: #0f172a !important;
}

body.theme-light .hero-subtitle {
    color: #475569 !important;
}

/* Light mode alerts panel */
body.theme-light .alerts-panel {
    background: #f8fafc !important;
    border-color: #b0bec5 !important;
}

body.theme-light .alerts-panel h6 {
    color: #0f172a !important;
}

body.theme-light .alert-item {
    color: #0f172a !important;
}

body.theme-light .alert-item.warning {
    background: rgba(245, 158, 11, 0.15) !important;
}

body.theme-light .alert-item.info {
    background: rgba(59, 130, 246, 0.15) !important;
}

body.theme-light .chart-container {
    background: #f8fafc !important;
    border-color: #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}
body.theme-light .chart-container h3 {
    color: #0f172a !important;
}
body.theme-light .metric-card {
    background: #f8fafc !important;
    border: 1px solid #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}
body.theme-light .metric-card .metric-label {
    color: #475569 !important;
}
body.theme-light .metric-card .metric-value {
    color: #0f172a !important;
}
body.theme-light .metric-card .metric-delta {
    color: #475569 !important;
}

/* Light mode chart containers */
body.theme-light .chart-container {
    background: #f8fafc !important;
}

/* 12. Project card compact light mode */
body.theme-light .project-card-compact {
    background: #f8fafc !important;
    border-color: #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .project-card-compact:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border-color: #94a3b8 !important;
}

/* 13. Live ticker -- light background, fade edges, dark text */
body.theme-light .live-ticker {
    background: linear-gradient(90deg, rgba(232, 237, 243, 0.95), rgba(223, 230, 238, 0.7)) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
}

body.theme-light .live-ticker::before {
    background: linear-gradient(90deg, rgba(223, 230, 238, 1), transparent) !important;
}

body.theme-light .live-ticker::after {
    background: linear-gradient(90deg, transparent, rgba(223, 230, 238, 1)) !important;
}

/* 14. Ticker price */
body.theme-light .ticker-price {
    color: #475569 !important;
}

/* 15. Tool card */
body.theme-light .tool-card {
    background: #f8fafc !important;
    border: 1px solid #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .tool-card:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* 16. Performance card */
body.theme-light .perf-card {
    background: #f8fafc !important;
    border-color: #b0bec5 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Blog Image Lightbox */
.blog-image {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
body.theme-light .blog-image {
    border-color: #e2e8f0 !important;
}
body.theme-light .blog-image:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
/* Theme-aware blog images: swap dark/light variants */
.blog-img-dark { display: block; }
.blog-img-light { display: none !important; }
body.theme-light .blog-img-dark { display: none !important; }
body.theme-light .blog-img-light { display: block !important; }
@media (prefers-color-scheme: light) {
    body:not(.theme-dark) .blog-img-dark { display: none !important; }
    body:not(.theme-dark) .blog-img-light { display: block !important; }
}
