body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #000;
    color: #fff;
}

a {
    color: #1a73e8;
}

.gradient-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    height: 100vh;
}

.sidebar {
    width: 200px;
    padding: 20px 10px;
    border-right: 1px solid #333;
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 0 8px 8px 0;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    background: #000; /* Black background */
    padding: 5px 0px; /* Padding to give some space around the text */
    padding-left:5px;
    border-radius: 5px; /* Optional: rounded corners for a cleaner look */
    display: inline-block; /* Ensures the background fits the text */
}

.truth-highlight {
    background-color: #00FF00; /* Lime */
    color: #000; /* Black */
    padding: 2px 4px; /* Slight padding for background */
    border-radius: 3px; /* Rounded corners */
}

nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    margin: 10px 0;
    padding: 8px;
    border-radius: 5px;
}

nav a:hover {
    background: #2a2a2a;
}

.trending {
    margin-top: 20px;
}

.trending h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.trending p {
    font-size: 13px;
    color: #fff;
    margin: 5px 0;
}

main {
    flex: 1;
    margin-left: 220px;
    padding: 0 20px;
    overflow-y: auto; /* Keep scrolling at the <main> level */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* Still constrains to viewport height */
}

header {
    position: sticky;
    top: 0;
    background: rgba(20, 20, 20, 0.9);
    padding: 10px 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar {
    flex: 1;
    padding: 10px;
    background: #222;
    border: 2px solid #1a73e8;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
}

.next-btn {
    background: #1a73e8;
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.next-btn:hover {
    background: #1557b0;
}

.next-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.highlight {
    background-color: #00FF00; /* Lime */
    color: black;
    padding: 2px;
    border-radius: 3px;
}

.highlight.current-match {
    background-color: red;
    font-size: 2em;
    transition: background-color 0.5s;
    color: black;
}

.search-bar:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 5px rgba(26, 115, 232, 0.5);
}

.feed {
    margin-top: 10px;
    /* Remove flex: 1 and overflow-y: auto */
    /* Let it take its natural content height and scroll with <main> */
}

.post {
    display: flex;
    align-items: flex-start;
    border: 2px solid #333;
    padding:10px;
    padding-bottom: 50px;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 6px;
    margin-bottom: 40px;
    position: relative;
    scroll-margin-top: 70px;
}

.x-post-left {
    width: 300px;
    margin-right: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-meta-left {
    background: rgba(255, 255, 255, 0.1); /* Subtle background matching other sections */
    padding: 10px; /* Padding for spacing inside the background */
    border-radius: 5px; /* Rounded corners */
    margin-top: 10px; /* Space from the Twitter embed above */
    text-align: center; /* Center the text horizontally */
}

.x-post-left .twitter-tweet {
    min-width: 0;
    max-width: 100%;
    border-radius: 5px;
    padding: 0px;
}

.twitter-tweet-rendered {
    border-radius: 5px !important;
}

.twitter-tweet-rendered iframe {
    border: none !important;
}

.twitter-tweet a {
    color: #1a73e8 !important;
}

.twitter-tweet-rendered * {
    color: #fff !important;
}

.twitter-tweet-rendered .Tweet-header,
.twitter-tweet-rendered .Tweet-body,
.twitter-tweet-rendered .Tweet-footer {
    background: #000000 !important;
}

.post-content {
    flex: 1;
}

.post-meta {
    margin-bottom: 10px;
}

.criteria {
    font-size: 12px;
    color: #888;
    margin: 5px 0;
}

.rect-bar-container {
    display: inline-block;
    position: relative;
    width: 100px;
    height: 6px;
    vertical-align: middle;
}

.rect-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #888;
    border-radius: 3px;
}

.rect-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #1a73e8;
    border-radius: 3px;
}

.x-post-right {
    margin-bottom: 10px;
}

.rating-section {
    background: rgba(255, 255, 255, 0.1); /* Subtle background similar to .mock-x-post .post-meta */
    padding: 10px; /* Padding for spacing inside the background */
    border-radius: 5px; /* Rounded corners for a clean look */
    margin-top: 10px; /* Space from the .x-post-right above */
    width:95.5%;
}

.mock-x-post {
    background: #222;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.5em;
    color: #fff;
    border: 1px solid #333;
    width: 95%;
}

.mock-x-post p {
    margin: 5px 0;
}

.mock-x-post p:first-child {
    font-weight: bold;
    
}

.mock-x-post p:last-child {
    font-size: 12px;
    color: #fff;
}

/* Target the date <p> (second child in this structure) */
.mock-x-post p:nth-child(3) {
    font-size: 12px; /* Smaller than the original 11px */
    color: #ccc; /* Light gray inspired by the subtle rectification background */
}

