/* Trends page specific styles for React app */

/* Paradox Catalyst Button - Clean Minimal Design */
.paradox-catalyst-button {
    background-image: url('/src/assets/images/Front Page Background 11.webp') !important;
    background-size: 250% !important;
    background-repeat: no-repeat !important;
    position: relative;
    --overlay-opacity: 0.7;
    animation: panBackground 25s linear infinite, pulseBrightness 4s ease-in-out infinite;
    will-change: background-position, filter;
}

.paradox-catalyst-button.unlocked {
    background-image: url('/src/assets/images/Front Page Background 11 white.webp') !important;
}

.paradox-catalyst-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 17, var(--overlay-opacity));
    border-radius: 4px;
    z-index: 0;
    pointer-events: none;
    transition: background 0.15s ease;
    animation: pulseOverlay 4s ease-in-out infinite;
    will-change: opacity;
}

.paradox-catalyst-button.unlocked::before {
    background: rgba(15, 15, 17, 0.5);
    animation: pulseOverlayUnlocked 4s ease-in-out infinite;
}

.paradox-catalyst-button > * {
    position: relative;
    z-index: 1;
}

@keyframes panBackground {
    0% {
        background-position: 50% 50%;
    }
    12.5% {
        background-position: 58% 42%;
    }
    25% {
        background-position: 65% 35%;
    }
    37.5% {
        background-position: 70% 30%;
    }
    50% {
        background-position: 65% 35%;
    }
    62.5% {
        background-position: 58% 42%;
    }
    75% {
        background-position: 50% 50%;
    }
    87.5% {
        background-position: 42% 58%;
    }
    100% {
        background-position: 50% 50%;
    }
}

