/* ============================================
   OTAKIROKU - FORUM PAGE STYLES
   Modern Discord/Notion-Inspired Redesign
   ============================================ */

/* === PAGE BACKGROUND EFFECT === */
.forum-layout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(var(--primary-rgb), 0.12), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* === MAIN LAYOUT === */
.forum-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 24px 60px;
    min-height: 100vh;
    position: relative;
}

/* === SIDEBAR === */
.forum-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Create Thread Button - Hero style */
.btn-create-thread {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.25);
}

.btn-create-thread:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.35);
}

.btn-create-thread svg {
    width: 18px;
    height: 18px;
}

/* Search - Compact style */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-search:focus-within {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.sidebar-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.sidebar-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

/* === SIDEBAR NAVIGATION === */
.sidebar-nav {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
}

.sidebar-nav .nav-section {
    margin-bottom: 16px;
}

.sidebar-nav .nav-section:last-child {
    margin-bottom: 0;
}

.sidebar-nav .nav-section h4 {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 8px 10px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-nav .nav-item:hover svg,
.sidebar-nav .nav-item.active svg {
    opacity: 1;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat-color, var(--primary));
    flex-shrink: 0;
}

/* === PERIOD FILTER PILLS === */
.period-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 20px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Desktop: Hide period-filters in sidebar, show the one in main content */
@media (min-width: 1001px) {
    /* Hide period filters in sidebar on desktop */
    .sidebar-nav .period-filters {
        display: none !important;
    }

    /* Show desktop period filters in main content when not hidden by JS */
    .period-filters.desktop-only:not([style*="display: none"]) {
        display: flex !important;
        margin-bottom: 24px;
    }
}

/* Hide desktop period filters on mobile/tablet */
@media (max-width: 1000px) {
    .period-filters.desktop-only {
        display: none !important;
    }
}

.period-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.3);
}

/* === MAIN CONTENT === */
.forum-main {
    min-width: 0;
}

/* === PINNED THREADS === */
.pinned-section {
    margin-bottom: 24px;
}

.pinned-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* === THREADS LIST === */
.threads-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner,
.empty-state,
.error-state {
    padding: 80px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state.small {
    padding: 48px 20px;
}

/* === THREAD CARD === */
.thread-card {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thread-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--primary-rgb), 0.3);
}

/* Blocked thread card */
.thread-card.thread-blocked {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    cursor: pointer;
}

.thread-card.thread-blocked:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.thread-avatar.blocked-avatar {
    background: rgba(239, 68, 68, 0.15);
}

.thread-avatar.blocked-avatar svg {
    width: 22px;
    height: 22px;
    color: rgba(248, 113, 113, 0.7);
}

.blocked-label {
    color: rgba(248, 113, 113, 0.8);
    font-size: 0.8125rem;
    font-weight: 500;
}

.thread-blocked-message {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 8px 0;
}

/* Thread Avatar */
.thread-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    align-self: stretch;
}

.thread-avatar-wrap .pin-icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
    margin-top: auto;
    margin-bottom: auto;
}

.thread-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thread-avatar svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    opacity: 0.5;
}

.thread-card-main {
    flex: 1;
    min-width: 0;
}

.thread-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.author-name:hover {
    color: var(--primary);
}

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

.thread-card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-card-title .lock-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}


.thread-card-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === CATEGORY TAG === */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--tag-color) 15%, transparent);
    color: var(--tag-color);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .category-tag {
        background: rgba(var(--primary-rgb), 0.12);
    }
}

/* === THREAD STATS === */
.thread-card-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    min-width: 80px;
}

.thread-card-stats .stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.thread-card-stats .stat svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.thread-card-stats .stat.score {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.thread-card-stats .stat.score.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.thread-card-stats .stat.score.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.btn-thread-pin {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 2;
    opacity: 0.5;
}

.btn-thread-pin:hover {
    opacity: 1;
    color: var(--primary);
}

.btn-thread-pin.active {
    color: var(--primary);
    opacity: 0.8;
}

.btn-thread-pin svg {
    width: 14px;
    height: 14px;
}

/* === THREAD DETAIL VIEW === */
.thread-detail {
    animation: fadeIn 0.4s ease;
}

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

/* === BREADCRUMB === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: var(--text-muted);
}

/* === VOTING UI === */
.vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.vote-btn.upvote:hover,
.vote-btn.upvote.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.vote-btn.downvote:hover,
.vote-btn.downvote.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

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

.vote-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    min-width: 36px;
    padding: 4px 0;
}

