:root {
    --primary-color: #000000;
    --accent-color: #333333;
    --background-color: #F8F9FA;
    --text-color: #2C3E50;
    --grid-color: rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Navbar styles */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.hero {
    padding: 6rem 0;
    background: white;
}

.hero-logo {
    max-width: 80%;
    height: auto;
    margin-left: 2rem;
    animation: fadeIn 0.5s ease-out;
}

@media (max-width: 768px) {
    .hero-logo {
        display: none;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero .col-lg-6 {
        text-align: center;
    }

    form {
        margin: 2rem auto;
    }

    h1 {
        font-size: 2.5rem;
    }
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000000;
}

.lead {
    font-size: 1.25rem;
    color: #333333;
    margin-bottom: 2rem;
}

.demo-section {
    padding: 4rem 0;
    background: white;
}

.demo-section h2 {
    color: #000000;
    margin-bottom: 2rem;
}

.results-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-out;
    height: 100%;
    min-height: 400px;
}

.accuracy-score {
    text-align: center;
    margin-bottom: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, #000000, #666666);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.score-value {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.evidence-content .snippet,
.evidence-content .full-article {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.evidence-card.expanded .snippet,
.evidence-card.expanded .full-article {
    max-height: 500px;
    opacity: 1;
    margin: 0.5rem 0;
}

.evidence-card.expanded .full-article {
    padding: 1rem;
    border: 1px solid #eee;
    margin-top: 1rem;
    background: white;
    border-radius: 6px;
}

.evidence-header h4 {
    margin: 0 0 0.5rem;
    color: #000;
    font-size: 1.1rem;
}

.evidence-header .source {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.evidence-card {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.evidence-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.evidence-card.expanded {
    background: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.full-article h5 {
    margin: 0 0 1rem;
    color: #000;
}

.full-article p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.full-article a {
    color: #000;
    text-decoration: underline;
    font-weight: 600;
}

.full-article a:hover {
    color: #333;
}

.features-section {
    padding: 4rem 0;
    background: white;
}

.feature-card {
    padding: 2rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: 100%;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-color: rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, 
        rgba(248, 249, 250, 1), 
        rgba(233, 236, 239, 1)
    );
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(248, 249, 250, 0), 
        rgba(233, 236, 239, 0)
    );
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-card h3 {
    color: #000000;
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

form {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem 0;
}

input[type="email"] {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

input[type="email"]:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

button[type="submit"] {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #000000, #333333);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #333333, #000000);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-title {
    color: #000000;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border: none;
}

.nav-tabs .nav-link.active::after {
    background: var(--primary-color);
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary-color);
}

/* Category-specific colors */
.nav-tabs .nav-link[data-category="Law"] {
    color: #2C3E50;
}

.nav-tabs .nav-link[data-category="Law"].active::after {
    background: #2C3E50;
}

.nav-tabs .nav-link[data-category="Finance"] {
    color: #27AE60;
}

.nav-tabs .nav-link[data-category="Finance"].active::after {
    background: #27AE60;
}

.nav-tabs .nav-link[data-category="Social Media"] {
    color: #E74C3C;
}

.nav-tabs .nav-link[data-category="Social Media"].active::after {
    background: #E74C3C;
}

.nav-tabs .nav-link[data-category="Journalism"] {
    color: #8E44AD;
}

.nav-tabs .nav-link[data-category="Journalism"].active::after {
    background: #8E44AD;
}

.statements-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin-bottom: 2rem;
}

.statement-card {
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
}

.statement-card:hover {
    transform: translateX(10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.statement-card.selected {
    transform: translateX(10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* More distinct pastel colors for different categories */
.statement-card[data-category="Law"] {
    background-color: #E3F2FD;
    border: 1px solid #BBDEFB;
}

.statement-card[data-category="Finance"] {
    background-color: #F0FFF0;
    border: 1px solid #98FB98;
}

.statement-card[data-category="Social Media"] {
    background-color: #FFE4E1;
    border: 1px solid #FFB6C1;
}

.statement-card[data-category="Journalism"] {
    background-color: #E6E6FA;
    border: 1px solid #DCD0FF;
}

.statement-card p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Evidence styling */
.evidence-container {
    padding: 1rem;
}

.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Highlighter animation styles */
.highlight-text {
    position: relative;
    line-height: 1.8;
}

/* Base styles for highlighted elements */
.neon-green, .neon-yellow, .neon-pink {
    position: relative;
    padding: 0 3px;
    font-weight: 600;
    border-radius: 3px;
    color: #000;
    display: inline-block;
}

.neon-green, .neon-yellow, .neon-pink {
    position: relative;
    border-radius: 3px;
    padding: 0 2px;
}

.neon-green {
    background-color: transparent;
    animation: highlight-green 1.5s ease-in-out forwards;
    animation-delay: 0s;
}

.neon-yellow {
    background-color: transparent;
    animation: highlight-yellow 1.5s ease-in-out forwards;
    animation-delay: 2s;
}

.neon-pink {
    background-color: transparent;
    animation: highlight-pink 1.5s ease-in-out forwards;
    animation-delay: 4s;
}

/* Keyframes for direct highlighting effect */
@keyframes highlight-green {
    0% { background-color: transparent; }
    100% { background-color: rgba(57, 255, 20, 0.4); }
}

@keyframes highlight-yellow {
    0% { background-color: transparent; }
    100% { background-color: rgba(255, 255, 51, 0.4); }
}

@keyframes highlight-pink {
    0% { background-color: transparent; }
    100% { background-color: rgba(255, 68, 204, 0.4); }
}

/* Newspaper Article Styles */
.newspaper-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
    flex-wrap: wrap;
}

.newspaper-article {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 1rem 0;
    font-family: 'Georgia', serif;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    display: block;
}

.newspaper-article:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.newspaper-article .article-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.newspaper-article .article-source {
    font-style: italic;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.5rem;
    display: block;
}

.newspaper-article h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    font-family: 'Times New Roman', Times, serif;
}

.newspaper-article p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #333;
}

.newspaper-article .highlighted-fact {
    background-color: rgba(255, 255, 20, 0.4);
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 500;
    display: inline;
}

/* Random highlight colors */
.highlight-green-fact {
    background-color: rgba(57, 255, 20, 0.4);
}

.highlight-yellow-fact {
    background-color: rgba(255, 255, 51, 0.4);
}

.highlight-pink-fact {
    background-color: rgba(255, 68, 204, 0.4);
}

/* Article card styles */
.article-card {
    background-color: #fff;
    border: 1px solid #ddd;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: auto;
    width: 100%;
    max-width: 800px;
    transition: transform 0.4s ease-in-out, margin-left 0.4s ease-in-out;
}

.article-card .card-body {
    padding: 1.5rem;
}

/* Article column and animations */
.article-col {
    transition: all 0.4s ease-in-out;
    position: relative;
    z-index: 10;
}

/* Hidden explanation cards by default */
.hidden-explanation {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    pointer-events: none;
    position: relative;
}

/* Container for the animated content section */
.combined-section {
    position: relative;
    min-height: 600px;
    overflow: visible;
}

/* Scroll animation states */
#article-section, #chat-article-section {
    position: relative;
    transition: transform 0.8s ease-in-out, opacity 0.6s ease-in-out;
}

/* Article feature section (right side) */
#feature-section {
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0;
    transform: translateX(100px);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 10;
    width: 50%;
}

/* Health chat feature section - side by side with chat - using Bootstrap grid */
#chat-feature-section {
    position: relative;
    opacity: 1; /* Always visible */
    pointer-events: auto;
    padding: 10px;
    /* No transitions */
}

/* Initial state - article and chat centered */
#content-container.pre-animate #article-section {
    opacity: 0.3;
    transform: translateY(30px);
    position: relative;
    left: 0;
    right: 0;
    margin: 0 auto;
}

#chat-content-container.pre-animate #chat-article-section,
#chat-content-container #chat-article-section {
    position: relative;
    /* No transitions */
}

/* Ensure chat container has adequate size */
#chat-article-section .chat-container {
    width: 100%;
    min-height: 400px;
}

