:root {
    /* Warm, inviting backgrounds - Town Square aesthetic */
    --ts-bg-base: #0a0a0a;
    --ts-bg-surface: rgba(26, 26, 28, 0.92);
    --ts-bg-surface-soft: rgba(34, 34, 38, 0.78);
    --ts-bg-overlay: rgba(15, 15, 18, 0.7);

    /* Borders - teal accents instead of blue */
    --ts-border: rgba(20, 184, 166, 0.15);
    --ts-border-strong: rgba(148, 163, 184, 0.22);
    --ts-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(20, 184, 166, 0.08);

    /* Text colors - warmer tones */
    --ts-text-primary: #f0f0f0;
    --ts-text-secondary: #d1d5db;
    --ts-text-muted: #9ca3af;
    --ts-heading: #ffffff;

    /* Links - teal instead of purple */
    --ts-link: #14b8a6;
    --ts-link-hover: #0d9488;

    /* Primary accent - Teal/Emerald for actions */
    --ts-accent: #14b8a6;
    --ts-accent-hover: #0d9488;
    --ts-accent-soft: rgba(20, 184, 166, 0.16);

    /* Secondary accent - Amber/Gold for reputation */
    --ts-gold: #f59e0b;
    --ts-gold-hover: #d97706;
    --ts-gold-soft: rgba(245, 158, 11, 0.16);

    /* Tertiary accent - Terracotta/Orange for special elements */
    --ts-orange: #f97316;
    --ts-orange-hover: #ea580c;
    --ts-orange-soft: rgba(249, 115, 22, 0.16);

    /* Status colors */
    --ts-success: #10b981;
    --ts-danger: #ef4444;
    --ts-warning: #f59e0b;

    /* Border radius - less uniform, more character */
    --ts-radius-lg: 16px;
    --ts-radius-md: 12px;
    --ts-radius-sm: 8px;
    --ts-radius-full: 9999px;

    --ts-font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
}

/* Light theme */
[data-theme='light'] {
    /* Warm, paper-like backgrounds */
    --ts-bg-base: #fafaf9;
    --ts-bg-surface: #ffffff;
    --ts-bg-surface-soft: #f5f5f4;
    --ts-bg-overlay: rgba(255, 255, 255, 0.98);

    /* Borders with teal accents */
    --ts-border: rgba(20, 184, 166, 0.2);
    --ts-border-strong: rgba(71, 85, 85, 0.35);
    --ts-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(20, 184, 166, 0.06);

    /* Text colors */
    --ts-text-primary: #171717;
    --ts-text-secondary: #404040;
    --ts-text-muted: #737373;
    --ts-heading: #000000;

    /* Links - teal */
    --ts-link: #0d9488;
    --ts-link-hover: #0f766e;

    /* Accents */
    --ts-accent: #14b8a6;
    --ts-accent-hover: #0d9488;
    --ts-accent-soft: rgba(20, 184, 166, 0.12);

    --ts-gold: #f59e0b;
    --ts-gold-hover: #d97706;
    --ts-gold-soft: rgba(245, 158, 11, 0.12);

    --ts-orange: #f97316;
    --ts-orange-hover: #ea580c;
    --ts-orange-soft: rgba(249, 115, 22, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--ts-bg-base);
    color: var(--ts-text-primary);
    font-family: var(--ts-font-family);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ts-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--ts-link-hover);
}

h1,
h2,
h3,
h4 {
    color: var(--ts-heading);
    letter-spacing: -0.01em;
}

.ts-card {
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    box-shadow: var(--ts-card-shadow);
    backdrop-filter: blur(12px);
}

.ts-card-soft {
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
}

.ts-divider {
    background: linear-gradient(to right, transparent, rgba(20, 184, 166, 0.35), transparent);
    height: 1px;
    border: 0;
}

.ts-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--ts-radius-full);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    background: var(--ts-accent-soft);
    color: var(--ts-text-secondary);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

[data-theme='light'] .ts-pill {
    background: var(--ts-accent-soft);
    color: var(--ts-text-secondary);
    border: 1px solid rgba(20, 184, 166, 0.4);
    font-weight: 700;
}

.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ts-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ts-btn-primary {
    background: linear-gradient(135deg, var(--ts-accent), #10b981);
    color: #fff;
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.35);
}

.ts-btn-primary:hover {
    background: linear-gradient(135deg, var(--ts-accent-hover), #059669);
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.4);
}

.ts-btn-outline {
    background: transparent;
    color: var(--ts-heading);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

[data-theme='light'] .ts-btn-outline {
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #0a0e1a;
}

.ts-btn-outline:hover {
    background: var(--ts-accent-soft);
    border-color: rgba(20, 184, 166, 0.4);
}

[data-theme='light'] .ts-btn-outline:hover {
    background: var(--ts-accent-soft);
    border-color: rgba(20, 184, 166, 0.6);
}

.ts-btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.3);
}

.ts-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.ts-btn-secondary {
    background: rgba(30, 41, 59, 0.85);
    color: var(--ts-text-secondary);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme='light'] .ts-btn-secondary {
    background: #f1f5f9;
    color: #0a0e1a;
    border-color: rgba(71, 85, 105, 0.4);
    font-weight: 600;
}

.ts-btn-secondary:hover {
    color: var(--ts-heading);
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(30, 41, 59, 0.95);
}

[data-theme='light'] .ts-btn-secondary:hover {
    background: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.5);
    color: #020617;
}

.ts-btn-ghost {
    background: transparent;
    color: var(--ts-text-muted);
    border-color: transparent;
}

.ts-btn-ghost:hover {
    color: var(--ts-heading);
    background: rgba(99, 102, 241, 0.12);
}

.ts-input {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-md);
    color: var(--ts-text-primary);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

[data-theme='light'] .ts-input {
    background: #ffffff;
    border-color: rgba(71, 85, 105, 0.4);
    color: #0a0e1a;
}

.ts-input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

[data-theme='light'] .ts-input::placeholder {
    color: #64748b;
}