.vote-score.positive {
    color: #10b981;
}

.vote-score.negative {
    color: #ef4444;
}

/* === ORIGINAL POST === */
.thread-post {
    display: flex;
    gap: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
}

.op-vote-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.op-main {
    flex: 1;
    min-width: 0;
}

.op-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.op-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.op-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(var(--primary-rgb), 0.2);
}

.op-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.op-avatar svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
    opacity: 0.6;
}

.op-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.op-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.op-username {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.op-username:hover {
    color: var(--primary);
}

.op-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.op-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-locked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.op-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 24px;
    line-height: 1.3;
}

.op-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.op-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 16px;
}

.op-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.op-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.op-stats svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.op-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-action-danger:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* === POSTS/REPLIES === */
.posts-section {
    margin-bottom: 32px;
}

.posts-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reply-card {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background 0.15s ease;
}

.reply-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Blocked user reply */
.reply-card.reply-blocked {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.reply-blocked-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.reply-blocked-content svg {
    width: 18px;
    height: 18px;
    color: #f87171;
    flex-shrink: 0;
}

/* Blocked OP styles - whole container */
.thread-op-blocked {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

.thread-op-blocked .op-avatar.blocked-avatar {
    background: rgba(239, 68, 68, 0.15);
}

.thread-op-blocked .op-avatar.blocked-avatar svg {
    width: 22px;
    height: 22px;
    color: rgba(248, 113, 113, 0.7);
}

.thread-op-blocked .blocked-label {
    color: rgba(248, 113, 113, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.op-blocked-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 12px 0;
}

.thread-op-blocked .op-footer {
    border-top: 1px solid rgba(239, 68, 68, 0.1);
}

.reply-vote-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.reply-vote-sidebar .vote-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
}

.reply-vote-sidebar .vote-btn svg {
    width: 14px;
    height: 14px;
}

.reply-vote-sidebar .vote-score {
    font-size: 0.75rem;
    min-width: 20px;
    text-align: center;
}

.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reply-avatar svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    opacity: 0.5;
}

.reply-main {
    flex: 1;
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.reply-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-user-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.reply-username {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.reply-username:hover {
    color: var(--primary);
}

.reply-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.reply-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.reply-card:hover .reply-actions {
    opacity: 1;
}

.reply-actions .btn-action {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.reply-content {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.875rem;
}

.reply-signature {
    margin-top: 12px;
    padding-top: 8px;
}

.sig-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0 0 6px;
}

.sig-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.sig-text a {
    color: var(--primary);
    text-decoration: underline;
}

.sig-text strong {
    color: var(--text-secondary);
}

.sig-text u {
    text-decoration: underline;
}

/* Edited Badge */
.edited-badge {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8em;
}

/* === REPLY FORM === */
.reply-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
}

.reply-form h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.reply-form textarea {
    width: 100%;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.reply-form textarea::placeholder {
    color: var(--text-muted);
}

.btn-submit-reply {
    margin-top: 16px;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
}

.btn-submit-reply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
}

/* === INLINE REPLY FORM === */
.inline-reply-form {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inline-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inline-reply-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.inline-reply-label strong {
    color: var(--primary);
}

.btn-cancel-inline {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-inline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-cancel-inline svg {
    width: 18px;
    height: 18px;
}

.inline-reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    font-size: 0.9375rem;
    line-height: 1.6;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    resize: vertical;
    transition: all 0.2s ease;
}

.inline-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.inline-reply-form textarea::placeholder {
    color: var(--text-muted);
}

.inline-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.inline-reply-actions .btn-cancel-reply {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-reply-actions .btn-cancel-reply:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.inline-reply-actions .btn-submit-inline {
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-reply-actions .btn-submit-inline:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* === REPLYING TO INDICATOR === */
.replying-to {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.replying-to strong {
    color: var(--primary);
}

.btn-cancel-reply {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-reply:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* === NESTED REPLIES (Reddit/Discord style) === */
.reply-thread {
    position: relative;
    margin-left: 46px;
    padding-left: 16px;
    border-left: 2px solid rgba(var(--primary-rgb), 0.2);
}

.reply-thread:hover {
    border-left-color: rgba(var(--primary-rgb), 0.4);
}

.nested-reply {
    position: relative;
}

.nested-reply .reply-avatar {
    width: 28px;
    height: 28px;
}

.nested-reply .reply-avatar svg {
    width: 14px;
    height: 14px;
}

.nested-reply .reply-vote-sidebar .vote-btn {
    width: 20px;
    height: 20px;
}

.nested-reply .reply-vote-sidebar .vote-btn svg {
    width: 12px;
    height: 12px;
}

.nested-reply .reply-vote-sidebar .vote-score {
    font-size: 0.7rem;
}

.nested-reply .reply-username {
    font-size: 0.8rem;
}

.nested-reply .reply-content {
    font-size: 0.8rem;
}

/* Reply-to indicator for nested replies */
.reply-to-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.reply-to-indicator svg {
    width: 12px;
    height: 12px;
    transform: scaleX(-1);
    opacity: 0.6;
}

.reply-to-indicator a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.reply-to-indicator a:hover {
    text-decoration: underline;
}

/* Deep nesting levels */
.reply-thread .reply-thread {
    margin-left: 28px;
    border-left-color: rgba(var(--primary-rgb), 0.15);
}

.reply-thread .reply-thread .reply-thread {
    border-left-color: rgba(var(--primary-rgb), 0.1);
}

/* === ACTION ICON BUTTONS === */
.btn-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-action-icon svg {
    width: 16px;
    height: 16px;
}

.btn-action-icon.btn-reply {
    color: var(--primary);
}

.btn-action-icon.btn-reply:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.btn-action-icon.btn-action-danger {
    color: #ef4444;
}

.btn-action-icon.btn-action-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* === MORE MENU DROPDOWN === */
.more-menu-wrapper {
    position: relative;
}

.btn-more-menu {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-more-menu svg {
    width: 18px;
    height: 18px;
}

.btn-more-menu:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.more-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 140px;
    background: var(--bg-elevated, #1a1a22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.more-menu-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.more-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.more-menu-dropdown button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.more-menu-dropdown button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.more-menu-dropdown button:first-child {
    border-radius: 9px 9px 0 0;
}

.more-menu-dropdown button:last-child {
    border-radius: 0 0 9px 9px;
}

.more-menu-dropdown button:only-child {
    border-radius: 9px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination button {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.3);
}

.pagination .ellipsis {
    color: var(--text-muted);
    padding: 0 8px;
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal:not(.shared-modal) {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(180deg, rgba(30, 30, 46, 0.98) 0%, rgba(18, 18, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.open .modal:not(.shared-modal) {
    transform: scale(1) translateY(0);
}

.modal-header:not(.shared-modal .modal-header) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header:not(.shared-modal .modal-header) h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close:not(.shared-modal .modal-close) {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.modal-close:not(.shared-modal .modal-close):hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.modal-close:not(.shared-modal .modal-close) svg {
    width: 18px;
    height: 18px;
}

.modal-body:not(.shared-modal .modal-body) {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer:not(.shared-modal .modal-footer) {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group select {
    cursor: pointer;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group label .hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* === NEW THREAD MODAL === */
.thread-modal-new {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0f0f15;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .thread-modal-new {
    transform: scale(1) translateY(0);
}

.modal-close-corner {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close-corner:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-close-corner svg {
    width: 20px;
    height: 20px;
}

.thread-modal-content {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.thread-modal-header {
    margin-bottom: 24px;
}

.thread-modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.thread-modal-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.thread-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.char-counter {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.danger {
    color: #ef4444;
}

/* Category Pills - Styled like actual category tags */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: color-mix(in srgb, var(--pill-color, var(--primary)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pill-color, var(--primary)) 25%, transparent);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--pill-color, var(--primary));
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .cat-pill {
        background: rgba(var(--primary-rgb), 0.12);
        border-color: rgba(var(--primary-rgb), 0.25);
    }
}

.cat-pill:hover:not(.disabled) {
    background: color-mix(in srgb, var(--pill-color, var(--primary)) 20%, transparent);
    border-color: color-mix(in srgb, var(--pill-color, var(--primary)) 40%, transparent);
}

.cat-pill.selected {
    background: var(--pill-color, var(--primary));
    border-color: var(--pill-color, var(--primary));
    color: white;
}

.cat-pill.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Form Inputs */
.field-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}

.field-input::placeholder {
    color: var(--text-muted);
}

.field-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
}

.field-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}

.field-textarea::placeholder {
    color: var(--text-muted);
}

/* Modal Footer */
.thread-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-ghost {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-submit {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Legacy checkbox styles (kept for backwards compat) */
.category-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.category-checkbox.selected {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
}

.category-checkbox.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.category-checkbox input[type="checkbox"] {
    display: none;
}

.category-checkbox .cat-check {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.category-checkbox.selected .cat-check {
    background: var(--primary);
    border-color: var(--primary);
}

.category-checkbox .cat-check svg {
    width: 10px;
    height: 10px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.category-checkbox.selected .cat-check svg {
    opacity: 1;
}

.category-checkbox .cat-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.category-checkbox.selected .cat-name {
    color: var(--text-primary);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin-bottom: 4px;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.03);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-cancel {
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.btn-save {
    padding: 12px 22px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
}

.btn-delete {
    padding: 12px 22px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.thread-modal .modal-body textarea {
    min-height: 200px;
}

/* Confirmation Modal */
.confirm-modal {
    max-width: 440px;
}

.confirm-modal .modal-body {
    padding: 32px 28px;
    text-align: center;
}

.confirm-message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.confirm-modal .modal-footer {
    justify-content: center;
    gap: 14px;
}

.confirm-modal .btn-cancel,
.confirm-modal .btn-delete {
    min-width: 110px;
}

/* === RESPONSIVE === */
@media (max-width: 1000px) {
    .forum-layout {
        grid-template-columns: 1fr;
        padding: 100px 20px 60px;
        gap: 24px;
    }

    .forum-sidebar {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .btn-create-thread {
        order: 1;
    }

    .sidebar-search {
        order: 2;
    }

    .sidebar-nav {
        order: 3;
        grid-column: 1 / -1;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav .nav-section {
        display: contents;
    }

    .sidebar-nav .nav-section h4 {
        display: none;
    }

    .sidebar-nav .nav-item {
        flex-shrink: 0;
        padding: 10px 16px;
        white-space: nowrap;
        margin-bottom: 0;
    }

    .thread-card-stats {
        display: none;
    }

    /* Reset period-filters positioning for tablet */
    .sidebar-nav .period-filters {
        position: static;
        width: auto;
        max-width: none;
        left: auto;
        top: auto;
    }

    /* Reset main content padding */
    .forum-main {
        padding-top: 0;
    }
}

/* === MOBILE OPTIMIZATIONS (BELOW 768px) === */
@media (max-width: 768px) {
    /* === LAYOUT === */
    .forum-layout {
        grid-template-columns: 1fr;
        padding: 85px 12px 100px;
        gap: 20px;
    }

    /* === SIDEBAR - HIDE ON MOBILE === */
    .forum-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Reset main content padding */
    .forum-main {
        padding-top: 0;
    }

    /* Create Thread Button - Full Width */
    .btn-create-thread {
        width: 100%;
        padding: 14px 18px;
        font-size: 0.9rem;
        min-height: 48px;
        order: 1;
    }

    /* Search - Full Width */
    .sidebar-search {
        padding: 12px 16px;
        order: 2;
        min-height: 48px;
    }

    .sidebar-search input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Navigation - Horizontal Scroll */
    .sidebar-nav {
        order: 3;
        grid-column: 1 / -1;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav .nav-item {
        min-height: 44px;
        padding: 12px 18px;
    }

    /* === THREAD CARDS - COMPACT MOBILE VIEW === */
    .thread-card {
        padding: 16px;
        gap: 12px;
        border-radius: 10px;
    }

    .thread-avatar {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .thread-avatar svg {
        width: 20px;
        height: 20px;
    }

    .thread-card-header {
        gap: 8px;
        margin-bottom: 6px;
    }

    .author-name {
        font-size: 0.8125rem;
    }

    .thread-time {
        font-size: 0.7rem;
    }

    .thread-card-title {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 6px;
        line-height: 1.35;
    }

    .thread-card-preview {
        font-size: 0.875rem;
        line-height: 1.5;
        -webkit-line-clamp: 2;
    }

    .thread-card-stats {
        display: none;
    }

    .category-tag {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    /* === THREAD DETAIL VIEW === */
    .thread-post {
        padding: 20px 16px;
        gap: 16px;
        border-radius: 14px;
        flex-direction: column;
    }

    .op-vote-sidebar {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        order: 2;
    }

    .op-main {
        order: 1;
    }

    .op-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .op-avatar {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .op-username {
        font-size: 0.9375rem;
    }

    .op-title {
        font-size: 1.5rem;
        margin-bottom: 16px;
        line-height: 1.25;
    }

    .op-content {
        font-size: 0.9375rem;
        line-height: 1.7;
    }

    .op-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 20px;
        padding-top: 16px;
    }

    .op-stats {
        flex-wrap: wrap;
        gap: 16px;
        font-size: 0.85rem;
    }

    .op-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* === REPLIES - COMPACT WITH REDUCED INDENT === */
    .reply-card {
        padding: 12px 8px;
        gap: 8px;
    }

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

    .reply-avatar svg {
        width: 16px;
        height: 16px;
    }

    .reply-vote-sidebar .vote-btn {
        width: 28px;
        height: 28px;
    }

    .reply-vote-sidebar .vote-btn svg {
        width: 14px;
        height: 14px;
    }

    .reply-username {
        font-size: 0.8125rem;
    }

    .reply-date {
        font-size: 0.7rem;
    }

    .reply-content {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .reply-actions .btn-action {
        padding: 6px 10px;
        font-size: 0.7rem;
        min-height: 32px;
    }

    /* REDUCED INDENT FOR NESTED REPLIES */
    .reply-thread {
        margin-left: 24px;
        padding-left: 12px;
        border-left-width: 2px;
    }

    .reply-thread .reply-thread {
        margin-left: 16px;
        padding-left: 8px;
    }

    .reply-thread .reply-thread .reply-thread {
        margin-left: 12px;
        padding-left: 6px;
    }

    .nested-reply .reply-avatar {
        width: 32px;
        height: 32px;
    }

    .nested-reply .reply-avatar svg {
        width: 14px;
        height: 14px;
    }

    /* === REPLY FORM === */
    .reply-form {
        padding: 16px;
        border-radius: 12px;
    }

    .reply-form h3 {
        font-size: 0.9375rem;
        margin-bottom: 12px;
    }

    .reply-form textarea {
        padding: 14px 16px;
        font-size: 0.875rem;
        min-height: 100px;
    }

    .btn-submit-reply {
        width: 100%;
        min-height: 48px;
        padding: 14px 20px;
        font-size: 0.9375rem;
        margin-top: 12px;
    }

    /* === MODALS - COMPACT CENTERED WITH SLIDE ANIMATION === */
    .modal-overlay {
        padding: 20px;
        align-items: center;
        justify-content: center;
    }

    .modal:not(.shared-modal) {
        width: 100%;
        max-width: 300px;
        margin: 0;
        border-radius: 12px;
        max-height: 75vh;
        transform: scale(0.95) translateY(20px);
        transition: transform 0.25s ease;
    }

    .modal-overlay.open .modal:not(.shared-modal) {
        transform: scale(1) translateY(0);
    }

    .modal-header:not(.shared-modal .modal-header) {
        padding: 10px 12px;
    }

    .modal-header:not(.shared-modal .modal-header) h3 {
        font-size: 0.85rem;
    }

    .modal-close:not(.shared-modal .modal-close) {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .modal-close:not(.shared-modal .modal-close) svg {
        width: 16px;
        height: 16px;
    }

    .modal-body:not(.shared-modal .modal-body) {
        padding: 10px 12px;
    }

    .modal-footer:not(.shared-modal .modal-footer) {
        padding: 10px 12px;
        gap: 6px;
        flex-direction: column-reverse;
    }

    .modal-footer:not(.shared-modal .modal-footer) .btn-cancel,
    .modal-footer:not(.shared-modal .modal-footer) .btn-save,
    .modal-footer:not(.shared-modal .modal-footer) .btn-delete {
        width: 100%;
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .form-group input[type="text"],
    .form-group textarea,
    .form-group select {
        padding: 8px 10px;
        font-size: 16px; /* Prevent iOS zoom */
        min-height: 36px;
    }

    .form-group textarea {
        min-height: 80px;
    }

    .thread-modal .modal-body textarea {
        min-height: 100px;
    }

    /* === VOTING BUTTONS - TOUCH FRIENDLY === */
    .vote-btn {
        width: 40px;
        height: 40px;
        min-height: 44px;
        border-radius: 8px;
    }

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

    .vote-score {
        font-size: 0.9375rem;
        min-width: 40px;
    }

    /* === MISC ELEMENTS === */
    .breadcrumb {
        font-size: 0.8rem;
        gap: 8px;
        margin-bottom: 20px;
    }

    .period-filters {
        padding: 4px;
        gap: 6px;
        margin: 12px 0 16px;
        /* Reset desktop positioning */
        position: static;
        width: auto;
        max-width: none;
        left: auto;
        top: auto;
    }

    .period-btn {
        padding: 10px 14px;
        font-size: 0.8125rem;
        min-height: 44px;
    }

    /* === BUTTONS - TOUCH TARGETS === */
    .btn-action {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .btn-cancel,
    .btn-save,
    .btn-delete {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 0.9375rem;
    }

    /* Replying-to indicator */
    .replying-to {
        padding: 10px 14px;
        margin-bottom: 12px;
        font-size: 0.85rem;
    }

    .btn-cancel-reply {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-height: 32px;
    }

    /* Pagination */
    .pagination {
        margin-top: 24px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .pagination button {
        min-width: 44px;
        height: 44px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
}

/* === SMALL MOBILE DEVICES (BELOW 600px) === */
@media (max-width: 600px) {
    /* Further reduce padding */
    .forum-layout {
        padding: 80px 12px 100px;
        gap: 16px;
    }

    /* Smaller thread cards */
    .thread-card {
        padding: 14px 12px;
        gap: 10px;
    }

    .thread-avatar {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .thread-card-title {
        font-size: 0.9375rem;
        line-height: 1.3;
    }

    .thread-card-preview {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
    }

    /* Thread detail */
    .thread-post {
        padding: 16px 12px;
    }

    .op-title {
        font-size: 1.375rem;
    }

    .op-content {
        font-size: 0.875rem;
    }

    /* Replies - Maximum indent reduction */
    .reply-card {
        padding: 10px 6px;
    }

    .reply-avatar {
        width: 32px;
        height: 32px;
    }

    .reply-thread {
        margin-left: 20px;
        padding-left: 10px;
    }

    .reply-thread .reply-thread {
        margin-left: 16px;
        padding-left: 8px;
    }

    .reply-thread .reply-thread .reply-thread {
        margin-left: 12px;
        padding-left: 6px;
        border-left-width: 1px;
    }

    .nested-reply .reply-avatar {
        width: 28px;
        height: 28px;
    }

    /* Sidebar - Single column */
    .forum-sidebar {
        grid-template-columns: 1fr;
    }

    /* Period filters - Smaller */
    .period-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    /* Modal adjustments */
    .modal:not(.shared-modal) {
        border-radius: 12px 12px 0 0;
    }

    .modal-header:not(.shared-modal .modal-header) h3 {
        font-size: 1rem;
    }

    /* Reply form */
    .reply-form {
        padding: 14px 12px;
    }

    .reply-form textarea {
        padding: 12px 14px;
    }
}

/* === EXTRA SMALL DEVICES (BELOW 480px) === */
@media (max-width: 480px) {
    /* Compact everything */
    .forum-layout {
        padding: 75px 10px 100px;
        gap: 14px;
    }

    /* Thread cards - Very compact */
    .thread-card {
        padding: 12px 10px;
        gap: 8px;
    }

    .thread-avatar {
        width: 34px;
        height: 34px;
    }

    .thread-avatar svg {
        width: 16px;
        height: 16px;
    }

    .thread-card-title {
        font-size: 0.875rem;
    }

    .thread-card-preview {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .author-name {
        font-size: 0.75rem;
    }

    /* Thread detail - Compact */
    .thread-post {
        padding: 14px 10px;
        gap: 14px;
    }

    .op-user {
        flex-wrap: wrap;
        gap: 8px;
    }

    .op-avatar {
        width: 44px;
        height: 44px;
    }

    .op-username {
        font-size: 0.875rem;
    }

    .op-title {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .op-content {
        font-size: 0.8125rem;
        line-height: 1.6;
    }

    /* Replies - Minimal indent */
    .reply-card {
        padding: 10px 8px;
        gap: 6px;
    }

    .reply-avatar {
        width: 30px;
        height: 30px;
    }

    .reply-content {
        font-size: 0.8125rem;
    }

    .reply-thread {
        margin-left: 16px;
        padding-left: 8px;
    }

    .reply-thread .reply-thread {
        margin-left: 12px;
        padding-left: 6px;
    }

    .reply-thread .reply-thread .reply-thread {
        margin-left: 8px;
        padding-left: 4px;
    }

    .nested-reply .reply-avatar {
        width: 26px;
        height: 26px;
    }

    /* Vote buttons - Minimum touch size */
    .vote-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

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

    /* All interactive buttons - 44px minimum */
    .btn-action,
    .btn-save,
    .btn-cancel,
    .btn-submit-reply,
    .btn-create-thread,
    .period-btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    .btn-create-thread {
        font-size: 0.875rem;
    }

    /* Period filters */
    .period-btn {
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    /* Prevent iOS zoom */
    .sidebar-search input,
    .form-group input[type="text"],
    .form-group textarea,
    .form-group select,
    .reply-form textarea {
        font-size: 16px;
    }

    /* Modal - Full screen */
    .modal:not(.shared-modal) {
        max-height: 95vh;
    }

    .modal-header:not(.shared-modal .modal-header),
    .modal-body:not(.shared-modal .modal-body),
    .modal-footer:not(.shared-modal .modal-footer) {
        padding: 14px 12px;
    }
}

/* Highlight post when scrolled to */
.highlight-post {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0%, 50% {
        box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.5);
    }
    100% {
        box-shadow: none;
    }
}

/* === SEARCH HIGHLIGHT === */
.search-highlight {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.btn-clear-search {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.btn-clear-search:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* === SKELETON LOADING === */
.skeleton-card {
    pointer-events: none;
}

.skeleton-avatar {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
    display: block;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* === POLL CREATION FORM === */
.poll-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 6px;
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.poll-toggle-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: rgba(var(--primary-rgb), 0.4);
}

.poll-toggle-btn.active {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.poll-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poll-option-input {
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
}

.poll-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.poll-add-option-btn {
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.poll-add-option-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.poll-multi-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
}

.poll-multi-toggle input[type="checkbox"] {
    accent-color: var(--primary);
}

.poll-duration-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: inherit;
    padding: 4px 24px 4px 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.poll-duration-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}

.poll-duration-select option {
    background: #1a1a22;
    color: var(--text-secondary);
}

.poll-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.72rem;
    cursor: pointer;
    margin-left: auto;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.poll-remove-btn:hover {
    opacity: 1;
}

/* === POLL DISPLAY (Thread View) === */
.thread-poll {
    margin: 16px 0;
    padding: 16px;
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 12px;
}

.poll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.poll-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.poll-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.poll-option:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
}

.poll-option.voted {
    border-color: rgba(var(--primary-rgb), 0.4);
    background: rgba(var(--primary-rgb), 0.08);
}

.poll-option.disabled {
    cursor: default;
    pointer-events: none;
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.poll-option-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.poll-option-check {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.poll-option.multi .poll-option-check {
    border-radius: 4px;
}

.poll-option.voted .poll-option-check {
    border-color: var(--primary);
    background: var(--primary);
}

.poll-option.voted .poll-option-check::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.poll-option.multi.voted .poll-option-check::after {
    border-radius: 1px;
    width: 8px;
    height: 5px;
    background: none;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.poll-option-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.poll-option-pct {
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

.poll-option-votes {
    font-size: 0.68rem;
}

.poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.poll-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.poll-close-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.poll-close-btn:hover {
    opacity: 1;
}

/* === INLINE EDIT FORM === */
.inline-edit-title {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    transition: all 0.2s ease;
}

.inline-edit-title:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.inline-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inline-edit-content {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.inline-edit-content:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-cancel-edit {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-edit:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-save-edit {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-edit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