@keyframes pulseBrightness {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

@keyframes pulseOverlay {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulseOverlayUnlocked {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.3;
    }
}

/* Trends page specific styles for React app */
.trends-app-container {
    width: 100%;
    height: 100%;
}

/* Enable scroll snap for trends page */
body.trends-page-active,
html body.trends-page-active {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: #000;
}

/* Ensure each section snaps */
.trends-hero-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.trends-content-wrapper {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* ===== HERO SECTION STYLES ===== */
.trends-hero-section {
    position: relative;
    width: 100%;
    min-height: auto; /* Only as tall as content needs */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem 0.5rem 2rem; /* No top padding - matches other pages */
    z-index: 10;
    overflow: hidden;
}

.trends-hero-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    margin-bottom: 0; /* No bottom margin - grid starts directly below */
    z-index: 2;
    animation: fadeInUp 0.8s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

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

/* Larger page-title for hero section - best practices sizing */
.trends-hero-section .page-title,
body[data-is-logged-in="true"] .trends-hero-section .page-title,
body[data-is-logged-in="false"] .trends-hero-section .page-title,
.trends-main-content .trends-hero-section .page-title,
.trends-page-layout .trends-hero-section .page-title {
    font-size: clamp(3.5rem, 6vw, 5rem) !important;
    margin-bottom: 0.1rem !important;
    line-height: 1.1 !important;
}

/* Ensure em tag inside page-title matches base styles - SEO header styling */
.trends-hero-section .page-title em,
body[data-is-logged-in="true"] .trends-hero-section .page-title em,
body[data-is-logged-in="false"] .trends-hero-section .page-title em,
.trends-main-content .trends-hero-section .page-title em,
.trends-page-layout .trends-hero-section .page-title em {
    font-style: italic !important;
    font-weight: 300 !important;
    font-family: "Times New Roman", Times, serif !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(200, 200, 200, 0.8) 50%, rgba(180, 180, 180, 0.7) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    display: inline !important;
    letter-spacing: -0.03em !important;
    line-height: 1.1 !important;
}

/* Use .page-subtitle styling from base.css - override max-width for hero */
.trends-hero-section .page-subtitle {
    max-width: 750px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Sticky Search Bar Container */
.trends-sticky-search-wrapper {
    position: sticky;
    top: 60px; /* Below main nav header */
    z-index: 100;
    width: 100%;
    max-width: 900px;
    padding: 0 1rem;
    margin: 0 auto;
    margin-bottom: 0 !important; /* No margin below search bar */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trends-sticky-search-wrapper.scrolled {
    background: rgba(15, 15, 17, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 8px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Search Bar in Content Area - Above Company Card */
.trends-content-search-wrapper {
    position: sticky;
    top: 60px; /* Below main nav header */
    z-index: 1002;
    width: 100%;
    max-width: 900px;
    padding: 0 1rem 1rem 1rem;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Subtitle below search bar - Hidden since grid starts directly below */
.trends-hero-search-subtitle {
    display: none !important; /* Hide subtitle - grid starts directly below search bar */
}

/* Scroll Indicator */
.trends-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
}

.trends-scroll-indicator:hover {
    transform: translateX(-50%) translateY(-2px);
}

.trends-scroll-indicator:hover .scroll-indicator-text,
.trends-scroll-indicator:hover .scroll-indicator-arrow {
    color: rgba(255, 255, 255, 0.8);
}

.trends-scroll-indicator.fade-out {
    opacity: 0;
}

.scroll-indicator-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
    transition: color 0.2s ease;
}

.scroll-indicator-arrow {
    color: rgba(255, 255, 255, 0.6);
    animation: bounceDown 2s ease-in-out infinite;
    transition: color 0.2s ease;
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(8px);
        opacity: 1;
    }
}

/* Scroll to Top Indicator (Upward Arrow) */
.trends-scroll-to-top-indicator {
    position: absolute;
    top: 0.1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
}

.trends-scroll-to-top-indicator:hover {
    transform: translateX(-50%) translateY(-2px);
}

.trends-scroll-to-top-indicator:hover .scroll-indicator-arrow {
    color: rgba(255, 255, 255, 0.5);
}

.scroll-indicator-arrow-up {
    color: rgba(255, 255, 255, 0.3);
    animation: none !important;
    transition: color 0.2s ease;
}

/* Gradient overlay at bottom of hero showing trends preview */
.trends-hero-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: transparent;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Trends preview behind hero */
.trends-preview-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    overflow: hidden;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    filter: blur(2px);
}

/* Main trends content wrapper */
.trends-content-wrapper {
    position: relative;
    z-index: 5;
    background: #000;
    padding-top: 0 !important; /* No padding at top - starts directly below search bar */
    min-height: 100vh;
}

/* Search bar in trends section */
.trends-content-wrapper .trends-search-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Loading overlay scoped to trends section only - override base.css fixed positioning */
.trends-loading-overlay {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    z-index: 1000 !important;
    pointer-events: none !important;
}

/* Remove gradient transition since we're using snap scroll */

/* Mobile responsiveness */
@media (max-width: 768px) {
    .trends-hero-section {
        min-height: auto; /* Remove fixed height on mobile - only as tall as content needs */
        height: auto;
        padding: 0 1rem 0.5rem 1rem; /* No top padding - matches other pages */
    }

    .trends-hero-content {
        margin-bottom: 1rem; /* Reduced spacing on mobile */
        gap: 0.5rem;
    }

    .trends-hero-section .page-title,
    body[data-is-logged-in="true"] .trends-hero-section .page-title,
    body[data-is-logged-in="false"] .trends-hero-section .page-title {
        font-size: clamp(2.75rem, 6vw, 4rem) !important;
        margin-bottom: 0.4rem !important;
    }

    .trends-hero-section .page-title em,
    body[data-is-logged-in="true"] .trends-hero-section .page-title em,
    body[data-is-logged-in="false"] .trends-hero-section .page-title em {
        font-style: italic !important;
        font-weight: 300 !important;
        font-family: "Times New Roman", Times, serif !important;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(200, 200, 200, 0.8) 50%, rgba(180, 180, 180, 0.7) 100%) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
        color: transparent !important;
        display: inline !important;
        letter-spacing: -0.03em !important;
        line-height: 1.1 !important;
    }

    .trends-hero-section .page-subtitle {
        max-width: 90% !important;
    }

    .trends-sticky-search-wrapper {
        top: 50px;
        padding: 0 0.5rem;
    }

    .trends-sticky-search-wrapper.scrolled {
        padding: 0.5rem;
    }

    .trends-content-search-wrapper {
        top: 50px;
        padding: 0 0.5rem 0.75rem 0.5rem;
    }

    .trends-hero-search-subtitle {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        max-width: 90%;
    }

    .trends-scroll-indicator {
        bottom: 1.5rem;
    }

    .trends-scroll-to-top-indicator {
        top: 0.1rem;
    }

    .scroll-indicator-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .trends-hero-section {
        min-height: auto; /* Remove fixed height on mobile - only as tall as content needs */
        height: auto;
        padding: 0 1rem 0.5rem 1rem; /* No top padding - matches other pages */
    }

    .trends-hero-content {
        margin-bottom: 0.75rem; /* Reduced spacing on small mobile */
        gap: 0.4rem;
    }

    .trends-hero-section .page-title,
    body[data-is-logged-in="true"] .trends-hero-section .page-title,
    body[data-is-logged-in="false"] .trends-hero-section .page-title {
        font-size: clamp(2.25rem, 5vw, 3rem) !important;
        margin-bottom: 0.3rem !important;
    }

    .trends-hero-section .page-subtitle {
        max-width: 90% !important;
    }

    .trends-sticky-search-wrapper {
        top: 50px;
    }

    .trends-content-search-wrapper {
        top: 50px;
        padding: 0 0.5rem 0.5rem 0.5rem;
    }

    .trends-hero-search-subtitle {
        font-size: 0.75rem;
        margin-top: 0.5rem;
        max-width: 90%;
    }

    .trends-scroll-indicator {
        bottom: 1rem;
    }

    .trends-scroll-to-top-indicator {
        top: 0.1rem;
    }

    .scroll-indicator-text {
        font-size: 0.65rem;
    }

    .scroll-indicator-arrow {
        width: 20px;
        height: 20px;
    }
}


/* Custom checkbox styling */
.custom-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    background: rgba(15, 15, 17, 0.8);
    cursor: pointer;
    position: relative;
    margin: 0;
    transition: all 0.2s ease;
}

.custom-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(25, 25, 27, 0.9);
}