.ts-input:focus {
    outline: none;
    border-color: var(--ts-accent);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.25);
}

.ts-nav-link {
    border-radius: var(--ts-radius-md);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    color: var(--ts-text-muted);
}

.ts-nav-link:hover {
    background: var(--ts-accent-soft);
    color: var(--ts-text-primary);
}

.ts-nav-link.active {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.35);
    color: var(--ts-heading) !important;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.25);
}

.ts-subtitle {
    color: var(--ts-text-muted);
    font-size: 0.9rem;
}

.ts-surface {
    background: var(--ts-bg-overlay);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--ts-radius-lg);
}

[data-theme='light'] .ts-surface {
    border: 1px solid rgba(71, 85, 105, 0.35);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.ts-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ts-text-muted);
}

.ts-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) rgba(15, 23, 42, 0.65);
}

.ts-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.ts-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.65);
}

.ts-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.ts-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ts-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
}

.ts-quick-actions .ts-btn {
    width: auto;
}

.ts-grid {
    display: grid;
    gap: 1rem;
}

.ts-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ts-grid-quick {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ts-hero {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.ts-hero p {
    color: var(--ts-text-secondary);
    font-size: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 4vw, 3rem);
    line-height: 1.1;
}

.ts-feature-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ts-feature-card {
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--ts-text-secondary);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.ts-feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(20, 184, 166, 0.4);
}

[data-theme='light'] .ts-feature-card {
    background: #ffffff;
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #1e293b;
}

/* Light mode text overrides for post content */
[data-theme='light'] .text-gray-300,
[data-theme='light'] .text-gray-400,
[data-theme='light'] .text-gray-500 {
    color: #1e293b !important;
}

[data-theme='light'] p,
[data-theme='light'] span,
[data-theme='light'] div {
    color: #0f172a;
}

[data-theme='light'] .ts-feature-card:hover {
    border-color: rgba(20, 184, 166, 0.6);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.ts-step {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(20, 184, 166, 0.16);
}

.ts-step:last-child {
    border-bottom: none;
}

.ts-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--ts-radius-full);
    background: var(--ts-accent-soft);
    color: var(--ts-accent);
    font-weight: 700;
}

.ts-step strong {
    color: var(--ts-heading);
}

.ts-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--ts-text-muted);
    background: rgba(148, 163, 184, 0.12);
}

[data-theme='light'] .ts-badge {
    border-color: rgba(71, 85, 105, 0.5);
    color: #1e293b;
    background: rgba(148, 163, 184, 0.2);
    font-weight: 700;
}

.ts-badge-accent {
    border-color: rgba(20, 184, 166, 0.35);
    color: var(--ts-accent);
    background: var(--ts-accent-soft);
}

[data-theme='light'] .ts-badge-accent {
    border-color: rgba(20, 184, 166, 0.5);
    color: var(--ts-accent-hover);
    background: var(--ts-accent-soft);
    font-weight: 700;
}

.ts-empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.55);
    border-radius: var(--ts-radius-md);
    padding: 2rem;
    text-align: center;
    color: var(--ts-text-muted);
}

[data-theme='light'] .ts-empty-state {
    border: 2px dashed rgba(71, 85, 105, 0.5);
    background: #f8fafc;
    color: #334155;
}