.mock-x-post .post-meta {
    background: rgba(255, 255, 255, 0.1); /* Subtle white overlay for contrast */
    padding: 5px 10px;
    border-radius: 3px;
    margin-top: 10px; /* Spacing from the timestamp */
    width:40%;
}

.post h2 {
    font-size: 18px;
    margin: 0 0 10px;
    font-weight: 700;
}

/* Styles for aligned bias bars */
.bias-bars-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 5px 0;
}

.bias-bar-row {
    display: flex;
    align-items: center;
}

.bias-label {
    font-size: 12px;
    width: 125px;
    text-align: left;
    margin-right: 10px;
    font-weight: bold;
}

.bias-label.joke {
    color: yellow; /* Gold - Warm, playful, matches the joke bar */
}

.bias-label.usefulness {
    color: #ff4500; /* Orange-Red - Energetic, matches the usefulness bar */
}

.bias-label.knowledge {
    color: #4682b4; /* Steel Blue - Cool, intellectual, matches the knowledge bar */
}

.bias-label.positivity {
    color: #e066ff; /* Light Purple - Uplifting, inspired by but brighter than the positivity bar’s #800080 */
}

.bias-label.blah {
    color: white; 
}

.bias-label.grave {
    color: orange; 
}

.bias-bar-wrapper {
    display: flex;
    align-items: center;
}

.bias-bar-container {
    display: inline-block;
    position: relative;
    width: 100px;
    height: 6px;
    vertical-align: middle;
}

.bias-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #888;
    border-radius: 3px;
}

.bias-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 3px;
}

.bias-bar.joke {
    background: yellow;
}

.bias-bar.usefulness {
    background: #ff4500;
}

.bias-bar.knowledge {
    background: #4682b4;
}

.bias-bar.positivity {
    background: #e066ff;
}

.bias-bar.blah {
    background: white;
}

.bias-bar.grave {
    background: orange;
}

.bias-percentage {
    font-size: 12px;
    color: white;
    margin-left: 4px;
}

/* Updated styles for RatingTruth final bar */
.ratingtruth-bar-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    width: 98%;
    box-sizing: border-box;
}

.ratingtruth-label {
    font-size: 14px;
    color: #fff;
    width: 100px;
    text-align: left;
    margin-right: 10px;
    font-weight: bold;
    flex-shrink: 0; /* Prevent shrinking */
}

.ratingtruth-bar-wrapper {
    position: relative;
    flex-grow: 1;
    height: 10px;
    min-width: 0; /* Allow it to shrink but not overlap */
}

.ratingtruth-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #888;
    border-radius: 5px;
}

.ratingtruth-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #00FF00;
    border-radius: 5px;
}

.ratingtruth-percentage {
    font-size: 14px;
    color: #fff;
    margin-left: 10px;
    font-weight: bold;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Extend the bar only in the sidebar under the logo */
#sidebar-rating-bar .ratingtruth-bar-wrapper {
    width: 150px; /* Extend the bar width (adjust as needed) */
}

/* Ensure the container fits the extended bar */
#sidebar-rating-bar {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px; /* Space before the nav */
}

/* Keep the label and percentage aligned */
#sidebar-rating-bar .ratingtruth-label {
    width: 50px; /* Reduced width to fit the extended bar */
    font-size: 14px;
    text-align: left;
    margin-right: 5px;
}

#sidebar-rating-bar .ratingtruth-percentage {
    font-size: 14px;
    margin-left: 10px;
}

/* Default styles remain for other ratingtruth bars */
.ratingtruth-bar-wrapper {
    position: relative;
    flex-grow: 1;
    height: 10px;
    min-width: 0;
}

.source-info {
    font-size: 13px;
    color: #888;
    margin: 15px 0;
}

.source-info a {
    color: #1a73e8; /* Matches the blue used elsewhere (e.g., .next-btn) */
    text-decoration: none; /* Removes underline by default */
}

.source-info a:hover {
    text-decoration: underline; /* Adds underline on hover for usability */
}