.custom-checkbox:checked {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: solid rgba(255, 255, 255, 0.9);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Date input placeholder styling */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit {
    color: rgba(255, 255, 255, 0.25);
}

input[type="date"]:focus::-webkit-datetime-edit,
input[type="date"]:valid::-webkit-datetime-edit {
    color: rgba(255, 255, 255, 0.9);
}

/* Integrated Layout Styles */
.trends-page-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.trends-main-content {
    flex: 1;
    min-width: 0; /* Allow content to shrink */
    margin-right: 0; /* Sidebars will position themselves */
    padding-top: 0; /* Remove top padding since hero handles it */
}



/* Visual feedback styles for text highlighting - Text color only */
.keyword-text-added,
.keyword.keyword-text-added {
    color: rgba(34, 197, 94, 0.95) !important;
    transition: color 0.8s ease-out !important;
    animation: textColorOnly 1.0s ease-out forwards !important;
}

.company-text-added,
.company-ticker.company-text-added {
    color: rgba(34, 197, 94, 0.95) !important;
    transition: color 0.8s ease-out !important;
    animation: textColorOnly 1.0s ease-out forwards !important;
}

/* Remove global overrides - let base.css handle body styles */

/* Text color only animation */
@keyframes textColorOnly {
    0% { 
        color: rgba(34, 197, 94, 1);
    }
    70% { 
        color: rgba(34, 197, 94, 0.98);
    }
    100% { 
        color: rgba(34, 197, 94, 0.9);
    }
}

@keyframes awarenessEntityPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02);
    }
}



/* Core layout */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    grid-auto-rows: min-content; /* Allow rows to expand based on content */
    gap: 1rem;
    margin: 0 auto;
    box-sizing: border-box;  /* Fixed: include padding in size calculation */
    width: 100%;
    max-width: 100%;
}