.ts-stacked {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ts-divider-soft {
    height: 1px;
    background: rgba(148, 163, 184, 0.18);
    border: 0;
    margin: 1.5rem 0;
}

[data-theme='light'] .ts-divider-soft {
    background: rgba(71, 85, 105, 0.35);
}

@media (min-width: 768px) {
    .ts-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ts-card {
        border-radius: var(--ts-radius-md);
        padding: 1.5rem;
    }

    .ts-btn {
        width: 100%;
    }

    .ts-section-header {
        align-items: stretch;
    }

    .ts-section-header .ts-btn {
        width: 100%;
    }

    .ts-quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .ts-feature-grid {
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* App-specific styles */
.main-content-border {
    border-left: 1px solid rgba(148, 163, 184, 0.12);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

[data-theme='light'] .main-content-border {
    border-left: 1px solid rgba(71, 85, 105, 0.35);
    border-right: 1px solid rgba(71, 85, 105, 0.35);
}

/* Header styles for light/dark mode */
main > header.sticky {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(20, 184, 166, 0.15);
}

[data-theme='light'] main > header.sticky {
    background: rgba(245, 247, 250, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

[data-theme='light'] main > header.sticky h2 {
    color: #000000;
}

[data-theme='light'] main > header.sticky button {
    color: #0f172a;
}

[data-theme='light'] main > header.sticky button:hover {
    color: #000000;
}

[data-theme='light'] main > header.sticky .text-gray-400,
[data-theme='light'] main > header.sticky p {
    color: #1e293b;
}

/* Post form area light mode */
[data-theme='light'] main > #main-content-area > main#main-feed-page > .ts-card {
    background: #ffffff;
    border-color: rgba(71, 85, 105, 0.3);
}

/* Comment input styles in light mode */
[data-theme='light'] .comment-input {
    background: #ffffff;
    border-color: rgba(71, 85, 105, 0.4);
    color: #0a0e1a;
}

[data-theme='light'] .comment-input::placeholder {
    color: #64748b;
}

[data-theme='light'] .comment-input:focus {
    border-color: var(--ts-accent);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
}

/* Profile tabs */
.profile-tab.active {
    color: #fff;
    border-bottom: 2px solid var(--ts-accent);
}

[data-theme='light'] .profile-tab.active {
    color: #020617;
    font-weight: 700;
}

/* Micro-interactions and transitions */
.ts-card,
.ts-btn,
.ts-input,
.ts-nav-link {
    transition: all 0.2s ease;
}

.ts-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.5);
}

[data-theme='light'] .ts-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

button:active,
.ts-btn:active {
    transform: scale(0.98);
}

.ts-input:focus {
    transform: translateY(-1px);
}

/* Smooth page transitions */
.page {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease-in-out;
}

.page.page-entering {
    opacity: 0;
}

.page.page-exiting {
    opacity: 0;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.ts-btn:disabled {
    cursor: wait;
    transform: none;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* Theme toggle button */
#theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background: var(--ts-bg-surface);
    border-color: var(--ts-accent);
}

#theme-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

#theme-toggle .sun-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

#theme-toggle .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

[data-theme='light'] #theme-toggle .sun-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

[data-theme='light'] #theme-toggle .moon-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--ts-bg-surface-soft) 25%,
        var(--ts-bg-surface) 50%,
        var(--ts-bg-surface-soft) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--ts-radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-post {
    padding: 1.5rem;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    margin-bottom: 1rem;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Progressive image loading */
.progressive-image {
    position: relative;
    overflow: hidden;
    background: var(--ts-bg-surface-soft);
}

.progressive-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progressive-image img.loaded {
    opacity: 1;
}

.progressive-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

.vote-btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ts-text-secondary);
}

.vote-btn:hover {
    background: var(--ts-accent-soft);
    border-color: rgba(20, 184, 166, 0.4);
}

[data-theme='light'] .vote-btn {
    border-color: rgba(71, 85, 105, 0.3);
    color: var(--ts-text-secondary);
}

[data-theme='light'] .vote-btn:hover {
    background: var(--ts-accent-soft);
    border-color: rgba(20, 184, 166, 0.5);
}

.vote-btn.good-opinion {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.vote-btn.good-opinion svg {
    fill: #38bdf8;
    stroke: #38bdf8;
}

.vote-btn.bad-opinion {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

.vote-btn.bad-opinion svg {
    fill: #f87171;
    stroke: #f87171;
}

[data-theme='light'] .vote-btn.good-opinion {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.5);
    color: #0284c7;
}

[data-theme='light'] .vote-btn.good-opinion svg {
    fill: #0284c7;
    stroke: #0284c7;
}

[data-theme='light'] .vote-btn.bad-opinion {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.5);
    color: #dc2626;
}

[data-theme='light'] .vote-btn.bad-opinion svg {
    fill: #dc2626;
    stroke: #dc2626;
}

.vote-btn svg {
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        fill 0.2s ease,
        stroke 0.2s ease;
}

.vote-btn:hover svg {
    opacity: 0.85;
    transform: translateY(-1px);
}

.spinner {
    animation: spin 1s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    height: 16px;
    width: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#side-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

#side-menu.open {
    transform: translateX(0);
}

.page.hidden {
    display: none;
}

#search-filter-buttons .search-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--ts-text-secondary);
    background: rgba(30, 41, 59, 0.7);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

[data-theme='light'] #search-filter-buttons .search-filter-btn {
    background: #f1f5f9;
    color: #1e293b;
    border-color: rgba(71, 85, 105, 0.4);
    font-weight: 600;
}

#search-filter-buttons .search-filter-btn:hover {
    background: var(--ts-accent-soft);
    color: var(--ts-heading);
}

[data-theme='light'] #search-filter-buttons .search-filter-btn:hover {
    background: var(--ts-accent-soft);
    color: #020617;
}

#search-filter-buttons .search-filter-btn.active {
    background: linear-gradient(135deg, var(--ts-accent), #10b981);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.35);
}

.hashtag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--ts-radius-full);
    background: var(--ts-accent-soft);
    color: var(--ts-accent);
    font-size: 0.85rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
    border: 1px solid rgba(20, 184, 166, 0.35);
}

[data-theme='light'] .hashtag-chip {
    background: var(--ts-accent-soft);
    color: var(--ts-accent-hover);
    border: 1px solid rgba(20, 184, 166, 0.45);
    font-weight: 600;
}

.hashtag-chip:hover {
    background: rgba(20, 184, 166, 0.28);
}

[data-theme='light'] .hashtag-chip:hover {
    background: rgba(20, 184, 166, 0.2);
    color: var(--ts-accent-hover);
    border-color: rgba(20, 184, 166, 0.6);
}

.nav-link {
    position: relative;
    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.nav-link.active span {
    color: inherit;
}

#shortcut-cheatsheet {
    background: var(--ts-bg-surface);
    border: 1px solid rgba(20, 184, 166, 0.25);
}

#shortcut-cheatsheet kbd {
    background: rgba(148, 163, 184, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    color: #e2e8f0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ts-btn {
        padding: 0.75rem 1.5rem;
        min-height: 44px; /* Touch target size */
        font-size: 0.9375rem; /* 15px - readable but compact */
    }

    .ts-input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.75rem;
    }

    textarea.ts-input {
        font-size: 16px;
        padding: 0.75rem;
    }

    /* Larger touch targets for all interactive elements */
    button,
    a.ts-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing on mobile */
    .ts-card {
        margin: 0.5rem;
        padding: 1rem;
    }

    /* Profile tabs full width on mobile */
    .profile-tab {
        font-size: 0.875rem;
        padding: 1rem 0.5rem;
        min-height: 48px;
    }

    /* Vote buttons - larger touch targets */
    .vote-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .vote-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Hamburger and header buttons */
    #hamburger-btn,
    #theme-toggle,
    #notification-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem;
        border-radius: 12px;
    }

    /* Post menu toggle (three dots) */
    .post-menu-toggle,
    .comment-menu-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Quality vote buttons - bigger on mobile */
    .quality-vote-btn {
        min-height: 44px;
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }

    /* Search filter buttons */
    .search-filter-btn {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
        font-size: 0.9375rem;
    }

    /* Comment input better sizing */
    .comment-input {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 16px;
    }

    /* Better spacing between interactive elements */
    .flex.items-center.space-x-3 {
        gap: 0.875rem;
    }

    .flex.items-center.space-x-2 {
        gap: 0.625rem;
    }

    /* Post cards - better mobile padding and spacing */
    [data-post-id] {
        padding: 1rem !important;
    }

    /* Optimize header for mobile */
    main > header.sticky {
        padding: 0.75rem 1rem;
    }

    #page-title {
        font-size: 1.125rem;
    }

    /* Notification panel - responsive width */
    #notification-panel {
        width: calc(100vw - 2rem);
        max-width: 400px;
        right: 1rem;
        left: auto;
        max-height: 70vh;
    }

    /* Modals - better mobile positioning */
    #confirmation-modal .ts-card,
    #quote-modal .ts-card,
    #report-modal .ts-card {
        width: calc(100vw - 2rem);
        max-width: 500px;
        margin: 1rem;
    }

    /* Advanced filters - stack on mobile */
    #advanced-filters .grid-cols-1 {
        grid-template-columns: 1fr;
    }

    #advanced-filters .md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Onboarding modal */
    #onboarding-modal .ts-card {
        width: calc(100vw - 2rem);
        padding: 1.5rem;
    }

    /* DMs sidebar - collapsible on mobile */
    #dms-page > div:first-child {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .ts-card {
        padding: 1rem;
        border-radius: var(--ts-radius-md);
    }

    .ts-grid {
        gap: 0.75rem;
    }

    .ts-grid-3,
    .ts-grid-quick {
        grid-template-columns: 1fr;
    }

    .ts-feature-grid {
        grid-template-columns: 1fr;
    }

    .ts-hero {
        gap: 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    /* Compact button text on mobile */
    .ts-btn {
        font-size: 0.875rem;
    }

    /* Reduce spacing in forms */
    form .space-y-4 > * + * {
        margin-top: 0.75rem;
    }

    /* Mobile-friendly modals */
    #confirmation-modal .ts-card {
        padding: 1.5rem;
    }

    /* Notification dropdown positioning */
    #notification-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }
}