/* Add clearfix to prevent container collapse with floated elements */
#chat-content-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure chat section has enough space for absolute positioning */
#chat-content-container {
    position: relative;
    min-height: 550px;
    padding-top: 30px;
    margin-bottom: 50px;
}

/* Ensure the article card has proper width */
#article-section .article-card {
    max-width: 100%;
}

/* Add shadow to article when scrolled but keep original size */
#content-container.scroll-active #article-section .article-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Scroll animation state - article moves left, feature appears */
#content-container.scroll-active #article-section {
    transform: translateX(-25%);
    position: absolute;
    left: 10px;
    width: auto;
    max-width: none;
    overflow: visible;
    z-index: 20; /* Make sure article is above feature card */
}

#content-container.scroll-active #feature-section {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    /* Position precisely for alignment with the left-shifted article */
    right: 5%;
    top: 0;
    left: 50%; /* Align with center of page */
    width: 45%; /* Take up just under half the page width */
    z-index: 10; /* Keep feature behind article */
}

/* Health assistant section - centered chat view with continuous right movement */
#chat-content-container {
    position: relative;
    margin-top: 20px;
    margin-bottom: 30px;
    min-height: 550px;
    overflow: visible;
}

/* Add clearfix for float-based layout */
#chat-content-container.scroll-active .row:after {
    content: "";
    display: table;
    clear: both;
}