/* Responsive grid for smaller screens */
@media (max-width: 480px) {
    .trends-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 0.75rem;
        padding: 0;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    .trends-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Ensure preview container grid fits properly */
#trends-grid-preview-container .trends-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

@media (max-width: 480px) {
    #trends-grid-preview-container .trends-grid {
        gap: 0.5rem;
    }
}

/* Refined card design */
.trend-tile {
    background: rgba(23, 23, 23, 0.6);
    border: 1px solid rgba(55, 55, 60, 0.4);
    border-radius: 12px;
    padding: 0.5rem;
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden; /* Keep for gradient effects */
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    isolation: isolate;
    height: auto; /* Allow tile to expand vertically when content grows */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Subtle radial gradient overlay - always present for depth */
.trend-tile::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: transparent;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* Hover effect - subtle directional lighting */
.trend-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.trend-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(75, 75, 85, 0.6);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.trend-tile:hover::before {
    opacity: 0.8;
}

.trend-tile:hover::after {
    opacity: 1;
}

/* Ensure content is above overlays */
.trend-tile > * {
    position: relative;
    z-index: 2;
}

/* Sophisticated layout for header */
.trend-tile .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

/* Refined keyword styling */
.trend-tile .keyword {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.3rem;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    position: relative;
    line-height: 1.2;
}

.trend-tile .keyword:hover {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.trend-tile .keyword::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: width 0.2s ease;
}

.trend-tile .keyword:hover::after {
    width: 100%;
}

/* Toggle related styles */
.toggle-related {
    font-size: 0.7rem;
    color: rgba(100, 150, 255, 0.8);
    transition: color 0.2s ease;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-related:hover {
    color: rgba(100, 150, 255, 1);
    text-decoration: underline;
}

/* Related keywords container */
.related-keywords-container {
    margin-top: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(55, 55, 60, 0.3);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Related keywords chips */
.related-keywords-container .company-ticker {
    font-size: 0.7rem;
    background: rgba(40, 40, 50, 0.5);
    transition: all 0.2s ease;
}

.related-keywords-container .company-ticker:hover {
    background: rgba(60, 80, 120, 0.5);
    transform: translateY(-2px);
}

/* Metrics styling */
.trend-tile .metrics {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.trend-tile .metrics-row {
    display: flex;
    gap: 1.25rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: flex-start;
    min-width: 0;
}

/* Volume with monospace for financial data */
.trend-tile .volume {
    font-size: 1rem;
    font-weight: 500;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.01em;
    line-height: 1;
}

/* Growth */
.trend-tile .growth {
    font-size: 1rem;
    font-weight: 500;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    color: rgba(255, 255, 255, 0.95); /* White for all values */
    letter-spacing: -0.01em;
    line-height: 1;
}

.trend-tile .growth.negative {
    color: rgba(255, 255, 255, 0.7); /* Slightly dimmed white for negative values */
}

/* Datatype Count */
.trend-tile .datatype-count {
    font-size: 1rem;
    font-weight: 500;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.01em;
    line-height: 1;
}

/* Premium-looking labels */
.trend-tile .metric-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}



/* Chart metrics section - positioned below chart */
.trend-tile .chart-metrics {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(23, 23, 23, 0.6);
    border: 1px solid rgba(55, 55, 60, 0.4);
    border-radius: 6px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: visible; /* Allow infinity symbol to overflow */
}

.trend-tile .chart-metrics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: visible; /* Allow infinity symbol to overflow */
}

.trend-tile .chart-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0; /* Allow shrinking */
    overflow: visible; /* Allow infinity symbol to overflow */
}

.trend-tile .chart-metric-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.trend-tile .chart-metric-value.growth.negative {
    color: rgba(248, 113, 113, 0.9);
}

.trend-tile .chart-metric-value.growth.infinite {
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 300;
    letter-spacing: 0.02em;
    transform: scale(1.8);
    line-height: 1;
    overflow: visible;
}

.trend-tile .chart-metric-label {
    font-size: 0.55rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
}

/* Mobile responsive adjustments for chart metrics */
@media (max-width: 768px) {
    .trend-tile .chart-metrics {
        padding: 0.3rem 0.5rem;
        margin-top: 0.4rem;
    }
    
    .trend-tile .chart-metrics-row {
        gap: 0.3rem;
    }
    
    .trend-tile .chart-metric-value {
        font-size: 0.75rem;
    }
    
    .trend-tile .chart-metric-label {
        font-size: 0.5rem;
    }
}

/* More elegant ticker display */
.trend-tile .companies-container {
    display: flex;
    flex-wrap: nowrap; /* Keep on one line */
    gap: 0.35rem;
    margin-top: 0.25rem;
    margin-bottom: 0.15rem;
    position: relative;
    z-index: 5; /* Ensure it's above the chart */
    overflow-x: auto; /* Enable horizontal scrolling */
    white-space: nowrap; /* Prevent wrapping */
}

.trend-tile .company-ticker {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.01em;
    padding: 0.2rem 0.5rem;
    background: rgba(23, 23, 23, 0.4);
    border: 1px solid rgba(70, 70, 80, 0.3);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px); /* Add blur effect for better readability */
    cursor: pointer; /* Add pointer cursor to indicate clickable */
}