/* Keyboard navigation - active post highlight */
.active-post {
    border-color: var(--ts-accent) !important;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.3);
    transition: all 0.2s ease;
}

/* Scroll to Top FAB */
.scroll-to-top-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ts-accent), #10b981);
    color: #fff;
    border: none;
    box-shadow:
        0 8px 24px rgba(20, 184, 166, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 35;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
}

.scroll-to-top-fab:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-to-top-fab:hover {
    background: linear-gradient(135deg, var(--ts-accent-hover), #059669);
    box-shadow:
        0 12px 32px rgba(20, 184, 166, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px) scale(1.05);
}

.scroll-to-top-fab:active {
    transform: translateY(-2px) scale(1.02);
}

.scroll-to-top-fab svg {
    transition: transform 0.2s ease;
}

.scroll-to-top-fab:hover svg {
    transform: translateY(-2px);
}

/* Mobile-friendly FAB sizing */
@media (max-width: 768px) {
    .scroll-to-top-fab {
        width: 48px;
        height: 48px;
        bottom: 1.5rem;
        right: 1.5rem;
        /* Larger touch target */
        min-width: 48px;
        min-height: 48px;
    }

    .scroll-to-top-fab svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 640px) {
    .scroll-to-top-fab {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Mobile gesture styles */
#pull-refresh-indicator {
    transform: translate(-50%, -100px) scale(0.5);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-refresh-spinner {
    will-change: transform;
}

.swipe-feedback-arrow {
    animation: swipeBounce 0.4s ease-out;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes swipeBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Prevent overscroll/bounce on mobile when pulling */
@media (max-width: 768px) {
    body {
        overscroll-behavior-y: contain;
    }
}

/* Bottom Navigation Bar - Mobile Only */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--ts-bg-surface);
    border-top: 1px solid var(--ts-border);
    backdrop-filter: blur(12px);
    z-index: 40;
    display: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme='light'] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: var(--ts-border-strong);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 0.5rem;
    }

    /* Add padding to main content to prevent overlap */
    main.main-content-border {
        padding-bottom: 80px;
    }
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    min-width: 64px;
    min-height: 56px;
    color: var(--ts-text-muted);
    transition: all 0.2s ease;
    border-radius: 12px;
    text-decoration: none;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item:active {
    background: var(--ts-accent-soft);
    color: var(--ts-text-primary);
}

.mobile-bottom-nav-item.active {
    color: var(--ts-accent);
    background: var(--ts-accent-soft);
}

.mobile-bottom-nav-item svg {
    width: 24px;
    height: 24px;
}

.mobile-bottom-nav-item span {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hide desktop nav on mobile when bottom nav is active */
@media (max-width: 768px) {
    header.hidden.md\\:block {
        display: none;
    }

    /* Footer positioning with bottom nav */
    footer {
        margin-bottom: 64px;
        padding-bottom: 1rem;
    }

    /* Scroll to top button - adjust for bottom nav */
    .scroll-to-top-fab {
        bottom: 5rem; /* Move up to avoid bottom nav */
    }

    /* Cookie consent banner - adjust for bottom nav */
    #cookie-consent-banner {
        bottom: 64px;
    }
}

/* Reputation & Trust Level Badges - Gold Theme */
.utl-badge,
.reputation-badge {
    background: linear-gradient(135deg, var(--ts-gold), var(--ts-orange));
    color: #fff;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: var(--ts-radius-sm);
}

.elo-score {
    background: var(--ts-gold-soft);
    color: var(--ts-gold);
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--ts-radius-sm);
    font-size: 0.875rem;
}

[data-theme='light'] .elo-score {
    background: var(--ts-gold-soft);
    color: var(--ts-gold-hover);
    border-color: rgba(245, 158, 11, 0.45);
}

/* Forum-style Post Cards */
.post-card {
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border);
    border-left: 3px solid var(--ts-accent);
    border-radius: var(--ts-radius-md);
    box-shadow: var(--ts-card-shadow);
    transition: all 0.2s ease;
}

.post-card:hover {
    border-left-color: var(--ts-gold);
    transform: translateX(2px);
}

[data-theme='light'] .post-card {
    border-left-color: var(--ts-accent);
}

