: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;
}

/* Global Body */
body {
    font-family: 'Work Sans', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 50px;
}

.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;
}

/* Warning Box - Wiki Style (Ambox) */
.ambox {
    border: 1px solid #a2a9b1;
    border-left: 10px solid #f28500;
    /* Orange for warning */
    background: #fbfbfb;
    margin: 1rem 0;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.ambox i {
    font-size: 2rem;
    margin-right: 1rem;
    color: #f28500;
}

/* Verse and Hadith Boxes - Wiki Quote Style */
.verse-box,
.hadith-box {
    border-left: 4px solid #a2a9b1;
    background: #f8f9fa;
    padding: 1rem;
    margin: 1rem 2rem;
    /* Indented */
    font-style: italic;
    font-family: serif;
}

.verse-box::before {
    content: "Ayet:";
    display: block;
    font-weight: bold;
    font-style: normal;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.hadith-box::before {
    content: "Hadis:";
    display: block;
    font-weight: bold;
    font-style: normal;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

/* 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;
}

.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: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: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: 1400px;
    margin: 0 auto;
}

.home-grid {
    display: block;
    /* Full width layout */
    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);
}

/* Modern Trending Tabs */
.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.trending-header h3 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    padding: 0;
}

.trending-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 50px;
    gap: 0;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Premium Card Grid */
.trending-list {
    display: none;
    /* Hidden by default for tab switching */
    grid-template-columns: repeat(2, 1fr);
    /* Force 2 columns */
    gap: 2rem;
    padding-bottom: 2rem;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.trending-list.active {
    display: grid;
    /* Grid when active */
}

.trending-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 10px 20px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    overflow: hidden;
}

.trending-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trending-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.08);
    border-color: rgba(37, 99, 235, 0.1);
}

.trending-item:hover::before {
    opacity: 1;
}

.topic-rank {
    font-family: 'Merriweather', serif;
    font-size: 2rem;
    font-weight: 900;
    color: #e2e8f0;
    line-height: 1;
    min-width: 40px;
    transition: color 0.3s;
}

.trending-item:hover .topic-rank {
    color: var(--primary-color);
    opacity: 0.2;
}

.topic-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.topic-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.4;
}

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

.topic-views i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.topic-arrow {
    color: #cbd5e1;
    font-size: 1rem;
    transition: transform 0.3s, color 0.3s;
}

.trending-item:hover .topic-arrow {
    color: var(--primary-color);
    transform: translateX(3px);
}

.no-data {
    color: #94a3b8;
    font-style: italic;
    padding: 4rem;
    text-align: center;
    grid-column: 1 / -1;
    background: white;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    margin-top: 4rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header h3 i {
    color: var(--primary-color);
}

.section-header.center-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Trusted Sources Marquee */
.sources-marquee-section {
    padding: 2rem 0;
    overflow: hidden;
    position: relative;
    background: white;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-container::before,
.marquee-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

.marquee-track {
    display: inline-flex;
    animation: scroll 30s linear infinite;
    gap: 4rem;
    padding-left: 100%;
    /* Start off screen */
}

.source-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.source-logo i {
    font-size: 1.5rem;
}

.source-logo:hover {
    opacity: 1;
    color: var(--primary-color);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cat-icon {
    width: 60px;
    height: 60px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s;
}

.cat-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

.category-card:hover .cat-icon {
    background: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

/* FAQ Accordion */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.05rem;
    background: white;
}

.faq-question i {
    color: #cbd5e1;
    transition: transform 0.3s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f8fafc;
    color: var(--text-light);
    line-height: 1.6;
}

.faq-answer p {
    padding: 1.5rem;
    margin: 0;
}

.faq-item.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    /* simple expansion */
}