.trend-tile .company-ticker svg {
    margin-right: 0.4rem;
    opacity: 0.7;
}

.trend-tile .company-ticker:hover {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(70, 70, 80, 0.7);
    background: rgba(40, 40, 45, 0.7);
}

/* Active state for selected ticker */
.trend-tile .company-ticker.active {
    background: rgba(40, 40, 65, 0.7);
    border-color: rgba(100, 120, 200, 0.6);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(100, 120, 200, 0.2);
}

/* Error state for tickers */
.trend-tile .company-ticker.error {
    background: rgba(65, 40, 40, 0.7);
    border-color: rgba(200, 80, 80, 0.6);
    color: rgba(255, 220, 220, 0.95);
    box-shadow: 0 0 0 1px rgba(200, 80, 80, 0.2);
    position: relative;
}

.trend-tile .company-ticker.error::after {
    content: '!';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background-color: rgb(248, 113, 113);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chart container refinements */
.trend-tile .chart-container {
    height: 200px;
    margin-top: -0.15rem;
    position: relative;
    z-index: 1;
    margin-bottom: -0.25rem;
    overflow: hidden;
    border-radius: 0 0 10px 10px;
}

/* styles for similarity score */
.similarity-score {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.2rem;
}

/* Featured chart styles for clicked keyword */
.featured-chart-container {
    background: rgba(23, 23, 23, 0.7);
    border: 1px solid rgba(55, 55, 60, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease;
    position: relative;
}

.featured-chart-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Info boxes row styles */
.info-boxes-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive */
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.75rem;
}

.info-box {
    background: rgba(23, 23, 23, 0.7);
    border: 1px solid rgba(55, 55, 60, 0.5);
    border-radius: 12px;
    padding: 1rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    height: 100%;
    min-height: 200px;
    max-height: 250px;
    overflow-y: auto;
}

.info-box-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box-content {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.related-keyword-item {
    display: inline-flex;
    align-items: center;
    margin: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: rgba(23, 23, 23, 0.4);
    border: 1px solid rgba(70, 70, 80, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-keyword-item:hover {
    background: rgba(23, 23, 23, 0.7);
    border-color: rgba(70, 70, 80, 0.7);
}

.related-keywords-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

.related-company-item {
    display: inline-flex;
    align-items: center;
    margin: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: rgba(23, 23, 23, 0.4);
    border: 1px solid rgba(70, 70, 80, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-company-item:hover {
    background: rgba(23, 23, 23, 0.7);
    border-color: rgba(70, 70, 80, 0.7);
}

.related-companies-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

/* AI Analysis styles */
.ai-analysis-container {
    padding: 0;
    width: 100%;
    max-height: none;
    background: transparent;
    border: none;
    box-shadow: none;
    position: static;
    overflow: visible;
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.ai-analysis-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(100, 150, 255, 0.9);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-analysis-title svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.ai-analysis-content {
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

.featured-chart-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.featured-chart-metric {
    display: flex;
    flex-direction: column;
}

.featured-chart-metric-value {
    font-size: 1.2rem;
    font-weight: 500;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    color: rgba(255, 255, 255, 0.95);
}

.featured-chart-metric-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.featured-chart {
    height: 300px;
    margin-top: 0.5rem;
}

.featured-companies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Apply button styles */
.apply-button {
    padding: 0.4rem 1.25rem;
    background-color: rgba(55, 55, 60, 0.8);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid rgba(70, 70, 80, 0.5);
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
}

.apply-button:hover {
    background-color: rgba(65, 65, 70, 0.9);
    border-color: rgba(80, 80, 90, 0.7);
}

.select-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-right: 0.75rem;
}

.filters-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: -webkit-fill-available;
}

/* Back button styles */
.back-button {
    background: rgba(23, 23, 23, 0.7);
    border: 1px solid rgba(70, 70, 80, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.back-button svg {
    width: 14px;
    height: 14px;
}

.back-button:hover {
    background: rgba(23, 23, 23, 0.8);
    border-color: rgba(80, 80, 90, 0.7);
}

/* Header for semantic search results */
.similar-keywords-header {
    margin: 0 1.5rem;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.similar-keywords-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.similar-keywords-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3rem;
}

/* Pagination styles moved to shared/styles/pagination.css */

/* Legacy styles removed - now using global .page-header from base.css */

/* Search dropdown z-index fix - ensure it appears above all charts and elements but below base header */
.trends-search-dropdown {
    z-index: 1001 !important;
    position: relative !important;
}

/* Ensure search dropdown container has proper stacking context */
.trends-search-container {
    position: relative;
    z-index: 1002 !important;
}

/* Override any chart canvas z-index that might interfere */
.trend-tile canvas {
    z-index: 1 !important;
    position: relative;
}

/* Ensure chart containers don't create stacking contexts that interfere */
.trend-tile {
    z-index: auto !important;
}

/* ===== Search summary redesign ===== */
.search-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    justify-items: center;
    animation: fadeInUp 0.5s ease-out;
}

@media (min-width: 768px) {
    .search-summary {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        justify-items: stretch;
    }
    
    /* For keyword searches, center the single card */
    .search-summary:has(.keyword-summary) {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

.summary-card {
    background: rgba(18, 18, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: relative;
}

.summary-clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    color: rgba(200, 200, 210, 0.7);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.summary-clear-btn:hover {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

/* Company card */
.company-card {
    display: flex;
    align-items: center;
}

.company-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.company-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 1);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.company-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-logo-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #111;
}

.company-info {
    min-width: 0;
}

.company-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.company-symbol {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.95rem;
}

.company-name {
    color: rgba(200, 200, 210, 0.7);
    font-size: 0.9rem;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(200, 200, 210, 0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.meta-sep {
    color: rgba(140, 140, 150, 0.6);
}

.company-error {
    margin-top: 8px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: rgba(255, 200, 200, 0.95);
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 8px;
}

/* Score card */
.score-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    position: relative;
}

.score-header-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.score-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(200, 200, 210, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    cursor: help;
}

.score-header img,
.score-header span {
    cursor: help;
}

.score-explanation {
    font-size: 0.65rem;
    opacity: 0.65;
    margin-left: 6px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.score-help-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(200, 200, 210, 0.5);
    transition: color 0.2s ease;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.score-help-icon:hover {
    color: rgba(200, 200, 210, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.score-help-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.score-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

.score-tooltip-content {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.score-tooltip-content strong {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.score-tooltip-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    line-height: 1.5;
    font-weight: 400;
}

.score-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(255, 255, 255, 0.2);
}

.score-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    margin-bottom: -1px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(0, 0, 0, 0.95);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 30px; /* prevent layout shift before score loads */
}

.score-value {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 1.4rem;
}

.score-max {
    color: rgba(200, 200, 210, 0.6);
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 2px;
}

.score-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.score-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.9));
    border-right: 1px solid rgba(34, 197, 94, 0.9);
    transition: width 220ms ease;
}

/* Keyword summary (non-company) */
.keyword-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

/* For keyword searches, position clear button inline */
.keyword-summary .summary-clear-btn {
    position: static;
    margin-left: 12px;
    top: auto;
    right: auto;
    display: inline-block;
}

.keyword-term {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.keyword-label, .keyword-count {
    color: rgba(200, 200, 210, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
}

/* Add styles for date range controls */
.date-range-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 2rem;
}

/* Add the related-keyword-name style back with updated properties */
.related-keyword-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Filter group styles */
.filter-group {
    display: flex;
    flex-wrap: nowrap;
    min-width: -webkit-fill-available;
    max-width: 300px; /* Add max-width to limit the width */
}


/* Earnings date inputs styling */
.earnings-date-input {
    width: 100%;
    background: rgba(23, 23, 23, 0.7);
    border: 1px solid rgba(70, 70, 80, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 6px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.earnings-date-input:hover {
    background-color: rgba(23, 23, 23, 0.8);
    border-color: rgba(70, 70, 80, 0.7);
}

.earnings-date-input:focus {
    outline: none;
    border-color: rgba(100, 120, 200, 0.6);
    box-shadow: 0 0 0 1px rgba(100, 120, 200, 0.2);
}

.earnings-date-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Add toggle switch styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin-right: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(70, 70, 80, 0.3); /* More transparent */
    transition: .2s;
    border-radius: 20px;
    border: 1px solid rgba(70, 70, 80, 0.5); /* More transparent border */
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px); /* Add slight blur for better integration */
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(255, 255, 255, 0.8); /* Slightly more transparent */
    transition: .2s;
    border-radius: 50%;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(255, 255, 255, 0.9); /* Bright white like iPhone */
    border-color: rgba(255, 255, 255, 0.8); /* White border */
}

/* Filter Card Styles - Performance Optimization */
.filter-card {
    background: rgba(23,23,23,0.5);
    border: 1px solid rgba(55,55,60,0.4);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.filter-card-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.filter-input {
    background: rgba(15, 15, 17, 0.8);
    border: 1px solid rgba(55, 55, 60, 0.4);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    padding: 4px 8px;
    height: 30px;
}

.filter-input:disabled {
    background: rgba(15, 15, 17, 0.4);
    color: rgba(255, 255, 255, 0.4);
}


.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.earnings-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.earnings-inputs {
    display: flex;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.earnings-inputs.disabled {
    opacity: 0.5;
    pointer-events: none;
}



.filter-sublabel {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px; /* Reduced from 4px to 2px */
    display: block;
}

/* View toggle buttons */
.view-toggle .view-btn {
    background: rgba(23, 23, 23, 0.8);
    color: rgba(255, 255, 255, 0.9); /* White color */
    border: none; /* No border */
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.view-toggle .view-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* White hover tint */
}

.view-toggle .view-btn.active {
    background: rgba(255, 255, 255, 0.2); /* White active tint */
}

/* Trends table view */
.trends-table-wrapper {
    overflow: auto;
    border-radius: 12px;
    background: #000; /* Black background as requested */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-block; /* Make wrapper fit content */
    max-width: 100%; /* Prevent overflow */
}

.trends-table {
    width: auto; /* Auto width instead of 100% */
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

.trends-table th {
    background: rgba(0, 0, 0, 0.92);
    padding: 0.6rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    z-index: 15;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.06), 0 8px 16px rgba(0, 0, 0, 0.35);
}

.trends-table td {
    padding: 0.55rem 0.6rem;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center; /* center values */
    position: relative; /* for accent bars */
}

.trends-table td.cell-keyword {
    text-align: left; /* keep keyword left-aligned */
    position: sticky;
    left: 0;
    z-index: 12;
    background: #000;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.trends-table td.cell-up {
    background: rgba(34, 197, 94, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.trends-table td.cell-down {
    background: rgba(248, 113, 113, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.trends-table td.cell-na {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Zebra striping (very subtle), only for neutral cells */
.trends-table tbody tr:nth-child(odd) td:not(.cell-up):not(.cell-down):not(.cell-na) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Subtle vertical accent bar per state */
.trends-table td.cell-up::before,
.trends-table td.cell-down::before,
.trends-table td.cell-na::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
}

.trends-table td.cell-up::before { background: rgba(34, 197, 94, 0.7); }
.trends-table td.cell-down::before { background: rgba(248, 113, 113, 0.7); }
.trends-table td.cell-na::before { background: rgba(200, 200, 210, 0.35); }

/* Row hover treatment */
.trends-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.045);
}

/* Numeric typography consistency */
.trends-table td:not(.cell-keyword) {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    text-align: right; /* Right-align numeric for pro look */
    padding-right: 0.8rem;
}

/* Subtle vertical dividers between columns */
.trends-table td + td {
    border-left: 1px solid rgba(255, 255, 255, 0.03);
}

/* Round top corners for first/last header cells */
.trends-table thead th:first-child {
    border-top-left-radius: 10px;
}

.trends-table thead th:last-child {
    border-top-right-radius: 10px;
}

/* Status indicators for search results */
.status-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-indicator.exact {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.status-indicator.similar {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

/* Progressive Disclosure - Smooth Collapsible Sections */
.collapsible-section {
    overflow: hidden; /* Keep hidden for smooth collapse animation */
    padding-bottom: 0.2rem; /* Extra space to prevent pill cutoff */
}

.collapsible-section.collapsed {
    max-height: 1.5rem;
    /* Instant collapse - no transition */
    transition: max-height 0s ease;
}

.collapsible-section.expanded {
    max-height: 2000px; /* Large enough for most content */
    /* Smooth expand */
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-bottom: 0.25rem; /* Prevent pills from being cut off at bottom */
}

.collapsible-section.collapsed .collapsible-content {
    /* No animation on collapse */
    animation: none;
}

.collapsible-section.expanded .collapsible-content {
    /* Smooth fade-in on expand only */
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for items when expanding */
.collapsible-content > * {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover-to-expand hint */
.collapsible-header {
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    cursor: pointer;
}

.collapsible-header:hover .expand-hint {
    opacity: 1;
}

.expand-hint {
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: 0.25rem;
}

/* Spinner animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Force hero title sizing - highest specificity override at end of file */
body.trends-page-active .trends-hero-section .page-title,
body.trends-page-active body[data-is-logged-in="true"] .trends-hero-section .page-title,
body.trends-page-active body[data-is-logged-in="false"] .trends-hero-section .page-title,
.trends-page-layout .trends-main-content .trends-hero-section .page-title {
    font-size: clamp(3.5rem, 6vw, 5rem) !important;
}

@media (max-width: 768px) {
    body.trends-page-active .trends-hero-section .page-title,
    body.trends-page-active body[data-is-logged-in="true"] .trends-hero-section .page-title,
    body.trends-page-active body[data-is-logged-in="false"] .trends-hero-section .page-title {
        font-size: clamp(2.75rem, 6vw, 4rem) !important;
    }
}

@media (max-width: 480px) {
    body.trends-page-active .trends-hero-section .page-title,
    body.trends-page-active body[data-is-logged-in="true"] .trends-hero-section .page-title,
    body.trends-page-active body[data-is-logged-in="false"] .trends-hero-section .page-title {
        font-size: clamp(2.25rem, 5vw, 3rem) !important;
    }
}

/* Programmatic Access Section */
.programmatic-access {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 1rem;
    margin-top: 0;
}

.programmatic-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    min-width: 200px;
    min-height: 8rem;
    padding: 1rem 0;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.programmatic-block:hover .programmatic-icon {
    filter: brightness(0) invert(1);
}

.programmatic-icon {
    width: 6rem;
    height: 6rem;
    filter: brightness(0) invert(0.5);
    transition: filter 0.3s ease;
}

.programmatic-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.programmatic-block:hover .programmatic-label {
    color: rgba(255, 255, 255, 1);
}

.programmatic-description {
    color: rgba(255, 255, 255, 0);
    font-size: 0.875rem;
    font-weight: 400;
    text-align: center;
    max-width: 300px;
    line-height: 1.4;
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    margin-top: -0.5rem;
}

.programmatic-block:hover .programmatic-description {
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.programmatic-divider {
    width: 1px;
    height: 12rem;
    background-color: rgba(102, 102, 102, 0.3);
}

/* Footer styles removed - using shared footer.css */