[data-theme='light'] .post-card:hover {
    border-left-color: var(--ts-gold);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Enhanced Button Styles */
.ts-btn-gold {
    background: linear-gradient(135deg, var(--ts-gold), var(--ts-orange));
    color: #fff;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.ts-btn-gold:hover {
    background: linear-gradient(135deg, var(--ts-gold-hover), var(--ts-orange-hover));
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.4);
}

/* Quality Vote Badges */
.quality-vote-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--ts-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
}

.quality-vote-badge.positive {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--ts-success);
}

.quality-vote-badge.negative {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--ts-danger);
}

.quality-vote-badge.neutral {
    background: var(--ts-gold-soft);
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--ts-gold);
}

/* New Posts Indicator Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Enable smooth scrolling */
    html {
        scroll-behavior: smooth;
    }

    /* GPU acceleration for animations */
    .ts-card,
    .vote-btn,
    .ts-btn,
    .mobile-bottom-nav-item {
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-font-smoothing: antialiased;
    }

    /* Reduce motion for better performance */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* Optimize scrolling */
    .overflow-y-auto,
    #feed-container,
    #notifications-container,
    #messages-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Improve tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(20, 184, 166, 0.1);
    }

    /* Better text rendering on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* Disable pull-to-refresh on Chrome for better control */
    body {
        overscroll-behavior-y: contain;
    }

    /* Optimize images for mobile */
    img[loading="lazy"] {
        content-visibility: auto;
    }
}

/* Feed Tabs Styling */
.feed-tabs-container {
    position: sticky;
    top: 64px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ts-border);
}

[data-theme='light'] .feed-tabs-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.feed-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ts-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.feed-tab svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.feed-tab:hover {
    color: var(--ts-text-primary);
    background: var(--ts-accent-soft);
}

.feed-tab.active {
    color: var(--ts-accent);
    border-bottom-color: var(--ts-accent);
    font-weight: 600;
}

.feed-tab.active svg {
    transform: translateY(-2px);
}

[data-theme='light'] .feed-tab {
    color: #64748b;
}

[data-theme='light'] .feed-tab:hover {
    color: #0f172a;
    background: var(--ts-accent-soft);
}

[data-theme='light'] .feed-tab.active {
    color: var(--ts-accent);
    font-weight: 700;
}

/* Skeleton Loader Animations */
.skeleton-post {
    padding: 1.5rem;
    border-bottom: 1px solid var(--ts-border);
    animation: fadeIn 0.3s ease-in-out;
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--ts-bg-surface-soft) 25%,
        var(--ts-bg-surface) 50%,
        var(--ts-bg-surface-soft) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--ts-radius-sm);
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-text {
    height: 0.875rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Feed Loading States */
#feed-loading-indicator {
    animation: fadeIn 0.3s ease-in-out;
}

#feed-end-message {
    animation: fadeIn 0.3s ease-in-out;
}

/* Mobile responsive tabs */
@media (max-width: 640px) {
    .feed-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .feed-tab span {
        display: none;
    }

    .feed-tab svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .feed-tabs-container {
        top: 56px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .feed-tab {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Smooth transitions for feed content */
.feed-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.feed-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

/* Pull to refresh indicator (for mobile) */
@media (max-width: 768px) {
    .feed-tabs-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   RICH TEXT EDITOR STYLES
   ======================================== */

/* Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    flex-wrap: wrap;
}

.formatting-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.formatting-toolbar-divider {
    width: 1px;
    height: 1.5rem;
    background: var(--ts-border);
}

.formatting-toolbar-hint {
    margin-left: auto;
}

.formatting-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0.375rem;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-sm);
    background: transparent;
    color: var(--ts-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.formatting-btn:hover {
    background: var(--ts-accent-soft);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

.formatting-btn:active {
    transform: scale(0.95);
}

/* Autocomplete Dropdown */
.rich-editor-autocomplete {
    position: absolute;
    z-index: 1000;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-md);
    box-shadow: var(--ts-card-shadow);
    backdrop-filter: blur(12px);
}

.rich-editor-autocomplete.hidden {
    display: none;
}

.autocomplete-items {
    padding: 0.25rem;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--ts-radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--ts-accent-soft);
}

.autocomplete-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.autocomplete-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-name {
    font-weight: 600;
    color: var(--ts-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-meta {
    font-size: 0.75rem;
    color: var(--ts-text-muted);
}

/* Emoji Picker */
.rich-editor-emoji-picker {
    position: absolute;
    z-index: 1000;
    width: 20rem;
    max-height: 24rem;
    overflow-y: auto;
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-md);
    box-shadow: var(--ts-card-shadow);
    backdrop-filter: blur(12px);
}

.rich-editor-emoji-picker.hidden {
    display: none;
}

.emoji-picker-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--ts-bg-surface);
    border-bottom: 1px solid var(--ts-border);
    z-index: 10;
}

.emoji-picker-title {
    font-weight: 600;
    color: var(--ts-text-primary);
}

.emoji-picker-close {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--ts-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--ts-radius-sm);
    transition: all 0.2s ease;
}

.emoji-picker-close:hover {
    background: var(--ts-accent-soft);
    color: var(--ts-text-primary);
}

.emoji-category {
    padding: 0.75rem;
}

.emoji-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ts-text-muted);
    margin-bottom: 0.5rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-item {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--ts-radius-sm);
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-item:hover {
    background: var(--ts-accent-soft);
    border-color: var(--ts-accent);
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(0.95);
}

