* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--accent-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* Page Layout */
.page-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
    padding: 2rem;
}

/* Background Glows */
.glow-top {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(255, 85, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.glow-bottom {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(255, 85, 0, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-layout {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 2rem;
}

/* ========================================
   Mobile Filter Bar
   ======================================== */

.mobile-filter-bar {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.filter-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-trigger:hover {
    border-color: var(--accent-primary);
}

.filter-trigger svg {
    color: var(--accent-primary);
}

.filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    background: rgba(255, 85, 0, 0.1);
    border: 1px solid rgba(255, 85, 0, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ========================================
   Filter Sheet (Mobile Bottom Sheet)
   ======================================== */

.sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
}

.sheet-backdrop.open {
    display: block;
    opacity: 1;
}

.filter-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 0 20px 32px;
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
}

.filter-sheet.open {
    display: block;
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-primary);
    border-radius: 2px;
    margin: 12px auto 16px;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sheet-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sheet-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.sheet-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sheet-section {
    margin-bottom: 24px;
}

.sheet-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.sheet-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sheet-pill {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 20px;
    padding: 10px 18px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.sheet-pill:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.sheet-pill.active {
    background: rgba(255, 85, 0, 0.12);
    border-color: rgba(255, 85, 0, 0.4);
    color: var(--accent-primary);
}

/* ========================================
   Mobile FAB Button
   ======================================== */

.fab-btn {
    display: none;
    position: fixed;
    bottom: 84px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 6px 24px rgba(255, 85, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 85, 0, 0.5);
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 85, 0, 0.35);
}

.sidebar-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-secondary);
}

.sidebar-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-option {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-option svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.sidebar-option:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-option:hover svg {
    color: var(--accent-primary);
}

.sidebar-option.active {
    color: var(--accent-primary);
    background: var(--accent-subtle);
}

.sidebar-option.active svg {
    color: var(--accent-primary);
}

/* Author Avatar in Sidebar */
.author-avatar-small {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
}

.author-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Posts Layout */
.posts-container {
    flex: 1;
    min-width: 0;
}

.feed-header {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 28px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

/* ========================================
   Post Card - New Design
   ======================================== */

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s;
}

.post-card:hover {
    border-color: rgba(255, 85, 0, 0.3);
}

/* Post Header */
.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(255, 85, 0, 0.35);
    overflow: hidden;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-user-info {
    display: flex;
    flex-direction: column;
}

.post-username {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.post-date {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.post-badge {
    background: rgba(255, 85, 0, 0.12);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 85, 0, 0.25);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Post Options Menu */
.post-options {
    position: relative;
}

.options-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.options-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.post-options.open .options-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.option-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.option-item.option-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Post Divider */
.post-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-secondary) 30%, var(--border-secondary) 70%, transparent);
    margin: 16px 0;
}

/* Post Title */
.post-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.3px;
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
}

/* Post Body */
.post-body {
    margin-left: 15px;
}

.post-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 4px 0;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    letter-spacing: 0.3px;
    transition: color var(--transition-fast);
}

.read-more-btn:hover {
    color: var(--accent-hover);
}

/* Action Bar */
.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-secondary);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.action-btn.liked {
    color: #e8524a;
    background: rgba(232, 82, 74, 0.08);
    border-color: rgba(232, 82, 74, 0.25);
}

.action-btn.liked svg {
    fill: #e8524a;
}

.action-btn.active {
    color: #5b9bd5;
    background: rgba(91, 155, 213, 0.08);
    border-color: rgba(91, 155, 213, 0.25);
}

.action-count {
    font-weight: 600;
}

.view-btn {
    margin-left: auto;
}

/* ========================================
   Comments Section
   ======================================== */

.comments-section {
    margin-top: 6px;
}

.comments-divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 14px 0;
}

/* Comment Input */
.login-to-comment {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 12px;
}

.login-to-comment a {
    color: var(--accent-primary);
    font-weight: 600;
}

.login-to-comment a:hover {
    text-decoration: underline;
}

.comment-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.comment-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-input::placeholder {
    color: var(--text-muted);
}

.comment-input:focus {
    border-color: var(--accent-primary);
}

.comment-send-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(255, 85, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.4);
}

/* Comment List */
.comment-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
}

.comment-content {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-secondary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-user {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.comment-time {
    color: var(--text-muted);
    font-size: 11px;
}

.comment-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 8px;
}

.comment-item:hover .comment-actions {
    opacity: 1;
}

.comment-edit-btn,
.comment-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-edit-btn:hover {
    color: var(--accent-primary);
    background: rgba(255, 85, 0, 0.1);
}

.comment-delete-btn:hover {
    color: #e8524a;
    background: rgba(232, 82, 74, 0.1);
}

/* Comment Edit Mode */
.comment-edit-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.comment-edit-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.comment-edit-input:focus {
    border-color: var(--accent-primary);
}

.comment-save-btn,
.comment-cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-save-btn {
    background: var(--accent-primary);
    color: white;
}

.comment-save-btn:hover {
    background: var(--accent-hover);
}

.comment-cancel-btn {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.comment-cancel-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 960px) {
    .page-wrapper {
        padding: 1.5rem;
    }

    .page-layout {
        gap: 1.5rem;
    }

    .sidebar {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
    }

    .page-layout {
        flex-direction: column;
        gap: 1rem;
    }

    /* Hide desktop sidebar */
    .sidebar {
        display: none;
    }

    /* Show mobile filter bar */
    .mobile-filter-bar {
        display: flex;
    }

    /* Show filter sheet elements */
    .filter-sheet {
        display: block;
    }

    /* Show FAB button */
    .fab-btn {
        display: flex;
    }

    .feed-header {
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-title::before {
        height: 24px;
    }

    .posts-grid {
        gap: 1rem;
    }

    .post-card {
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .page-title::before {
        height: 20px;
        width: 3px;
    }

    .post-card {
        padding: 16px;
    }

    .post-avatar {
        width: 38px;
        height: 38px;
    }

    .post-title {
        font-size: 17px;
    }

    .post-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        padding: 7px 12px;
    }

    .fab-btn {
        bottom: 80px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}
