/* ==========================================================================
   New Design: Feed Page — Top Nav Layout
   Prefix: .nd- (new design)
   Uses CSS variables from variables.css for full theme support
   ========================================================================== */

/* ---------- Layout Shell ---------- */
.nd-shell {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* ---------- Header Nav Tabs (desktop) ---------- */
.nd-header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1, 0.25rem);
    height: 100%;
    flex: 1;
}

.nd-header-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    color: var(--color-text-secondary, #6b7280);
    text-decoration: none;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    white-space: nowrap;
    position: relative;
    height: 100%;
    border-radius: 0;
    transition: color 0.2s ease, background 0.2s ease;
}

.nd-header-tab i {
    font-size: 1rem;
}

.nd-header-tab:hover {
    color: var(--color-primary-600);
    text-decoration: none;
    background: var(--color-primary-50, rgba(99, 102, 241, 0.05));
}

.nd-header-tab.active {
    color: var(--color-primary-600);
    font-weight: var(--font-weight-semibold, 600);
}

.nd-header-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-3, 0.75rem);
    right: var(--space-3, 0.75rem);
    height: 2.5px;
    background: var(--color-primary-600);
    border-radius: 2px 2px 0 0;
}

/* Header Create Post Button */
.nd-header-create-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    border-radius: var(--radius-full, 9999px);
    font-weight: var(--font-weight-semibold, 600);
    font-size: var(--font-size-sm, 0.875rem);
    background: var(--gradient-primary, linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)));
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    white-space: nowrap;
}

.nd-header-create-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Header logo image */
.nd-header-logo-img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md, 0.375rem);
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------- Mobile Bottom Navigation ---------- */
.nd-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--color-surface, #fff);
    border-top: 1px solid var(--color-border-light, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-fixed, 1030);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-bs-theme="midnight"] .nd-mobile-nav,
[data-bs-theme="carbon"] .nd-mobile-nav,
[data-bs-theme="cyber-glow"] .nd-mobile-nav,
[data-bs-theme="solarized-dark"] .nd-mobile-nav {
    background: rgba(17, 24, 39, 0.95);
    border-top-color: var(--color-border, #374151);
}

.nd-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--color-text-tertiary, #9ca3af);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: var(--font-weight-medium, 500);
    padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
    transition: color 0.2s ease;
}

.nd-mobile-nav-item i {
    font-size: 1.15rem;
}

.nd-mobile-nav-item:hover {
    color: var(--color-primary-600);
    text-decoration: none;
}

.nd-mobile-nav-item.active {
    color: var(--color-primary-600);
    font-weight: var(--font-weight-semibold, 600);
}

/* Hide mobile bottom nav on desktop */
@media (min-width: 992px) {
    .nd-mobile-nav {
        display: none !important;
    }
}

/* ---------- Content Shell ---------- */
.nd-content-shell {
    padding-top: 64px;
    padding-bottom: 60px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* ---------- Main Content Area ---------- */
.nd-main {
    margin-left: auto;
    margin-right: auto;
    padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-6, 1.5rem);
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

/* Single-column override for non-feed pages */
.nd-main:has(.post-detail-wrapper) {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.nd-main:has(.events-page-wrapper),
.nd-main:has(.leaderboard-page-wrapper),
.nd-main:has(.plans-page-wrapper),
.nd-main:has(.member-detail-wrapper),
.nd-main:has(.event-detail-wrapper),
.nd-main:has(.edit-profile-wrapper),
.nd-main:has(.notifications-page-wrapper) {
    grid-template-columns: 1fr;
}
.nd-main:has(.chat-page-wrapper){
    max-width: none;
margin-right: 0;
margin-left: 0      ;

}
/* ---------- Feed Column ---------- */
.nd-feed {
    min-width: 0;
}

/* Post Creator */
.nd-post-creator {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    padding: var(--space-6, 1.5rem);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--space-4, 1rem);
    align-items: flex-start;
    margin-bottom: var(--space-6, 1.5rem);
    border: 1px solid var(--color-border-light, #f3f4f6);
}

.nd-post-creator-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
    flex-shrink: 0;
}

.nd-post-creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nd-post-creator-body {
    flex: 1;
    min-width: 0;
}

.nd-post-creator-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--color-border-light, #e5e7eb);
    padding: var(--space-2, 0.5rem) 0;
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-primary);
    background: transparent;
    outline: none;
}