/* Responsive Design for Rich Editor */
@media (max-width: 640px) {
    .formatting-toolbar {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .formatting-toolbar-hint {
        display: none;
    }

    .formatting-btn {
        width: 1.75rem;
        height: 1.75rem;
    }

    .rich-editor-emoji-picker {
        width: calc(100vw - 2rem);
        max-width: 20rem;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Character Counter Enhancement */
#post-char-count.warning {
    color: var(--ts-warning);
    font-weight: 600;
}

#post-char-count.danger {
    color: var(--ts-danger);
    font-weight: 700;
}

/* Scrollbar Styling for Autocomplete and Emoji Picker */
.rich-editor-autocomplete::-webkit-scrollbar,
.rich-editor-emoji-picker::-webkit-scrollbar {
    width: 0.5rem;
}

.rich-editor-autocomplete::-webkit-scrollbar-track,
.rich-editor-emoji-picker::-webkit-scrollbar-track {
    background: transparent;
}

.rich-editor-autocomplete::-webkit-scrollbar-thumb,
.rich-editor-emoji-picker::-webkit-scrollbar-thumb {
    background: var(--ts-border-strong);
    border-radius: var(--ts-radius-full);
}

.rich-editor-autocomplete::-webkit-scrollbar-thumb:hover,
.rich-editor-emoji-picker::-webkit-scrollbar-thumb:hover {
    background: var(--ts-accent);
}

/* Notification Panel Styles */
.notification-panel {
    position: fixed;
    top: 4rem;
    right: 1rem;
    width: 24rem;
    max-width: calc(100vw - 2rem);
    max-height: 32rem;
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(20, 184, 166, 0.1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    animation: slideInFromRight 0.2s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[data-theme='light'] .notification-panel {
    background: #ffffff;
    border-color: var(--ts-border-strong);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(20, 184, 166, 0.2);
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ts-border);
    background: var(--ts-bg-surface);
    border-radius: var(--ts-radius-lg) var(--ts-radius-lg) 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

[data-theme='light'] .notification-panel-header {
    background: #ffffff;
    border-bottom-color: var(--ts-border-strong);
}

.notification-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    transition: background 0.15s ease;
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    background: rgba(20, 184, 166, 0.05);
}

[data-theme='light'] .notification-item {
    border-bottom-color: rgba(71, 85, 105, 0.15);
}

[data-theme='light'] .notification-item:hover {
    background: rgba(20, 184, 166, 0.08);
}

.notification-item.unread {
    background: rgba(20, 184, 166, 0.08);
    border-left: 3px solid var(--ts-accent);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 1.5rem;
    width: 8px;
    height: 8px;
    background: var(--ts-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

[data-theme='light'] .notification-item.unread {
    background: rgba(20, 184, 166, 0.1);
    border-left-color: var(--ts-accent);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--ts-border);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ts-text-primary);
    margin-bottom: 0.25rem;
}

.notification-message strong {
    font-weight: 600;
    color: var(--ts-heading);
}

[data-theme='light'] .notification-message {
    color: #1e293b;
}

[data-theme='light'] .notification-message strong {
    color: #0f172a;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--ts-text-muted);
}

.notification-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.8;
}

/* Notification type colors */
.notification-item[data-type="vote"] .notification-icon {
    color: #3b82f6;
}

.notification-item[data-type="comment"] .notification-icon {
    color: #10b981;
}

.notification-item[data-type="follow"] .notification-icon {
    color: #8b5cf6;
}

.notification-item[data-type="mention"] .notification-icon {
    color: #f59e0b;
}

.notification-item[data-type="milestone"] .notification-icon {
    color: #eab308;
}

.notification-item[data-type="repost"] .notification-icon {
    color: #06b6d4;
}

.notification-item[data-type="quote"] .notification-icon {
    color: #ec4899;
}

/* Notification badge on bell icon */
#notification-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 0 0.375rem;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Mobile notification panel */
@media (max-width: 768px) {
    .notification-panel {
        top: 4rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 6rem);
    }

    .notification-item {
        padding: 0.875rem 1rem;
    }

    .notification-avatar {
        width: 36px;
        height: 36px;
    }
}

/* Share & Repost Viral Features Styles */
.share-btn,
.repost-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover,
.repost-btn:hover {
    background: rgba(20, 184, 166, 0.1);
}

/* Share Menu Dropdown */
.share-menu {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(20, 184, 166, 0.15);
    backdrop-filter: blur(12px);
}

[data-theme='light'] .share-menu {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(20, 184, 166, 0.2);
}

.share-option {
    transition: all 0.15s ease;
}

.share-option:hover {
    background: var(--ts-accent-soft) !important;
    color: var(--ts-accent);
}

[data-theme='light'] .share-option {
    color: #1e293b;
}

[data-theme='light'] .share-option:hover {
    color: var(--ts-accent-hover);
}

/* Repost Attribution */
.repost-attribution {
    opacity: 0.9;
}

/* Quoted Post Embed */
.quoted-post-embed {
    transition: all 0.2s ease;
}

.quoted-post-embed:hover {
    border-left-color: var(--ts-accent);
    background: rgba(20, 184, 166, 0.05);
}

[data-theme='light'] .quoted-post-embed {
    background: #f8fafc;
    border-color: rgba(20, 184, 166, 0.4);
}

[data-theme='light'] .quoted-post-embed:hover {
    background: rgba(20, 184, 166, 0.08);
    border-left-color: var(--ts-accent-hover);
}

/* Active/reposted state */
.repost-btn.reposted {
    color: var(--ts-accent);
    background: var(--ts-accent-soft);
}

/* Mobile optimizations for share/repost buttons */
@media (max-width: 768px) {
    .share-btn,
    .repost-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .share-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }

    .share-option {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }
}

/* Quote Modal Enhancements */
#quote-modal .ts-card {
    animation: slideInQuote 0.2s ease-out;
}

@keyframes slideInQuote {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   USER PROFILES V2 STYLES
   ======================================== */

/* Cover Photo Styles */
.profile-cover {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
    border-radius: var(--ts-radius-lg) var(--ts-radius-lg) 0 0;
}

@media (min-width: 768px) {
    .profile-cover {
        height: 280px;
    }
}

.profile-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.profile-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.4) 80%,
        rgba(0, 0, 0, 0.7) 100%
    );
    pointer-events: none;
}

/* Enhanced Profile Header */
.profile-header-enhanced {
    position: relative;
    margin-top: -60px;
    padding: 0 1.5rem 1.5rem;
    z-index: 10;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--ts-bg-base);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