.commentary {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.pagination {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background: rgba(20, 20, 20, 0.9);
    border-top: 1px solid #333;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.page-btn {
    background: #333;
    border: none;
    color: #00FF00;
    padding: 8px 12px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.page-btn:hover {
    background: #444;
}

.page-btn.active {
    background: #1a73e8;
}

.tweet-btn {
    background: #1a73e8;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    position: absolute; /* Position inside the .post */
    bottom: 4px; /* Stick to the bottom with some padding */
    right: 0px; /* Stick to the right, matching the padding of .post */
    left: 50%; /* Centers the button horizontally */
    transform: translateX(-50%); /* Offsets it by half its width to truly center */
    width:9%;
}

.tweet-btn:hover {
    background: #1557b0;
}

/* Centered and responsive top articles */
.top-articles {
    margin: 5px 0;
    padding: 10px; /* Increased padding for better spacing */
    background: rgba(20, 20, 20, 0.9);
    border-radius: 6px;
    border: 1px solid #333;
    text-align: center; /* Center the h3 text */
}

.top-articles h3 {
    font-size: 15px;
    color: #fff;
    margin: 0 0 10px 0; /* Adjusted for consistency */
}

.article-list {
    display: flex;
    justify-content: flex-start; /* Center articles horizontally */
    flex-wrap: nowrap; /* Default to single row on desktop */
    gap: 60px; /* Consistent spacing between articles */
    overflow-x: auto; /* Allow horizontal scrolling if needed */
    padding: 0 10px; /* Add padding to prevent edge clipping */
}

.top-article {
    flex: 0 0 auto; /* Prevent shrinking or growing beyond content */
    min-width: 200px; /* Slightly wider base width for readability */
    max-width: 300px; /* Cap width to prevent over-expansion */
    padding: 8px; /* Increased padding for internal spacing */
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content within each article */
    background: rgba(30, 30, 30, 0.7); /* Subtle background for contrast */
}

.top-article a {
    color: #1a73e8;
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 4px;
    display: block;
    text-align: center; /* Center the link text */
    white-space: normal; /* Allow text to wrap naturally */
    word-wrap: break-word; /* Break long words if needed */
}

.top-article a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #1557b0;
}

/* Adjust bias bars and rating section within top articles */
.top-article .rating-section {
    width: 100%; /* Full width within container */
    padding: 5px; /* Reduced padding for compactness */
}

.top-article .bias-label {
    font-size: 10px; /* Smaller font to fit better */
    width: 110px; /* Slightly reduced width */
}

.top-article .bias-bar-container {
    width: 80px; /* Smaller bar to fit within narrower container */
}

.top-article .bias-percentage {
    font-size: 10px;
}

.nowrap {
    white-space: nowrap; /* Keeps text on one line */
    display: inline; /* Ensures it behaves inline with parent */
}

/* Adjust ratingtruth-label specifically within top-articles */
.top-article .ratingtruth-label {
    font-size: 12px;
    width: auto; /* Let it shrink to content */
    min-width: 80px; /* Minimum width to ensure readability */
    margin-right: 5px;
    display: flex; /* Use flex to align content */
    align-items: center; /* Vertically center the text */
}

/* Ensure the container remains flexible */
.top-article .ratingtruth-bar-container {
    display: flex;
    align-items: center;
    padding: 5px;
    width: 100%;
    flex-wrap: nowrap; /* Prevent wrapping of label, bar, and percentage */
}

/* Adjust bar and percentage for consistency */
.top-article .ratingtruth-bar-wrapper {
    min-width: 80px;
    flex-grow: 1; /* Allow bar to take remaining space */
}

.top-article .ratingtruth-percentage {
    font-size: 12px;
    margin-left: 5px; /* Reduced margin for tighter fit */
}

/* Red bar color for negative values */
.ratingtruth-bar.negative {
    background: #FF0000; /* Red for negative */
}


/* Ensure the sidebar rating bar container has proper spacing and alignment */
#sidebar-rating-bar {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    width: 100%; /* Ensure it takes full width of sidebar */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Adjust the label to prevent overlap */
#sidebar-rating-bar .ratingtruth-label {
    width: 60px; /* Slightly increased from 50px to fit "19/03/25" */
    font-size: 14px;
    text-align: left;
    margin-right: 10px; /* Increased from 5px for more separation */
    white-space: nowrap; /* Prevent date from wrapping */
    flex-shrink: 0; /* Prevent label from shrinking */
}

/* Extend and adjust the bar wrapper */
#sidebar-rating-bar .ratingtruth-bar-wrapper {
    width: 100px; /* Reduced from 150px to balance space */
    height: 10px;
    flex-grow: 1; /* Allow it to take remaining space */
    min-width: 50px; /* Ensure it doesn't collapse too much */
    position: relative;
}

/* Ensure the bar background and fill stay within bounds */
#sidebar-rating-bar .ratingtruth-bar-bg,
#sidebar-rating-bar .ratingtruth-bar {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

/* Style the negative bar (red) */
#sidebar-rating-bar .ratingtruth-bar.negative {
    background: #FF0000; /* Red for negative values */
}

