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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f9f5e9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    text-align: center;
}

h1 {
    font-family: 'Lora', serif;
    color: #23496a;
    margin-bottom: 20px;
    font-size: 2.5em;
}

#filter {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

button {
    background-color: #23496a;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #8a623f;
}

#articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.article {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.article:hover {
    transform: scale(1.03);
}

.category {
    font-weight: bold;
    color: #6a4e23;
}

.source {
    font-size: 0.9em;
    margin-top: 6px;
    font-weight: bold;
    color: #6a4e23;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

#loading {
    font-size: 1.5em;
    font-weight: bold;
    color: #23496a;
    margin-top: 20px;
}

.summary {
    font-size: 1.1em;
    margin-top: 10px;
    color: #555;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: #23496a;
    margin-top: 10px;
    display: inline-block;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

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

@media (max-width: 480px) {
    #articles {
        grid-template-columns: 1fr;
    }
}

.header {
    width: 100%;
    margin-bottom: 20px;
}

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

.header-inner h1 {
    flex-grow: 1;
    text-align: center;
    font-size: 2.5em;
    margin: 0 auto;
    white-space: nowrap;
    width: 100%;
}

#auth-buttons,
#profile-dropdown {
    display: flex;
    gap: 10px;
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: center;
    }

    .header-inner h1 {
        font-size: 2em;
    }

    #auth-buttons,
    #profile-dropdown {
        justify-content: center;
    }

    #filter {
        flex-direction: column;
        align-items: center;
    }
}

.avatar-button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-color: #23496a;
    color: white;
    border: none;
    cursor: pointer;
}

.save-btn.saved {
    background-color: #8a623f;
}

.bias-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    font-size: 0.9em;
    min-width: 70px;
    text-align: center;
    user-select: none;
    margin-bottom: 8px;
}

.bias-meter {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 20px;
    background: linear-gradient(to right,
            #003366 0%,
            /* Far Left - dark blue */
            #3399ff 25%,
            /* Left - light blue */
            #4caf50 50%,
            /* Center - green */
            #ff9966 75%,
            /* Right - light orange */
            #cc3300 100%
            /* Far Right - dark red */
        );
    border-radius: 10px;
    margin: 10px auto 30px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.bias-meter-marker:hover {
    background-color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.bias-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #444;
    margin-top: 5px;
    width: 200px;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

.bias-meter-marker {
    position: absolute;
    top: -8px;
    /* position marker slightly above bar */
    width: 18px;
    height: 18px;
    background: #222;
    border-radius: 50%;
    border: 3px solid white;
    cursor: default;
    transition: left 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    user-select: none;
    white-space: nowrap;
    padding: 0 5px;
}

/* Colors for each bias */
.bias-left-far {
    background-color: #003366;
    /* dark blue */
}

.bias-left {
    background-color: #3399ff;
    /* light blue */
}

.bias-center {
    background-color: #4caf50;
    /* green */
}

.bias-right {
    background-color: #ff9966;
    /* light orange */
}

.bias-right-far {
    background-color: #cc3300;
    /* dark red */
}

.bias-unknown {
    background-color: #999999;
    /* gray */
}

.bias-label-center {
    position: absolute;
    top: 105%;
    /* Push below the dot */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
}

#dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    text-align: left;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #23496a;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 1em;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}