@media (min-width: 768px) {
    .profile-avatar-large {
        width: 140px;
        height: 140px;
        border-width: 5px;
    }
}

.profile-info-section {
    flex: 1;
    min-width: 0;
}

.profile-stats-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ts-border);
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ts-text-muted);
    font-weight: 600;
}

.profile-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ts-text-primary);
}

[data-theme='light'] .profile-stat-value {
    color: #0f172a;
}

/* Profile Social Links */
.profile-social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.profile-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    color: var(--ts-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.profile-social-link:hover {
    background: var(--ts-accent-soft);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

[data-theme='light'] .profile-social-link {
    background: #f8fafc;
    color: #1e293b;
}

[data-theme='light'] .profile-social-link:hover {
    background: var(--ts-accent-soft);
    color: var(--ts-accent-hover);
}

.profile-social-link svg {
    width: 1rem;
    height: 1rem;
}

/* Pinned Posts Section */
.pinned-posts-section {
    background: rgba(20, 184, 166, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: var(--ts-radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

[data-theme='light'] .pinned-posts-section {
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.3);
}

.pinned-posts-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--ts-accent);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pinned-post-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: var(--ts-radius-full);
    color: var(--ts-accent);
    font-size: 0.75rem;
    font-weight: 600;
}

[data-theme='light'] .pinned-post-indicator {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.4);
    color: var(--ts-accent-hover);
}

/* Profile Analytics Section */
.profile-analytics {
    background: var(--ts-bg-surface);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.profile-analytics-item {
    text-align: center;
    padding: 1rem;
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
}

[data-theme='light'] .profile-analytics-item {
    background: #f8fafc;
}

.profile-analytics-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ts-accent);
    margin-bottom: 0.25rem;
}

.profile-analytics-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ts-text-muted);
    font-weight: 600;
}

/* Profile Tabs Enhanced */
.profile-tabs-container {
    position: sticky;
    top: 64px;
    z-index: 15;
    background: var(--ts-bg-base);
    border-bottom: 1px solid var(--ts-border);
    margin-bottom: 1.5rem;
}

[data-theme='light'] .profile-tabs-container {
    background: #ffffff;
    border-bottom-color: var(--ts-border-strong);
}