.nd-post-creator-input::placeholder {
    color: var(--color-text-tertiary, #d1d5db);
}

.nd-post-creator-input:focus {
    border-bottom-color: var(--color-primary-500);
}

.nd-post-creator-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3, 0.75rem);
}

.nd-post-creator-actions {
    display: flex;
    gap: var(--space-2, 0.5rem);
}

.nd-post-creator-actions button {
    padding: var(--space-2, 0.5rem);
    color: var(--color-text-tertiary, #9ca3af);
    background: none;
    border: none;
    border-radius: var(--radius-lg, 0.5rem);
    cursor: pointer;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nd-post-creator-actions button:hover {
    color: var(--color-primary-600);
    background: var(--color-primary-50, #f5f3ff);
}

.nd-post-creator-submit {
    background: var(--color-primary-600) !important;
    color: #fff !important;
    padding: var(--space-2, 0.5rem) var(--space-6, 1.5rem) !important;
    border-radius: var(--radius-full, 9999px) !important;
    font-size: var(--font-size-xs, 0.75rem) !important;
    font-weight: var(--font-weight-bold, 700) !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none !important;
    cursor: pointer;
    transition: var(--transition-all);
}

.nd-post-creator-submit:hover {
    background: var(--color-primary-700) !important;
}

/* ---------- Floating Action Button (Create Post) ---------- */
.nd-fab-create {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    height: 56px;
    border-radius: var(--radius-full, 9999px);
    background: var(--gradient-primary, linear-gradient(135deg, var(--color-primary-500, #6366f1), var(--color-primary-600, #4f46e5)));
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3, 0.75rem);
    padding: 0 var(--space-6, 1.5rem);
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-bold, 700);
    z-index: 1040;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4), 0 8px 10px -6px rgba(79, 70, 229, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nd-fab-icon {
    font-size: 1.25rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nd-fab-label {
    letter-spacing: 0.01em;
}

.nd-fab-create:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 35px -8px rgba(79, 70, 229, 0.45), 0 12px 15px -10px rgba(79, 70, 229, 0.3);
    background: var(--color-surface);
    color: var(--color-text-primary);
    filter: brightness(1.05);
}

.nd-fab-create:hover .nd-fab-icon {
    transform: rotate(90deg);
}

.nd-fab-create:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.1s;
}

@media (prefers-reduced-motion: reduce) {
    .nd-fab-create,
    .nd-fab-icon {
        transition: none;
    }
    .nd-fab-create:hover,
    .nd-fab-create:hover .nd-fab-icon {
        transform: none;
    }
}

/* ---------- Post Creator Modal — Premium Glass Design ---------- */

/* Blurred backdrop */
.nd-post-creator-modal.show ~ .modal-backdrop,
.nd-post-creator-modal + .modal-backdrop {
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    background: rgba(15, 23, 42, 0.4);
}

.nd-post-creator-modal .modal-dialog {
    max-width: 760px;
}

.nd-post-creator-modal .modal-content {
    border: none;
    border-radius: var(--radius-xl, 0.75rem);
    overflow: visible;
    background: var(--color-surface, #fff);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Category dropdown opens upward in the footer */
.nd-modal-footer .category-picker-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

/* Header */
.nd-modal-header {
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
    border-bottom: 1px solid var(--color-border-light, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nd-modal-header-user {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
}

.nd-modal-header-user .nd-modal-avatar,
.nd-modal-header-user img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full, 9999px);
    object-fit: cover;
    border: 2px solid var(--color-primary-100, #e0e7ff);
}

.nd-modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nd-modal-header-info .modal-title {
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.2;
}

.nd-modal-header-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-secondary, #6b7280);
    line-height: 1;
}

.nd-modal-header-name {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

.nd-modal-switch-user {
    color: var(--color-text-tertiary, #9ca3af);
    cursor: pointer;
    font-size: 0.65rem;
    transition: color 0.15s ease;
}

.nd-modal-switch-user:hover {
    color: var(--color-primary-600);
}

.nd-modal-header-dot {
    color: var(--color-text-tertiary, #9ca3af);
}

.nd-modal-header-visibility {
    color: var(--color-text-tertiary, #9ca3af);
}

.nd-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full, 9999px);
    border: none;
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.nd-modal-close:hover {
    background: var(--color-gray-200, #e5e7eb);
    color: var(--color-text-primary);
    transform: rotate(90deg);
}

/* Body */
.nd-modal-body {
    padding: var(--space-5, 1.25rem);
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-light, #e5e7eb) transparent;
}

.nd-modal-body::-webkit-scrollbar {
    width: 4px;
}

.nd-modal-body::-webkit-scrollbar-thumb {
    background: var(--color-border-light, #e5e7eb);
    border-radius: 4px;
}

/* Override post-creator styles inside the modal */
.nd-post-creator-modal .post-creator {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.nd-post-creator-modal .post-creator .fake-input {
    display: none !important;
}

.nd-post-creator-modal .post-creator .expanded-section {
    display: block !important;
}

.nd-post-creator-modal .post-creator .real-editor {
    display: block;
}

.nd-post-creator-modal .post-creator .toolbar {
    display: none !important;
}

.nd-post-creator-modal .post-creator .post-header {
    display: none !important;
}

.nd-post-creator-modal .post-creator .post-access-switches {
    display: none !important;
}

.nd-post-creator-modal .post-creator .post-title-wrapper {
    display: none !important;
}

/* Title input inside modal */
.nd-modal-title-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0 0 var(--space-3, 0.75rem) 0;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-primary);
    background: transparent;
    outline: none;
    transition: border-color 0.2s ease;
    letter-spacing: -0.01em;
}

.nd-modal-title-input::placeholder {
    color: var(--color-text-tertiary, #d1d5db);
    font-weight: var(--font-weight-medium, 500);
}

.nd-modal-title-input:focus {
    border-bottom-color: var(--color-primary-400);
}

/* Editor section */
.nd-modal-editor-section {
    margin-bottom: var(--space-4, 1rem);
}

.nd-modal-editor-section .real-editor {
    min-height: 150px;
}

/* Premium alert */
.nd-modal-premium-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 0.75rem);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-lg, 0.5rem);
    padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    margin-bottom: var(--space-4, 1rem);
}

.nd-modal-premium-alert > i {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-top: 2px;
}

/* Collapsible sections (Poll, Schedule, Premium) */
.nd-modal-poll,
.nd-modal-schedule,
.nd-modal-premium-section {
    background: var(--color-gray-50, #f9fafb);
    border: 1px solid var(--color-border-light, #f3f4f6);
    border-radius: var(--radius-lg, 0.5rem);
    padding: var(--space-4, 1rem);
    margin-bottom: var(--space-4, 1rem);
    animation: ndSectionSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ndSectionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nd-modal-poll,
    .nd-modal-schedule,
    .nd-modal-premium-section {
        animation: none;
    }
}

.nd-modal-poll-header,
.nd-modal-schedule-header,
.nd-modal-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-primary);
}

.nd-modal-section-close {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full, 9999px);
    border: none;
    background: var(--color-gray-200, #e5e7eb);
    color: var(--color-text-secondary, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    transition: background 0.15s ease;
}

.nd-modal-section-close:hover {
    background: var(--color-gray-300, #d1d5db);
}

.nd-modal-poll-question {
    font-size: var(--font-size-sm, 0.875rem);
    border-radius: var(--radius-md, 0.375rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-modal-add-option {
    background: none;
    border: 1px dashed var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 0.375rem);
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-secondary, #6b7280);
    cursor: pointer;
    width: 100%;
    margin-bottom: var(--space-3, 0.75rem);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.nd-modal-add-option:hover {
    border-color: var(--color-primary-400);
    color: var(--color-primary-600);
}

.nd-modal-poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 0.75rem);
}

.nd-modal-schedule-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

/* Premium section */
.nd-modal-premium-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-3, 0.75rem);
    margin-bottom: var(--space-3, 0.75rem);
    border-bottom: 1px solid var(--color-border-light, #e5e7eb);
}

.nd-modal-premium-price {
    margin-bottom: var(--space-4, 1rem);
}

.nd-modal-price-input {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--color-border-light, #e5e7eb);
    border-radius: var(--radius-lg, 0.5rem);
    overflow: hidden;
    transition: border-color 0.2s ease;
    max-width: 180px;
}

.nd-modal-price-input:focus-within {
    border-color: var(--color-primary-400);
}

.nd-modal-price-currency {
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    background: var(--color-gray-50, #f9fafb);
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-secondary, #6b7280);
    font-size: var(--font-size-sm, 0.875rem);
    border-right: 1px solid var(--color-border-light, #e5e7eb);
}

.nd-modal-price-input input {
    border: none;
    outline: none;
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    font-size: var(--font-size-sm, 0.875rem);
    width: 100px;
    background: transparent;
}

.nd-modal-premium-plans {
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-modal-plans-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

/* Footer (toolbar) */
.nd-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 0.75rem);
    padding: var(--space-3, 0.75rem) var(--space-5, 1.25rem);
    border-top: 1px solid var(--color-border-light, #f3f4f6);
    background: var(--color-surface, #fff);
    flex-wrap: wrap;
    overflow: visible;
    position: relative;
}

.nd-modal-footer-left {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    position: relative;
}

.nd-modal-category {
    width: 100%;
}

.nd-modal-category .category-picker-input {
    font-size: var(--font-size-xs, 0.75rem);
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    border-radius: var(--radius-lg, 0.5rem);
    border: 1px solid var(--color-border-light, #e5e7eb);
    background: var(--color-gray-50, #f9fafb);
}

.nd-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1, 0.25rem);
    flex-wrap: wrap;
}

.nd-modal-action-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md, 0.375rem);
    border: none;
    background: none;
    color: var(--color-text-tertiary, #9ca3af);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.nd-modal-action-btn:hover {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99, 102, 241, 0.06));
}

.nd-modal-action-btn.active {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99, 102, 241, 0.08));
}

.nd-modal-toggle-group {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.nd-modal-toggle-group .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.nd-modal-toggle-label {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md, 0.375rem);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-tertiary, #9ca3af);
    font-size: 0.85rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.nd-modal-toggle-label:hover {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99, 102, 241, 0.06));
}

.nd-modal-toggle-group .form-check-input:checked + .nd-modal-toggle-label {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99, 102, 241, 0.1));
}

.nd-modal-footer-right {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

.nd-modal-cancel-btn {
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    border-radius: var(--radius-lg, 0.5rem);
    border: 1px solid var(--color-border, #d1d5db);
    background: transparent;
    color: var(--color-text-secondary, #6b7280);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.nd-modal-cancel-btn:hover {
    border-color: var(--color-border-focus, #9ca3af);
    background: var(--color-gray-50, #f9fafb);
}

.nd-modal-submit-btn {
    padding: var(--space-2, 0.5rem) var(--space-5, 1.25rem);
    border-radius: var(--radius-lg, 0.5rem);
    border: none;
    background: var(--color-primary-600);
    color: #fff;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}

.nd-modal-submit-btn:hover {
    background: var(--color-primary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nd-modal-submit-btn:active {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .nd-modal-submit-btn:hover,
    .nd-modal-close:hover {
        transform: none;
    }
}

/* Filter Section */
.nd-filter-section {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-6, 1.5rem);
    flex-wrap: wrap;
}

.nd-filter-chips {
    display: flex;
    gap: var(--space-2, 0.5rem);
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.nd-filter-chip {
    padding: var(--space-1, 0.25rem) var(--space-5, 1.25rem);
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-bold, 700);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
}

.nd-filter-chip:hover {
    background: var(--color-gray-200, #e5e7eb);
}

.nd-filter-chip.active {
    background: var(--color-primary-600);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

/* Filter Actions (More + Sort) */
.nd-filter-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    flex-shrink: 0;
}

.nd-filter-more-btn {
    background: var(--color-primary-50, #f5f3ff);
    color: var(--color-primary-600);
    border: 1px solid var(--color-primary-200, #c7d2fe);
}

.nd-filter-more-btn:hover {
    background: var(--color-primary-100, #ede9fe);
}

.nd-sort-btn {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
    border: 1px solid var(--color-border-light, #e5e7eb);
}

.nd-sort-btn:hover {
    background: var(--color-gray-200, #e5e7eb);
}

.nd-sort-btn::after {
    display: none;
}

/* ---------- Post Cards ---------- */
.nd-post-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: var(--space-4, 1rem);
    border: 1px solid var(--color-border-light, #f3f4f6);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    will-change: transform;
}

.nd-post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Post Content */
.nd-post-body {
    flex: 1;
    padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Author meta row */
.nd-post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
}

.nd-post-meta-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nd-post-meta-author {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-primary);
}

.nd-post-meta-author a {
    color: inherit;
    text-decoration: none;
}

.nd-post-meta-author a:hover {
    color: var(--color-primary-600);
}

.nd-post-meta-time {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, #9ca3af);
}

/* Content + thumbnail side-by-side layout */
.nd-post-content-row {
    display: flex;
    gap: var(--space-4, 1rem);
    align-items: flex-start;
    flex: 1;
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-text {
    flex: 1;
    min-width: 0;
}

.nd-post-title {
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2, 0.5rem);
    line-height: 1.4;
}

.nd-post-title a {
    color: inherit;
    text-decoration: none;
}

.nd-post-title a:hover {
    color: var(--color-primary-600);
    text-decoration: none;
}

.nd-post-excerpt {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-secondary, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Thumbnail (right side on desktop) */
.nd-post-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-md, 0.375rem);
    overflow: hidden;
    display: block;
}

.nd-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nd-post-card:hover .nd-post-thumbnail img {
    transform: scale(1.05);
}

/* Full-width image fallback (legacy compat) */
.nd-post-image {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--radius-md, 0.375rem);
    margin-bottom: var(--space-3, 0.75rem);
    display: block;
}

/* Tags */
.nd-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 0.5rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-tag {
    padding: 2px var(--space-3, 0.75rem);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: 0.02em;
}

.nd-post-tag-primary {
    background: var(--color-primary-50, #f5f3ff);
    color: var(--color-primary-600);
}

.nd-post-tag-secondary {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
}

/* Post Actions Footer */
.nd-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border-light, #f3f4f6);
    padding-top: var(--space-3, 0.75rem);
    margin-top: auto;
}

.nd-post-actions-left {
    display: flex;
    align-items: center;
    gap: var(--space-4, 1rem);
}

.nd-post-actions-right {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
}

.nd-post-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text-tertiary, #9ca3af);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-medium, 500);
    padding: 4px 6px;
    text-decoration: none;
    border-radius: var(--radius-md, 0.375rem);
    line-height: 1;
}

.nd-post-action:hover {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99,102,241,0.06));
    text-decoration: none;
}

.nd-post-action.active,
.nd-post-action.liked {
    color: var(--color-primary-600);
}

.nd-post-action i {
    font-size: 0.9rem;
}

.nd-post-action-count {
    font-variant-numeric: tabular-nums;
}

/* Post Header Row (meta + admin actions) */
.nd-post-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-header-row .nd-post-meta {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.nd-post-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1, 0.25rem);
    flex-shrink: 0;
}

.nd-post-admin-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md, 0.375rem);
    color: var(--color-text-tertiary, #9ca3af);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    font-size: 0.8rem;
    padding: 0;
}

.nd-post-admin-action:hover {
    color: var(--color-primary-600);
    background: var(--color-primary-50, rgba(99,102,241,0.06));
}

.nd-post-admin-action.pinned {
    color: var(--color-primary-600);
}

.nd-post-admin-action.highlighted {
    color: #f59e0b;
}

/* Post Badges */
.nd-post-badges {
    display: flex;
    gap: var(--space-2, 0.5rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.65rem;
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: 0.03em;
}

.nd-post-badge-draft {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
}

.nd-post-badge-purchased {
    background: #dcfce7;
    color: #16a34a;
}

.nd-post-badge-exclusive {
    background: #fef3c7;
    color: #d97706;
}

/* Plans badge inline */
.nd-post-plans {
    margin-left: var(--space-2, 0.5rem);
}

/* Highlighted post */
.nd-post-card.nd-post-highlighted {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
}

/* Lock overlay */
.nd-post-lock {
    text-align: center;
    padding: var(--space-6, 1.5rem) var(--space-4, 1rem);
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-lg, 0.5rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.nd-post-lock i {
    font-size: 1.5rem;
    color: var(--color-text-tertiary, #9ca3af);
    margin-bottom: var(--space-2, 0.5rem);
    display: block;
}

.nd-post-lock p {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: var(--space-3, 0.75rem);
}

/* Comment section inside nd-post-card */
.nd-comments-section {
    border-top: 1px solid var(--color-border-light, #f3f4f6);
    margin-top: var(--space-4, 1rem);
    padding-top: var(--space-4, 1rem);
}

.nd-comments-section .comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    padding: var(--space-3, 0.75rem) 0;
}

.nd-comments-section .comment-input {
    flex: 1;
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    font-size: var(--font-size-sm, 0.875rem);
    background: var(--color-gray-50, #f9fafb);
    outline: none;
    resize: none;
    min-height: unset;
}

.nd-comments-section .comment-input:focus {
    border-color: var(--color-primary-400);
    background: var(--color-surface, #fff);
}

.nd-comments-section .comment-submit {
    background: var(--color-primary-600);
    color: #fff;
    border: none;
    border-radius: var(--radius-full, 9999px);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.nd-comments-section .comment-submit:hover {
    background: var(--color-primary-700);
}

/* Comment activity row */
.nd-post-card .post-comment-activity {
    border-top: 1px solid var(--color-border-light, #f3f4f6);
    margin-top: var(--space-3, 0.75rem);
    padding-top: var(--space-3, 0.75rem);
}

/* ---------- Right Sidebar ---------- */
.nd-right-sidebar {
    position: sticky;
    top: calc(64px + 1.25rem);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--space-5, 1.25rem);
    max-height: calc(100vh - 64px - 2.5rem);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nd-right-sidebar::-webkit-scrollbar {
    display: none;
}

/* Brand/Community Card */
.nd-community-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    box-shadow: var(--shadow-sm);
  
    border: 1px solid var(--color-border-light, #f3f4f6);
}

.nd-community-card-banner {
    height: 96px;
    background: var(--gradient-primary, linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)));
    background-size: cover;
    background-position: center;
}

.nd-community-card-body {
    padding: 0 var(--space-6, 1.5rem) var(--space-6, 1.5rem);
    margin-top: -2rem;
}

.nd-community-card-logo {
  
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4, 1rem);
    overflow: hidden;
    padding: 6px;
}

.nd-community-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg, 0.5rem);
}

.nd-community-card-logo i {
    font-size: 2rem;
    color: var(--color-primary-600);
}

.nd-community-card-title {
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2, 0.5rem);
}

.nd-community-card-desc {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: var(--space-6, 1.5rem);
    line-height: var(--line-height-normal, 1.5);
}

/* Stats */
.nd-community-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
    margin-bottom: var(--space-6, 1.5rem);
}

.nd-community-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm, 0.875rem);
    padding-bottom: var(--space-2, 0.5rem);
    border-bottom: 1px solid var(--color-border-light, #f3f4f6);
}

.nd-community-stat-label {
    color: var(--color-text-tertiary, #9ca3af);
}

.nd-community-stat-value {
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-primary);
}

.nd-active-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full, 9999px);
    background: var(--color-success-500, #22c55e);
    display: inline-block;
    margin-right: var(--space-1, 0.25rem);
}

/* Members Avatars */
.nd-community-members {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-6, 1.5rem);
}

.nd-community-members img,
.nd-community-members .nd-member-initials {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full, 9999px);
    border: 2px solid var(--color-surface, #fff);
    margin-left: -12px;
    object-fit: cover;
}

.nd-community-members img:first-child,
.nd-community-members .nd-member-initials:first-child {
    margin-left: 0;
}

.nd-member-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold, 700);
}

.nd-members-more {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full, 9999px);
    background: var(--color-gray-100, #f3f4f6);
    border: 2px solid var(--color-surface, #fff);
    margin-left: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-tertiary, #9ca3af);
}

/* Social Links */
.nd-community-social {
    display: flex;
    gap: var(--space-3, 0.75rem);
}

.nd-community-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg, 0.5rem);
    background: var(--color-gray-50, #f9fafb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-tertiary, #9ca3af);
    text-decoration: none;
    transition: var(--transition-all);
    font-size: 1rem;
}

.nd-community-social a:hover {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-primary-600);
}

/* Trending Tags Card */
.nd-trending-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6, 1.5rem);
    border: 1px solid var(--color-border-light, #f3f4f6);
}

.nd-trending-title {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-tertiary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4, 1rem);
}

.nd-trending-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

.nd-trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: var(--space-1, 0.25rem) 0;
}

.nd-trending-item:hover .nd-trending-name {
    color: var(--color-primary-600);
}

.nd-trending-item:hover .nd-trending-arrow {
    transform: translateX(4px);
}

.nd-trending-name {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--color-text-primary);
    transition: color 0.2s ease;
}

.nd-trending-count {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, #9ca3af);
}

.nd-trending-arrow {
    color: var(--color-text-tertiary, #d1d5db);
    transition: transform 0.15s ease;
    font-size: 1.25rem;
}

/* Footer text */
.nd-footer-text {
    text-align: center;
    padding: 0 var(--space-4, 1rem);
    font-size: 0.6875rem;
    color: var(--color-text-tertiary, #9ca3af);
}

/* ---------- Loading states ---------- */
.nd-post-skeleton {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-xl, 0.75rem);
    padding: var(--space-6, 1.5rem);
    margin-bottom: var(--space-4, 1rem);
    box-shadow: var(--shadow-sm);
}

.nd-skeleton-line {
    height: 14px;
    background: var(--color-gray-100, #f3f4f6);
    border-radius: var(--radius-sm, 0.25rem);
    margin-bottom: var(--space-2, 0.5rem);
    animation: nd-pulse 1.5s ease-in-out infinite;
}

.nd-skeleton-line.w-75 { width: 75%; }
.nd-skeleton-line.w-50 { width: 50%; }
.nd-skeleton-line.w-100 { width: 100%; }

@keyframes nd-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- Responsive ---------- */

/* Tablet: right sidebar stacks below feed */
@media (max-width: 991px) {
    .nd-main {
        grid-template-columns: 1fr;
        padding: var(--space-4, 1rem);
    }

    .nd-right-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .nd-right-sidebar {
        display: none;
    }

    .nd-main {
        padding: var(--space-3, 0.75rem);
        gap: var(--space-4, 1rem);
    }

    .nd-post-body {
        padding: var(--space-4, 1rem);
    }

    .nd-post-content-row {
        flex-direction: column;
    }

    .nd-post-thumbnail {
        width: 100%;
        height: 160px;
        order: -1;
    }

    .nd-post-actions-left {
        gap: var(--space-3, 0.75rem);
    }

    .nd-fab-create {
        height: 44px;
        padding: 0 var(--space-4, 1rem);
        bottom: 4rem;
        right: 1rem;
        font-size: var(--font-size-xs, 0.75rem);
    }

    .nd-modal-body {
        max-height: none;
    }

    .nd-modal-footer {
        flex-direction: column;
        gap: var(--space-3, 0.75rem);
    }

    .nd-modal-footer-left {
        max-width: none;
        width: 100%;
    }

    .nd-modal-footer-actions {
        width: 100%;
        justify-content: center;
    }

    .nd-modal-footer-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Extra small */
@media (max-width: 480px) {
    .nd-post-creator {
        padding: var(--space-4, 1rem);
    }

    .nd-community-card-body {
        padding: 0 var(--space-4, 1rem) var(--space-4, 1rem);
    }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .nd-post-card,
    .nd-post-card:hover {
        transform: none;
        transition: box-shadow 0.2s ease;
    }

    .nd-post-thumbnail img,
    .nd-post-card:hover .nd-post-thumbnail img {
        transform: none;
        transition: none;
    }

    .nd-header-create-btn:hover {
        transform: none;
    }

    .nd-trending-item:hover .nd-trending-arrow {
        transform: none;
    }
}
