/* MarketPulse Custom Styles */

/* CSS Variables for Corporate Design */
:root {
    /* Brand Colors */
    --brand-primary: #1a5490;
    --brand-primary-dark: #0f3a61;
    --brand-primary-light: #2563eb;

    /* Signal Colors - WCAG AA Compliant */
    --signal-bullish: #059669;
    --signal-neutral: #d97706;
    --signal-bearish: #dc2626;

    /* Neutral Palette - Layered approach for reduced brightness */
    --neutral-50: #fafafa;  /* Page background - soft gray */
    --neutral-100: #f5f5f5; /* Footer/section background - medium gray */
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-700: #374151;
    --neutral-900: #111827;

    /* Override Pico CSS defaults for layered backgrounds */
    --pico-background-color: #f5f5f5;      /* Page background (matches footer) */
    --pico-card-background-color: #ffffff; /* Cards stay white for contrast */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;

    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
}

/* Dark Theme Support */
[data-theme="dark"] {
    --brand-primary: #4a9bd9;
    --brand-primary-dark: #2563eb;
    --brand-primary-light: #60a5fa;

    --signal-bullish: #10b981;
    --signal-neutral: #f59e0b;
    --signal-bearish: #ef4444;

    --neutral-50: #111827;
    --neutral-100: #1f2937;
    --neutral-200: #374151;
    --neutral-300: #4b5563;
    --neutral-400: #6b7280;
    --neutral-500: #9ca3af;
    --neutral-700: #d1d5db;
    --neutral-900: #f9fafb;

    /* Override Pico CSS backgrounds for dark mode */
    --pico-background-color: #111827;      /* Dark page background */
    --pico-card-background-color: #1f2937; /* Dark card background */

    /* Dark mode shadows - lighter for visibility on dark backgrounds */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Apply font family globally */
body {
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    line-height: var(--line-height-normal, 1.5);
    background-color: var(--pico-background-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    line-height: var(--line-height-tight, 1.2);
    letter-spacing: var(--letter-spacing-tight, -0.02em);
}

/* Signal Text Colors */
.signal-bullish {
    color: var(--signal-bullish);
    font-weight: bold;
}

.signal-neutral {
    color: var(--signal-neutral);
    font-weight: bold;
}

.signal-bearish {
    color: var(--signal-bearish);
    font-weight: bold;
}

/* Signal Badge Styling */
.signal-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.signal-badge.signal-bullish {
    background: var(--signal-bullish);
    color: white;
}

.signal-badge.signal-neutral {
    background: var(--signal-neutral);
    color: white;
}

.signal-badge.signal-bearish {
    background: var(--signal-bearish);
    color: white;
}

/* Signal Emoji Styling */
.signal-emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Card Header Horizontal Layout */
.card-header-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.security-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.security-title strong {
    font-size: 1.1rem;
    white-space: nowrap;
}

.security-title small {
    font-weight: normal;
    color: var(--pico-muted-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid Layout for Security Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Make grid single-column on mobile */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Security Card Styling */
.security-card {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    height: fit-content;
    background: var(--pico-card-background-color, #ffffff);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--neutral-300, #d1d5db);
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-color 0.3s ease;
}

.security-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

/* Dark theme override for security cards */
[data-theme="dark"] .security-card {
    background: var(--neutral-100, #1f2937);
}

/* Colored left border for cards based on signal */
.security-card.card-bullish {
    border-left-color: var(--signal-bullish, #059669);
}

.security-card.card-bullish:hover {
    border-left-color: var(--signal-bullish, #059669);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.2);
}

.security-card.card-neutral {
    border-left-color: var(--signal-neutral, #d97706);
}

.security-card.card-neutral:hover {
    border-left-color: var(--signal-neutral, #d97706);
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.2);
}

.security-card.card-bearish {
    border-left-color: var(--signal-bearish, #dc2626);
}

.security-card.card-bearish:hover {
    border-left-color: var(--signal-bearish, #dc2626);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.2);
}

/* Narratives Section */
.narratives {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.narratives h6 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.narratives ul {
    margin: 0;
    padding-left: 1.25rem;
}

.narratives li {
    margin-bottom: 0.25rem;
    font-size: 0.925rem;
    line-height: 1.7;
}

/* Positive Narrative Styling */
.narratives.positive {
    background: rgba(46, 204, 113, 0.05);
    border-left: 3px solid var(--signal-bullish);
}

[data-theme="dark"] .narratives.positive {
    background: rgba(46, 204, 113, 0.08);
}

/* Negative Narrative Styling */
.narratives.negative {
    background: rgba(231, 76, 60, 0.05);
    border-left: 3px solid var(--signal-bearish);
}

[data-theme="dark"] .narratives.negative {
    background: rgba(231, 76, 60, 0.08);
}

/* Rationale Section */
.rationale {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(100, 100, 100, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--pico-muted-border-color);
}

.rationale h6 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.rationale p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

[data-theme="dark"] .rationale {
    background: rgba(255, 255, 255, 0.03);
}

/* Difference Analysis Section */
.diff-analysis {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid;
}

.diff-analysis h6 {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.6;
    word-wrap: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Diff Impact Badge */
.diff-impact-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    text-transform: capitalize;
    white-space: nowrap;
}

.diff-impact-badge.positive {
    background: var(--signal-bullish);
}

.diff-impact-badge.negative {
    background: var(--signal-bearish);
}

.diff-impact-badge.neutral {
    background: var(--signal-neutral);
}

.diff-overall {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.diff-overall strong {
    display: inline-block;
    margin-right: 0.25rem;
}

.diff-items {
    margin-top: 0.5rem;
}

.diff-item {
    margin: 0.35rem 0;
    padding-left: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Positive Diff Analysis Styling */
.diff-analysis.positive {
    background: rgba(46, 204, 113, 0.05);
    border-left-color: var(--signal-bullish);
}

[data-theme="dark"] .diff-analysis.positive {
    background: rgba(46, 204, 113, 0.08);
}

/* Negative Diff Analysis Styling */
.diff-analysis.negative {
    background: rgba(231, 76, 60, 0.05);
    border-left-color: var(--signal-bearish);
}

[data-theme="dark"] .diff-analysis.negative {
    background: rgba(231, 76, 60, 0.08);
}

/* Neutral Diff Analysis Styling */
.diff-analysis.neutral {
    background: rgba(243, 156, 18, 0.05);
    border-left-color: var(--signal-neutral);
}

[data-theme="dark"] .diff-analysis.neutral {
    background: rgba(243, 156, 18, 0.08);
}

/* Modal Styling */
#podcast-modal {
    max-width: 600px;
}

#podcast-modal article {
    margin: 0;
}

/* Transcript Container */
#transcript-container {
    margin-top: 1rem;
}

#transcript-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Audio Player Styling */
audio {
    width: 100%;
    margin: 0.5rem 0;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Small Buttons - Podcast Player */
button.outline[onclick*="playInline"] {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    margin: 0.25rem 0.25rem 0 0;
}

/* Dark theme override for podcast buttons */
[data-theme="dark"] button.outline[onclick*="playInline"] {
    color: var(--pico-primary);
    border-color: var(--pico-primary);
}

[data-theme="dark"] button.outline[onclick*="playInline"]:hover {
    background-color: rgba(1, 170, 255, 0.1);
    border-color: var(--pico-primary-hover);
    color: var(--pico-primary-hover);
}

/* Navigation Styling */
nav {
    padding: 0.5rem 2rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

nav ul li mark {
    padding: 0.125rem 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Navigation buttons (logout) - match font size with admin text */
nav ul li a[role="button"] {
    font-size: 0.875em;
}

/* Navigation Branding */
.nav-brand strong {
    color: var(--pico-primary);
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

/* Rotating N Logo */
.nav-logo {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-primary, #1a5490);
    margin-right: 0.3rem;
    transform-style: preserve-3d;
    animation: rotateN 25s linear infinite;
}

[data-theme="dark"] .nav-logo {
    color: var(--brand-primary, #4a9bd9);
}

@keyframes rotateN {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .nav-logo {
        animation: none;
    }
}

/* Center Navigation Links (like cursor.com) */
.nav-center {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0 auto;
    list-style: none;
}

.nav-center li {
    position: relative;
    list-style: none;
}

.nav-center > li > a {
    text-decoration: none;
    color: var(--pico-color);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    display: block;
}

.nav-center > li > a:hover {
    background: var(--pico-secondary-hover);
    color: var(--pico-primary);
}

/* Dropdown Menu - appears on hover */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0.5rem 0 0 0;
    padding: 0.5rem 0;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu li {
    list-style: none;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--pico-color);
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--pico-secondary-hover);
    color: var(--pico-primary);
}

@media (max-width: 768px) {
    .nav-center {
        display: none; /* Hide on mobile */
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--neutral-300, #d1d5db);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    background: var(--neutral-100, #f3f4f6);
    transform: scale(1.1);
    border-color: var(--brand-primary, #1a5490);
}

[data-theme="dark"] .theme-toggle {
    border-color: var(--neutral-500, #9ca3af);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--neutral-200, #374151);
    border-color: var(--brand-primary, #4a9bd9);
}

.theme-icon {
    position: absolute;
    font-size: 1.2rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show sun in dark mode, moon in light mode */
[data-theme="light"] .theme-icon.sun {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="light"] .theme-icon.moon {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 0;
    transform: rotate(-180deg);
}

/* Dashboard Header Centering */
main.container {
    padding-top: 0.5rem;
}

header hgroup {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

header hgroup h1 {
    margin-bottom: 0.5rem;
}

header hgroup p {
    margin: 0;
}

/* Footer Styling */
.site-footer {
    background: var(--neutral-100, #f5f5f5);
    border-top: 1px solid var(--neutral-200, #e5e7eb);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

[data-theme="dark"] .site-footer {
    background: var(--neutral-100, #1f2937);
    border-top-color: var(--neutral-200, #374151);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.footer-col {
    flex: 1;
    min-width: 180px;
}

.footer-col h6 {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--neutral-900, #111827);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .footer-col h6 {
    color: var(--neutral-900, #f9fafb);
}

.footer-description {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--neutral-500, #6b7280);
    line-height: var(--line-height-relaxed, 1.75);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--neutral-700, #374151);
    text-decoration: none;
    transition: color 0.2s ease;
}

[data-theme="dark"] .footer-links a {
    color: var(--neutral-500, #9ca3af);
}

.footer-links a:hover {
    color: var(--brand-primary, #1a5490);
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--brand-primary, #4a9bd9);
}

.footer-bottom {
    text-align: center;
}

.disclaimer {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--neutral-500, #6b7280);
    line-height: var(--line-height-relaxed, 1.75);
    margin-bottom: 1rem;
}

.copyright {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--neutral-500, #6b7280);
    margin: 0;
}

/* Details/Summary Styling */
details {
    margin-top: 0.75rem;
}

details summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

details p {
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Loading Spinner (optional, for future use) */
.spinner {
    border: 3px solid var(--pico-muted-border-color);
    border-top: 3px solid var(--pico-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .signal-emoji {
        font-size: 1.25rem;
    }
}

/* Accessibility: Focus States */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--pico-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer,
    button,
    #podcast-modal {
        display: none;
    }

    .security-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============================================================================
   Hierarchical Dashboard Styles
   ============================================================================ */

/* Timeline Selector */
.timeline-selector {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timeline-selector label {
    margin: 0;
    font-weight: 600;
}

.timeline-selector select {
    flex: 1;
    min-width: 250px;
    margin: 0;
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-latest {
    background: var(--signal-bullish);
    color: white;
}

.badge-historical {
    background: var(--neutral-400, #9ca3af);
    color: white;
}

/* Coverage Warning */
.coverage-warning {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

[data-theme="dark"] .coverage-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.coverage-warning strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #856404;
}

[data-theme="dark"] .coverage-warning strong {
    color: #ffc107;
}

.coverage-warning p {
    margin: 0;
    font-size: 0.9rem;
    color: #856404;
}

[data-theme="dark"] .coverage-warning p {
    color: rgba(255, 193, 7, 0.9);
}

/* Asset Class Sections */
.asset-class-section {
    margin: 2rem 0;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 8px;
    padding: 0;
    background: var(--pico-card-background-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.asset-class-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    list-style: none;
}

.asset-class-header::-webkit-details-marker {
    display: none;
}

.asset-class-header::marker {
    content: "";
}

.asset-class-header:hover {
    background: var(--pico-secondary-hover);
}

.asset-class-header .icon {
    font-size: 1.5rem;
    line-height: 1;
}

.asset-class-header .name {
    flex: 1;
}

.asset-class-header .count {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
    font-weight: normal;
}

/* Arrow indicator for details */
.asset-class-section[open] .asset-class-header::before {
    content: "▼";
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.asset-class-section:not([open]) .asset-class-header::before {
    content: "▶";
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

/* Securities List within Asset Classes - Single Column Layout */
.securities-grid {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .timeline-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .timeline-selector select {
        width: 100%;
        min-width: auto;
    }

    .securities-grid {
        padding: 1rem;
        gap: 1rem;
    }

    .asset-class-header {
        font-size: 1.1rem;
        padding: 0.875rem 1rem;
    }

    .asset-class-header .icon {
        font-size: 1.25rem;
    }
}

/* Empty State within Asset Classes */
.asset-class-section .empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--pico-muted-color);
    font-style: italic;
}

.asset-class-section[open] {
    margin: 2.5rem 0;
}

/* Keyboard navigation focus styles */
.asset-class-header:focus {
    outline: 2px solid var(--pico-primary);
    outline-offset: 2px;
}

/* ============================================================================
   Inline Audio Player Styles
   ============================================================================ */

/* Inline Player Container */
.inline-player {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

/* Audio Element Styling */
.inline-player audio {
    width: 100%;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
}

/* Podcast Transcript - Collapsible */
.podcast-transcript {
    margin-top: 0.75rem;
    border-top: 1px solid var(--pico-muted-border-color);
    padding-top: 0.75rem;
}

.podcast-transcript summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pico-primary);
    list-style: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.podcast-transcript summary:hover {
    background: var(--pico-secondary-hover);
}

/* Remove default marker */
.podcast-transcript summary::-webkit-details-marker {
    display: none;
}

.podcast-transcript summary::marker {
    content: "";
}

/* Add custom arrow */
.podcast-transcript summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.podcast-transcript[open] summary::before {
    transform: rotate(90deg);
}

/* Transcript Content */
.transcript-content {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.25rem;
    font-family: var(--pico-font-family);
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
}

/* Scrollbar styling for transcript */
.transcript-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
    background: var(--pico-muted-border-color);
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: var(--pico-primary);
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: var(--pico-primary-hover);
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .inline-player {
        padding: 0.75rem;
    }

    .transcript-content {
        max-height: 200px;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   Sentiment Summary Table
   ============================================================================ */

/* Smooth scroll behavior for anchor links */
html {
    scroll-behavior: smooth;
}

/* Scroll offset for security cards to account for header */
article[id^="security-card-"] {
    scroll-margin-top: 80px;
}

/* Summary Container - Clean, no borders */
.sentiment-summary {
    margin: 1.5rem 0 2rem 0;
    padding: 1.5rem;
    background: var(--pico-card-background-color);
    border-radius: 8px;
}

.sentiment-summary h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pico-color);
}

/* Row Layout - Each asset class is one row */
.summary-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

/* Row Label - Asset class name with colon */
.row-label {
    flex-shrink: 0;
    width: 140px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--pico-muted-color);
    padding-top: 0.25rem;
}

/* Row Items Container - Securities flow horizontally */
.row-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* Individual Security Link - Circle + Symbol */
.summary-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    color: var(--pico-color);
    border-radius: 4px;
    transition: background 0.15s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.summary-link:hover {
    background: var(--pico-secondary-hover);
}

.summary-link:focus {
    outline: 2px solid var(--pico-primary);
    outline-offset: 2px;
}

/* Sentiment Circle - Appears before symbol */
.summary-link .sentiment-circle {
    display: inline-block;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sentiment-circle.bullish {
    background-color: var(--signal-bullish);
}

.sentiment-circle.neutral {
    background-color: var(--signal-neutral);
}

.sentiment-circle.bearish {
    background-color: var(--signal-bearish);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sentiment-summary {
        padding: 1rem;
    }

    .summary-row {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .row-label {
        width: auto;
    }

    .row-items {
        gap: 0.75rem;
    }

    .summary-link {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .sentiment-summary h3 {
        font-size: 1rem;
    }

    .row-label {
        font-size: 0.85rem;
    }

    .summary-link .sentiment-circle {
        width: 16px;
        height: 16px;
    }
}

/* ============================================================================
   Historical Sentiment Inline Display
   ============================================================================ */

/* Historical sentiment container - inline after security name */
.history-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.75rem;
}

/* "Past 3 Days:" label */
.history-label {
    font-size: inherit;
    color: var(--pico-muted-color);
    font-weight: normal;
}

/* Tiny circles for historical data (matches main sentiment circles) */
.sentiment-circle-tiny {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/* Circle colors */
.sentiment-circle-tiny.gray {
    background-color: #ccc;
}

.sentiment-circle-tiny.bullish {
    background-color: var(--signal-bullish);
}

.sentiment-circle-tiny.neutral {
    background-color: var(--signal-neutral);
}

.sentiment-circle-tiny.bearish {
    background-color: var(--signal-bearish);
}

/* Mobile adjustments for historical sentiment */
@media (max-width: 768px) {
    .history-inline {
        margin-left: 0.5rem;
        gap: 0.25rem;
    }

    .history-label {
        font-size: inherit;
    }

    .sentiment-circle-tiny {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* ============================================================================
   Login Page Styles
   ============================================================================ */

.login-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.login-card {
    background: var(--pico-card-background-color, #ffffff);
    border-radius: 12px;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

[data-theme="dark"] .login-card {
    background: var(--neutral-100, #1f2937);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--neutral-900, #111827);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-2xl, 1.5rem);
    font-weight: var(--font-weight-bold, 700);
}

[data-theme="dark"] .login-header h2 {
    color: var(--neutral-900, #f9fafb);
}

.login-header p {
    color: var(--neutral-500, #6b7280);
    font-size: var(--font-size-sm, 0.875rem);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--neutral-700, #374151);
}

[data-theme="dark"] .form-group label {
    color: var(--neutral-700, #d1d5db);
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--neutral-300, #d1d5db);
    border-radius: 6px;
    font-size: var(--font-size-base, 1rem);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus-visible {
    outline: none;
    border-color: var(--brand-primary, #1a5490);
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.1);
}

[data-theme="dark"] .form-group input:focus-visible {
    border-color: var(--brand-primary, #4a9bd9);
    box-shadow: 0 0 0 3px rgba(74, 155, 217, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--signal-bearish, #dc2626);
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: var(--signal-bullish, #059669);
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    color: var(--signal-bearish, #dc2626);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: var(--font-size-sm, 0.875rem);
    border-left: 3px solid var(--signal-bearish, #dc2626);
}

.btn-primary {
    background: var(--brand-primary, #1a5490);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 6px;
    border: none;
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-semibold, 600);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: var(--brand-primary-dark, #0f3a61);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

[data-theme="dark"] .btn-primary {
    background: var(--brand-primary, #4a9bd9);
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--brand-primary-light, #60a5fa);
}