/* Main container layout */
#chat-content-container {
    position: relative;
    overflow: hidden; /* Contains floated children */
    min-height: 500px; /* Ensure enough space for animation */
}

/* Chat container styling */
#chat-content-container .chat-container {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 40; /* Higher than both columns */
}

/* Starting state for both chat and feature */
#chat-content-container #chat-col {
    position: relative;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 30; /* Higher z-index to stay on top */
    transform: translateX(0); /* Start centered */
    margin: 0 auto; /* Center horizontally */
}

#chat-content-container #feature-col {
    position: absolute;
    opacity: 0;
    transform: translateY(50px); /* Start from below */
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 20;
    width: 45%;
    left: 0;
}

/* Pre-animate state (before scroll) */
#chat-content-container.pre-animate #chat-col {
    opacity: 0.3;
}

/* Normal state (just after first scroll trigger) */
#chat-content-container:not(.pre-animate):not(.scroll-active) #chat-col {
    opacity: 1;
    left: 0;
    transform: translateX(0);
}

/* Active scroll state - side by side layout */
#chat-content-container.scroll-active #chat-col {
    /* position: relative; */
    transform: translateX(40%); /* Move to right side - reduced shift */
    width: 50%;
    opacity: 1;
    z-index: 30; /* Keep the high z-index */
    float: none; /* Don't use float for the animation */
    /* margin-right: 200px; Reset margin */
    margin-left: auto; /* Push to right side */
}

#chat-content-container.scroll-active #feature-col {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: absolute; /* Position absolute to avoid affecting layout */
    top: 0;
    left: 0%; /* Slight indent from the left edge */
    width: 40%; /* Reduced width to avoid overlap */
    z-index: 20;
}

/* Make interactions disabled before scroll animation */
#content-container.pre-animate .article-col {
    pointer-events: none;
}

/* Explanation popup styling */
.explanation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.explanation-popup {
    position: absolute;
    max-width: 300px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 200;
}

.explanation-popup.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Position for each fact popup */
#fact1-popup {
    top: 25%;
    left: 30%;
}

#fact3-popup {
    top: 30%;
    left: 45%;
}

/* Position health explanation overlay relative to chat container */
#health-explanation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}

/* Make explanation popups visible when active */
.explanation-popup {
    position: absolute;
    max-width: 300px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 200;
    display: block !important;
}

.explanation-popup.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}

/* Force higher z-index for health popups */
#fact6-popup, #fact8-popup {
    z-index: 300;
    position: fixed !important;
    background: transparent;
    padding: 0;
    max-width: 300px;
    min-width: 250px;
}

/* Make chat popup containers fully transparent */
#fact6-popup, #fact8-popup {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Override Bootstrap d-none class for active popups */
.explanation-popup.active {
    display: block !important;
}

/* Mobile-specific positioning for chat popups */
@media (max-width: 768px) {
    #fact6-popup, #fact8-popup {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        width: auto !important;
    }
}

/* Style specifically for the AI chat popups */
#fact6-popup .explanation-card, #fact8-popup .explanation-card {
    width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
}

/* Fact explanation styles - updated for direct pointing */
.article-container {
    position: relative;
    margin-bottom: 3rem;
}

.explanation-col {
    position: relative;
}