/* Adjust the percentage to avoid overlap */
#sidebar-rating-bar .ratingtruth-percentage {
    font-size: 14px;
    margin-left: 10px;
    white-space: nowrap; /* Keep percentage on one line */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Footer Styles */
.footer {
    background: rgba(20, 20, 20, 0.9);
    padding: 10px;
    text-align: right;
    border-top: 1px solid #333;
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.footer p {
    margin: 5px 0;
    font-size: 13px;
    color: #888;
}

.footer a {
    color: #1a73e8;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Bias Icons Container - Large Screens */
.bias-icons {
    width: 98%; /* Full width of .x-post-left */
    height: 30px; /* Fixed height for icons */
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* Space icons evenly */
    align-items: center;
    background: rgba(20, 20, 20, 0.9);
    padding: 2px;
    margin-bottom: 10px; /* Space between icons and Twitter embed */
    border: 1px solid #333;
    border-radius: 8px;
}

/* Individual Bias Icon */
.bias-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px; /* Smaller to fit horizontally */
    text-align: center;
    color: #fff;
    flex: 1; /* Distribute space evenly */
}

/* Color coding to match bias bars */
.bias-icon.joke {
    color: yellow;
}

.bias-icon.usefulness {
    color: #ff4500;
}

.bias-icon.knowledge {
    color: #4682b4;
}

.bias-icon.positivity {
    color: #e066ff;
}

.bias-icon.blah {
    color: white;
}

.bias-icon.grave {
    color: orange;
}



/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        max-width: 100%;
        height: auto;
    }

    .sidebar {
        position: static;
        width: 100%;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #333;
        height: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        border-radius: 0;
    }

    .logo {
        font-size: 18px;
        margin-bottom: 0;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    nav a {
        font-size: 14px;
        margin: 5px;
        padding: 5px;
    }

    .trending {
        display: none;
    }

    main {
        margin-left: 0;
        padding: 10px;
        height: auto;
    }

    .search-bar {
        font-size: 12px;
        padding: 8px;
        border: 2px solid #1a73e8;
    }

    .next-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .post {
        flex-direction: column;
        padding: 10px;
	padding-bottom: 40px;
        border-radius: 4px;
	position: relative;
    }

    .x-post-left {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .x-post-left .twitter-tweet {
        padding: 0px;
    }

    .x-post-right {
        margin-bottom: 10px;
    }

    .mock-x-post {
        font-size: 1.2em;
    }

    .mock-x-post p:last-child {
        font-size: 10px;
    }

    .mock-x-post .post-meta {
        width:55%;
    }

    .post-content {
        flex: none;
        width: 100%;
    }

    .post h2 {
        font-size: 16px;
    }

    .source-info, .commentary {
        font-size: 12px;
    }

    .bias-bar-row {
        flex-wrap: wrap;
    }

    .bias-label {
        font-size: 10px;
        width: 120px;
        margin-right: 5px;
    }

    .bias-bar-container {
        width: 80px;
    }

    .bias-percentage {
        font-size: 10px;
        margin-left: 2px;
    }

    .ratingtruth-bar-container {
        padding: 8px;
        flex-wrap: nowrap; /* Prevent wrapping to avoid overlap */
    }

    .ratingtruth-label {
        font-size: 12px;
        width: 80px; /* Slightly wider to prevent overlap */
        margin-right: 5px;
        white-space: nowrap; /* Keep label on one line */
    }

    .ratingtruth-bar-wrapper {
        height: 8px;
        flex-grow: 1;
        min-width: 100px; /* Ensure bar has enough space */
    }

    .ratingtruth-percentage {
        font-size: 12px;
        margin-left: 6px;
        white-space: nowrap; /* Keep percentage on one line */
    }

    .pagination {
        padding: 5px 0;
    }

    .page-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .tweet-btn {
        font-size: 1em; /* Reduced from 16px for mobile */
        padding: 3px 6px; /* Reduced from 5px 10px to keep it narrower */
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width:16%;
    }

    .top-articles {
       display:none;
    }

    .footer {
        padding: 8px;
    }

    .footer p {
        font-size: 12px;
    }

    .bias-icons {
        position: static; /* Switch to static positioning on mobile */
        width: 99%;
        flex-direction: row;
        justify-content: space-around;
        height: auto;
        padding: 5px 0;
        border: 1px solid #333;
        margin-bottom: 10px;
    }

    .bias-icon {
        flex-direction: row;
        font-size: 15px; /* Even smaller for mobile */
        margin: 0 5px;
    }

}

/* Smooth scrolling behavior for the page */
html {
    scroll-behavior: smooth; /* Enables smooth scrolling when clicking links */
}