.profile-tab-btn {
    position: relative;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ts-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.profile-tab-btn:hover {
    color: var(--ts-text-primary);
    background: var(--ts-accent-soft);
}

.profile-tab-btn.active {
    color: var(--ts-accent);
    border-bottom-color: var(--ts-accent);
    font-weight: 600;
}

[data-theme='light'] .profile-tab-btn {
    color: #64748b;
}

[data-theme='light'] .profile-tab-btn:hover {
    color: #0f172a;
}

[data-theme='light'] .profile-tab-btn.active {
    color: var(--ts-accent);
    font-weight: 700;
}

/* Profile Action Buttons */
.profile-action-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.profile-btn-follow,
.profile-btn-message,
.profile-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--ts-radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.profile-btn-follow {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.profile-btn-follow:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.profile-btn-message {
    background: var(--ts-bg-surface-soft);
    border-color: var(--ts-border-strong);
    color: var(--ts-text-primary);
}

.profile-btn-message:hover {
    background: var(--ts-accent-soft);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

.profile-btn-edit {
    background: var(--ts-bg-surface-soft);
    border-color: var(--ts-border-strong);
    color: var(--ts-text-primary);
}

.profile-btn-edit:hover {
    background: var(--ts-accent-soft);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

/* Profile Join Date */
.profile-join-date {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ts-text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.profile-join-date svg {
    width: 1rem;
    height: 1rem;
}

/* Profile Location */
.profile-location {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ts-text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.profile-location svg {
    width: 1rem;
    height: 1rem;
}

/* Profile Website */
.profile-website {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ts-link);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.profile-website:hover {
    color: var(--ts-link-hover);
    text-decoration: underline;
}

.profile-website svg {
    width: 1rem;
    height: 1rem;
}

/* Mobile Responsive - Profile */
@media (max-width: 768px) {
    .profile-header-enhanced {
        margin-top: -40px;
        padding: 0 1rem 1rem;
    }

    .profile-avatar-large {
        width: 90px;
        height: 90px;
        border-width: 3px;
    }

    .profile-cover {
        height: 160px;
    }

    .profile-stats-bar {
        gap: 1rem;
    }

    .profile-stat-value {
        font-size: 1.125rem;
    }

    .profile-tab-btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .profile-action-btns {
        flex-direction: column;
    }

    .profile-btn-follow,
    .profile-btn-message,
    .profile-btn-edit {
        width: 100%;
        justify-content: center;
    }

    .profile-analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-social-links {
        justify-content: center;
    }
}

/* ==================== ADVANCED SEARCH STYLES ==================== */

/* Search Highlight */
.search-highlight,
mark.search-highlight {
    background-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

[data-theme='light'] .search-highlight,
[data-theme='light'] mark.search-highlight {
    background-color: rgba(251, 191, 36, 0.2);
    color: #d97706;
}

/* Search Filter Buttons (All, Posts, Users) */
.search-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    background-color: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-filter-btn:hover {
    color: #fff;
    background-color: rgba(75, 85, 99, 0.5);
}

.search-filter-btn.active {
    color: #14b8a6;
    background-color: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
}

[data-theme='light'] .search-filter-btn {
    color: #6b7280;
}

[data-theme='light'] .search-filter-btn:hover {
    color: #111827;
    background-color: rgba(243, 244, 246, 0.8);
}

[data-theme='light'] .search-filter-btn.active {
    color: #0d9488;
    background-color: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.25);
}

/* Saved Search Chips */
.saved-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 9999px;
    background-color: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.saved-search-chip:hover {
    background-color: rgba(55, 65, 81, 0.9);
    border-color: rgba(107, 114, 128, 0.6);
    transform: translateY(-1px);
}

.saved-search-chip svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

[data-theme='light'] .saved-search-chip {
    background-color: rgba(243, 244, 246, 0.9);
    border-color: rgba(209, 213, 219, 0.8);
    color: #374151;
}

[data-theme='light'] .saved-search-chip:hover {
    background-color: rgba(229, 231, 235, 1);
    border-color: rgba(156, 163, 175, 0.8);
}

/* Search Skeleton Loader */
.search-skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Search History & Suggestions Dropdowns */
#search-history-dropdown,
#search-suggestions-dropdown {
    max-height: 400px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Search History Item */
.search-history-item {
    transition: background-color 0.15s ease;
}

.search-history-item:hover {
    background-color: rgba(55, 65, 81, 0.6);
}

[data-theme='light'] .search-history-item:hover {
    background-color: rgba(243, 244, 246, 0.8);
}

/* Search Suggestion Item */
.suggestion-item {
    transition: background-color 0.15s ease;
}

.suggestion-item:hover {
    background-color: rgba(55, 65, 81, 0.6);
}

[data-theme='light'] .suggestion-item:hover {
    background-color: rgba(243, 244, 246, 0.8);
}

/* Search Result Count */
#search-result-count {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

[data-theme='light'] #search-result-count {
    color: #6b7280;
    border-bottom-color: rgba(229, 231, 235, 0.8);
}

/* Advanced Filters Panel */
#advanced-filters {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Trust Level Badges in Search Results */
.trust-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.trust-badge-newcomer {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.trust-badge-member {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.trust-badge-veteran {
    background-color: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.trust-badge-trusted {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Search Input Focus State */
#search-input:focus {
    outline: none;
    border-color: var(--ts-accent);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Scrollbar Styling for Dropdowns */
#search-history-dropdown::-webkit-scrollbar,
#search-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

#search-history-dropdown::-webkit-scrollbar-track,
#search-suggestions-dropdown::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.4);
    border-radius: 3px;
}

#search-history-dropdown::-webkit-scrollbar-thumb,
#search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.6);
    border-radius: 3px;
}

#search-history-dropdown::-webkit-scrollbar-thumb:hover,
#search-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

[data-theme='light'] #search-history-dropdown::-webkit-scrollbar-track,
[data-theme='light'] #search-suggestions-dropdown::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.6);
}

[data-theme='light'] #search-history-dropdown::-webkit-scrollbar-thumb,
[data-theme='light'] #search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: rgba(209, 213, 219, 0.8);
}

[data-theme='light'] #search-history-dropdown::-webkit-scrollbar-thumb:hover,
[data-theme='light'] #search-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 1);
}

/* Mobile Responsive - Search */
@media (max-width: 768px) {
    #search-history-dropdown,
    #search-suggestions-dropdown {
        max-height: 300px;
    }

    .search-filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .saved-search-chip {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }

    #advanced-filters {
        margin-top: 0.5rem;
    }
}

/* ===========================
   COMMUNITIES V2 - ENHANCED STYLES
   =========================== */

/* Community Banner */
.community-banner {
    position: relative;
    overflow: hidden;
}

.community-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

/* Community Header */
.community-header {
    background: var(--ts-bg-surface);
}

.community-header img {
    border: 4px solid var(--ts-bg-base);
}

/* Category Filter Buttons */
.category-filter-btn {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-filter-btn.active {
    background: var(--ts-accent);
    color: white;
    border-color: var(--ts-accent);
}

.category-filter-btn:hover {
    border-color: var(--ts-accent);
    transform: translateY(-1px);
}

/* Community Cards */
.community-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.community-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--ts-accent), var(--ts-gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.community-card:hover::before {
    opacity: 1;
}

.community-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ts-card-shadow), 0 4px 16px rgba(20, 184, 166, 0.15);
}

.community-card img {
    transition: transform 0.3s ease;
}

.community-card:hover img {
    transform: scale(1.05);
}

/* Pinned Posts */
.pinned-post {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(20, 184, 166, 0.05) 0%,
        rgba(20, 184, 166, 0.02) 100%
    );
    border-color: var(--ts-accent) !important;
    animation: pinned-glow 2s ease-in-out infinite alternate;
}

@keyframes pinned-glow {
    0% {
        box-shadow: 0 0 5px rgba(20, 184, 166, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.5);
    }
}

.pinned-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--ts-accent), var(--ts-gold), var(--ts-accent));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Featured/Trending Badges */
.featured-communities .community-card,
.trending-communities .community-card {
    border-left: 3px solid transparent;
}

.featured-communities .community-card {
    border-left-color: var(--ts-gold);
}

.trending-communities .community-card {
    border-left-color: var(--ts-accent);
}

/* Category Badge Styles */
.community-card [class*='bg-gray-700'] {
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
}

/* Community Settings Modal */
#banner-upload,
#icon-upload,
#category-select,
#primary-color {
    background: var(--ts-bg-surface-soft);
    border: 1px solid var(--ts-border);
    color: var(--ts-text-primary);
}

#primary-color {
    border-radius: var(--ts-radius-sm);
    cursor: pointer;
}

#primary-color:hover {
    border-color: var(--ts-accent);
}

/* Light Theme Adjustments */
[data-theme='light'] .community-banner::after {
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
}

[data-theme='light'] .community-header {
    background: var(--ts-bg-surface);
}

[data-theme='light'] .pinned-post {
    background: linear-gradient(
        135deg,
        rgba(20, 184, 166, 0.08) 0%,
        rgba(20, 184, 166, 0.03) 100%
    );
}

[data-theme='light'] .community-card [class*='bg-gray-700'] {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .community-banner {
        height: 120px !important;
    }

    .community-header img,
    .community-header div[class*='w-24'] {
        width: 64px !important;
        height: 64px !important;
        font-size: 2rem !important;
    }

    .category-filter-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .community-card {
        padding: 1rem !important;
    }

    .community-card img {
        width: 48px !important;
        height: 48px !important;
    }

    .community-card h3 {
        font-size: 1rem !important;
    }
}

/* Line Clamp Utility (for description truncation) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
