:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-light: #64748b;
    --card-bg: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --hover-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Work Sans', sans-serif;
    /* background-color: var(--bg-color); Removed to show pattern */
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-glob {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8fafc;
    background-image: url('bg-pattern.png');
    background-repeat: repeat;
    background-size: 300px;
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    transition: all 0.5s ease;
}

.logo {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.search-icon {
    color: var(--text-light);
    margin-left: 1rem;
    font-size: 1.2rem;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: 'Work Sans', sans-serif;
}

#searchBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#searchBtn:hover {
    background: var(--primary-dark);
}

/* Filters */
.filters {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.filter-chip:hover {
    background: white;
    border-color: var(--primary-color);
}

/* Results Area */
.hidden {
    display: none !important;
}

.consensus-card,
.summary-card,
.warning-card,
.sources-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.warning-card {
    border-left: 4px solid var(--danger);
    background-color: #fff1f2;
}

.warning-card h3 {
    color: var(--danger);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.warning-card ul {
    padding-left: 1.5rem;
    color: #9f1239;
}

.consensus-card h3,
.summary-card h3,
.sources-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
    font-family: 'Merriweather', serif;
}

/* Progress Bar */
.progress-bar-container {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-segment {
    height: 100%;
}

.progress-segment.positive {
    background-color: var(--success);
}

.progress-segment.neutral {
    background-color: var(--secondary-color);
}

.progress-segment.negative {
    background-color: var(--danger);
}

.consensus-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.dot.positive {
    background: var(--success);
}

.dot.neutral {
    background: var(--secondary-color);
}

.dot.negative {
    background: var(--danger);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.view-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid transparent;
    /* Changed to top for better look in grid */
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.view-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.view-card.positive {
    border-top-color: var(--success);
}

.view-card.neutral {
    border-top-color: var(--secondary-color);
}

.view-card.negative {
    border-top-color: var(--danger);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.source-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-detail {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.evidence-box {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.8rem;
    border-radius: 8px;
    color: #166534;
    font-size: 0.9rem;
    margin-top: auto;
    /* Push to bottom */
}

.evidence-box i {
    margin-right: 5px;
}

.badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}

/* Sources Grid */
.sources-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.source-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.source-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

.source-title {
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.source-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.source-title a:hover {
    color: var(--primary-color);
}

.source-link-icon {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-left: 5px;
}

.source-summary {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    flex-grow: 1;
}

.source-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    justify-content: flex-end;
}

/* Follow Up */
.follow-up-section {
    margin-top: 4rem;
    text-align: center;
}

.follow-up-section h3 {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.pill {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    font-weight: 500;
}

.pill:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loadingState {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-light);
}

/* Mobile */
@media (max-width: 600px) {
    .logo {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0.5rem;
        border-radius: 20px;
    }

    .search-icon {
        display: none;
    }

    #searchInput {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    #searchBtn {
        width: 100%;
    }
}

/* Home Grid Layout */
.home-layout {
    max-width: 1000px;
    margin: 0 auto;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: -2rem;
    /* Pull up closer to search */
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Trending Section */
.trending-section h3,
.info-section h3 {
    font-family: 'Merriweather', serif;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trending-section h3 i {
    color: var(--warning);
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.trending-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.topic-title {
    font-weight: 500;
    color: var(--text-main);
}

.topic-views {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Info Section (How it works) */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-icon {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}