.fact-explanation {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.left-aligned {
    justify-content: flex-start;
}

.right-aligned {
    justify-content: flex-end;
}

/* Added for direct arrow pointing */
.fact-explanation {
    position: relative;
}

.explanation-card {
    position: relative;
    z-index: 20; /* Keep card above arrow */
}

/* Arrow container styles for right-angle paths */
.arrow-container {
    position: absolute;
    z-index: 10;
    pointer-events: none; /* Allows clicking through the arrow */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease-in-out;
}

/* Show arrows on hover */
.fact-explanation:hover .arrow-container,
mark:hover ~ .arrow-container,
.explanation-card:hover .arrow-container {
    opacity: 1;
}

/* Basic direct arrow */
.direct-arrow {
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: #000;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.explanation-card:hover .direct-arrow,
mark:hover + .direct-arrow {
    opacity: 1;
}

/* Updated fact explanation styles without arrows */
.fact-explanation {
    position: relative;
    padding: 0 15px; /* Reduced padding since we don't need space for arrows */
}

/* Ensure explanation card has proper positioning */
.explanation-card {
    position: relative;
    overflow: visible;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

/* Highlighted text hover effects for corresponding cards */
mark:hover ~ .explanation-card,
mark:focus ~ .explanation-card {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* When highlighting text is hovered, show the same effect as hovering on the card itself */
#articleContainer mark#fact1:hover + .article-container .explanation-col .fact-explanation#fact1-explanation .explanation-card,
#articleContainer mark#fact2:hover + .article-container .explanation-col .fact-explanation#fact2-explanation .explanation-card,
#articleContainer mark#fact3:hover + .article-container .explanation-col .fact-explanation#fact3-explanation .explanation-card,
#articleContainer mark#fact4:hover + .article-container .explanation-col .fact-explanation#fact4-explanation .explanation-card,
#articleContainer mark#fact5:hover + .article-container .explanation-col .fact-explanation#fact5-explanation .explanation-card,
#articleContainer mark#fact6:hover + .article-container .explanation-col .fact-explanation#fact6-explanation .explanation-card,
#articleContainer mark#fact7:hover + .article-container .explanation-col .fact-explanation#fact7-explanation .explanation-card,
#articleContainer mark#fact8:hover + .article-container .explanation-col .fact-explanation#fact8-explanation .explanation-card {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    background-color: #fcfcfc !important;
}

/* Card style updates */
.explanation-card {
    flex: 1;
    max-width: 90%;
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Article-style card for fact explanations */
.article-style-card {
    border: 1px solid #e0e0e0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Georgia', serif;
}

.article-style-card h5 {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.article-style-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
    margin-bottom: 0.75rem;
}

.article-style-card .source {
    font-style: italic;
    color: #666;
    font-size: 0.75rem;
    border-top: 1px dotted #eee;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Product feature card styles */
.product-feature-card {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    border-left: 4px solid #10a37f;
}

/* Hero-style card that matches the website header */
.hero-style-card {
    max-width: 100%;
    height: 100%;
    min-height: 400px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #000000, #333333);
    border-radius: 12px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: white;
    margin-bottom: 20px;
}

.hero-style-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.hero-style-card .lead {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-style-card p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.8rem;
}

.hero-style-card .features-list {
    margin-bottom: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
}

.hero-style-card .features-list li:before {
    color: rgba(255, 255, 255, 0.9);
}

.domain-list,
.features-list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.domain-list li,
.features-list li {
    margin-bottom: 0.5rem;
    position: relative;
    list-style-type: none;
}

.domain-list li:before,
.features-list li:before {
    content: '✓';
    position: absolute;
    left: -1.2rem;
    color: #10a37f;
    font-weight: bold;
}

.feature-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none;
    box-shadow: none;
}

/* ChatGPT-like interface styles */
.chat-container {
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-header {
    background-color: #343541;
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #444654;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header img {
    width: 24px;
    height: 24px;
}

.chat-messages {
    height: auto;
    min-height: 300px;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.message-content {
    padding: 1rem;
    border-radius: 8px;
    max-width: 85%;
    position: relative;
    line-height: 1.6;
}

.message-user {
    align-self: flex-end;
    background-color: #efefef;
}

.message-user .message-content {
    background-color: #efefef;
    align-self: flex-end;
    border-radius: 18px 18px 0 18px;
}

.message-ai {
    align-self: flex-start;
}

.message-ai .message-content {
    background-color: #f9f9f9;
    border-radius: 18px 18px 18px 0;
    align-self: flex-start;
    border: 1px solid #e6e6e6;
}

.message-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-ai .message-header img {
    width: 20px;
    height: 20px;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    background-color: #f9f9f9;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.chat-input button {
    padding: 0.75rem 1.5rem;
    background-color: #10a37f;
    color: white;
    border: none;
    border-radius: 8px;
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.chat-input button:hover {
    background-color: #0d926f;
}

/* ChatGPT message special styling for fact checking */
.ai-fact-highlight {
    border-radius: 3px;
    padding: 0 3px;
    font-weight: 500;
}

.explanation-card h5 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.explanation-card p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.explanation-card .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.explanation-card .source {
    font-style: italic;
    color: #666;
    font-size: 0.75rem;
    text-align: right;
    margin-bottom: 0;
}

/* Position the fact explanations to line up with their respective highlighted text */
/* First article explanations */
#fact1-explanation {
    margin-top: 2.5rem;
}

#fact3-explanation {
    margin-top: 1.5rem;
}

/* Chat interface explanations */
#fact5-explanation {
    margin-top: 8rem;
}

#fact6-explanation {
    margin-top: 3rem;
}

#fact8-explanation {
    margin-top: 5rem;
}

/* Add a subtle highlight to the marks and arrows when hovering */
.explanation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: #fcfcfc;
}

/* Highlight the text when hovering over explanation card */
mark {
    position: relative;
    transition: all 0.2s ease;
}

mark:hover {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .newspaper-container {
        flex-direction: column;
    }
    
    .newspaper-article {
        margin-bottom: 2rem;
    }
    
    /* DISABLE SCROLL ANIMATIONS ON MOBILE BUT KEEP HIGHLIGHT ANIMATIONS */
    * {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    
    /* Re-enable highlight animations for hero section */
    .hero .neon-green, .hero .neon-yellow, .hero .neon-pink {
        animation-duration: 1.5s !important;
        animation-delay: 0s !important;
        transition-duration: 0.3s !important;
        transition-delay: 0s !important;
    }
    
    /* Specific delays for each color on mobile */
    .hero .neon-yellow {
        animation-delay: 2s !important;
    }
    
    .hero .neon-pink {
        animation-delay: 4s !important;
    }
    
    /* Re-enable highlight hover effects */
    .hero mark:hover, .hero .highlighted-fact:hover {
        transition-duration: 0.2s !important;
    }
    
    /* Remove scroll-triggered animations and positioning */
    #content-container.scroll-active #article-section,
    #content-container.scroll-active #feature-section,
    #chat-content-container.scroll-active #chat-col,
    #chat-content-container.scroll-active #feature-col {
        transform: none !important;
        position: static !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        z-index: auto !important;
        float: none !important;
        margin: 0 !important;
    }
    
    /* Stack article and feature sections vertically */
    #content-container {
        min-height: auto !important;
        overflow: visible !important;
    }
    
    #content-container #article-section {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
    }
    
    #content-container #feature-section {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
    }
    
    /* Stack chat and feature sections vertically */
    #chat-content-container {
        min-height: auto !important;
        overflow: visible !important;
        position: static !important;
    }
    
    #chat-content-container #chat-col {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
        float: none !important;
    }
    
    #chat-content-container #feature-col {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        width: 100% !important;
        left: auto !important;
        top: auto !important;
    }
    
    /* Disable pre-animate states */
    #content-container.pre-animate,
    #chat-content-container.pre-animate {
        opacity: 1 !important;
    }
    
    #content-container.pre-animate .article-col,
    #chat-content-container.pre-animate #chat-col {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Reorder columns for mobile - center article first, then explanations */
    .article-container {
        display: flex;
        flex-direction: column;
    }
    
    .explanation-col {
        order: 2;
    }
    
    .article-container .col-md-6 {
        order: 1;
        margin-bottom: 2rem;
    }
    
    /* Simplify layout for mobile - all explanations appear below the article */
    .fact-explanation {
        flex-direction: row;
        align-items: flex-start;
        margin: 1rem 0;
        padding-left: 1rem;
    }
    
    .left-aligned, .right-aligned {
        justify-content: flex-start;
    }
    
    /* Mobile styles for fact explanations */
    .fact-explanation {
        position: relative;
        padding: 0 10px;
        margin-bottom: 15px;
    }
    
    .explanation-card {
        border-radius: 8px;
        max-width: 100%;
    }
    
    /* Remove the complex positioning on mobile */
    #fact1-explanation, #fact2-explanation, #fact3-explanation, #fact4-explanation,
    #fact5-explanation, #fact6-explanation, #fact7-explanation, #fact8-explanation {
        margin-top: 0;
    }
    
    /* Create labels to identify which fact each explanation refers to on mobile */
    .fact-explanation:before {
        content: attr(id);
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        font-weight: bold;
        color: #888;
        font-size: 0.7rem;
    }
    
    /* Chat interface mobile adjustments */
    .chat-container {
        margin-bottom: 2rem;
    }
    
    .chat-messages {
        min-height: 400px;
        max-height: 500px;
        height: auto;
    }
    
    .message-content {
        max-width: 95%;
        font-size: 0.9rem;
    }
    
    .chat-input input {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .chat-input button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}
