/* -------------------------------------------
   MV Feed Styles - MockVest Design
   Based on the provided image reference
------------------------------------------- */

/* Root Variables for consistent theming */
:root {

    --mv-bg-primary: #ffffff;
    --mv-bg-secondary: #f5f7f7;

    --mv-border: #e7ecec;

    --mv-text-primary: #1f2937;
    --mv-text-secondary: #667085;
    --mv-text-tertiary: #98a2b3;

    /* 🌿 Main theme */
    --mv-accent: #16a34a;
    --mv-accent-hover: #15803d;

    /* 🌿 Soft mint backgrounds */
    --mv-accent-soft: #f1faf5;
    --mv-accent-soft-hover: #e4f7ec;

    /* ❤️ Engagement */
    --mv-like: #ef476f;
    --mv-save: #16a34a;

    /* 👤 Avatar */
    --mv-avatar-bg: #dcfce7;
    --mv-avatar-text: #166534;

    /* 🖱 Hover */
    --mv-hover-bg: #f0fdf4;

    /* 🟢 Gains */
    --mv-profit: #16a34a;

    /* 🔴 Loss */
    --mv-loss: #dc2626;
}

/* Main Layout - Two Column Feed */
#mv-feed-layout {
    display: flex;
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--mv-bg-secondary);
    min-height: 100vh;
}

/* LEFT SIDEBAR */
.mv-feed-sidebar {
    flex: 0 0 220px;
    background: var(--mv-bg-primary);
    border-radius: 20px;
    padding: 1.25rem;
    height: fit-content;
    position: sticky;
    top: 1.5rem;
    border: 1px solid var(--mv-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mv-feed-sidebar a {
    display: block;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--mv-text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mv-feed-sidebar a:hover {
    background: var(--mv-hover-bg);
    color: var(--mv-accent);
}

/* MAIN CONTENT AREA */
.mv-feed-content {
    flex: 1;
    max-width: 640px;
}

.mv-sidebar-link {

    display: flex !important;

    align-items: center;

    gap: 12px;
}

.mv-sidebar-icon {

    width: 19px;
    height: 19px;

    stroke: currentColor;
    stroke-width: 1.9;

    fill: none;

    flex-shrink: 0;
}

.mv-sidebar-link.active {

    background: var(--mv-accent-soft);

    color: var(--mv-accent);

    font-weight: 600;
}

/* -----------------------------------
   CREATE POST BOX
----------------------------------- */

.mv-create-box {

    background: #fff;

    border: 1px solid #edf1f1;

    border-radius: 24px;

    padding: 18px;

    margin-bottom: 22px;

    box-shadow:
        0 1px 2px rgba(16,24,40,0.04),
        0 4px 14px rgba(16,24,40,0.03);
}

/* TOP */

.mv-create-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 14px;
}

.mv-create-icon {

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #ecfdf3;

    color: #16a34a;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

#mv-char-count {

    font-size: 13px;

    color: #98a2b3;

    font-weight: 500;
}

/* TEXTAREA AREA */

.mv-create-input-wrap {

    background: #f5f7f7;

    border-radius: 20px;

    padding: 16px 18px;

    margin-bottom: 16px;

    transition: all 0.2s ease;
}

.mv-create-input-wrap:focus-within {

    background: #f0fdf4;

    box-shadow:
        0 0 0 3px rgba(34,197,94,0.08);
}

#mv-post-input {

    width: 100%;

    min-height: 44px;

    max-height: 180px;

    overflow-y: auto;

    border: none;

    background: transparent;

    resize: none;

    outline: none;

    font-size: 15px;

    line-height: 1.6;

    color: #1f2937;

    font-family: inherit;
}

#mv-post-input::placeholder {

    color: #9ca3af;

    font-size: 15px;
}

/* BOTTOM */

.mv-create-bottom {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;
}

.mv-create-actions {

    display: flex;

    align-items: center;

    gap: 12px;
}

.mv-create-actions button {

    border: none;

    background: transparent;

    color: #667085;

    font-size: 14px;

    font-weight: 500;

    cursor: pointer;

    padding: 8px 12px;

    border-radius: 12px;

    transition: all 0.2s ease;
}

.mv-create-actions button:hover {

    background: #f5f7f7;

    color: #16a34a;
}

/* POST BUTTON */

#mv-post-btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    border: none;

    border-radius: 999px;

    padding: 12px 24px;

    cursor: pointer;

    font-size: 14px;

    font-weight: 600;

    color: #fff;

    background: linear-gradient(
        135deg,
        #16a34a,
        #22c55e
    );

    transition: all 0.2s ease;
}

#mv-post-btn:hover {

    transform: translateY(-1px);

    box-shadow:
        0 10px 20px rgba(34,197,94,0.18);
}

#mv-post-btn:disabled {

    opacity: 0.7;

    cursor: not-allowed;

    transform: none;
}

.mv-post-btn-icon {

    width: 16px;
    height: 16px;

    fill: currentColor;
}

/* Guest Box for non-logged in users */
.mv-guest-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
}

.mv-guest-box h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.mv-guest-box p {
    margin: 0;
    opacity: 0.9;
}

/* FEED POSTS - The core styling */
.mv-post {
    background: var(--mv-bg-primary);
    border-radius: 20px;
    border: 1px solid var(--mv-border);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.mv-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #e2e8f0;
}

/* Post Header (Avatar + User Info) */
.mv-post-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.mv-avatar {
    width: 44px;
    height: 44px;
    background: var(--mv-avatar-bg);
    color: var(--mv-avatar-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.mv-post-user {
    flex: 1;
}

.mv-display-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--mv-text-primary);
    margin-bottom: 0.125rem;
}

.mv-post-time {
    font-size: 0.75rem;
    color: var(--mv-text-tertiary);
}

/* Post Text Content */
.mv-post-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--mv-text-primary);
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}

/* Stock Mention Styling (Matches image: TCS, INFY with chips) */
.mv-post-text a[href*="stock"],
.mv-stock-tag {
    display: inline-block;
    background: #eef2ff;
    color: var(--mv-accent);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.25rem 0.625rem;
    border-radius: 30px;
    margin-right: 0.5rem;
    text-decoration: none;
}

/* Engagement Buttons (Like & Save) */
.mv-post-engagement {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
    border-top: 1px solid var(--mv-border);
    padding-top: 0.75rem;
}

.mv-like-post,
.mv-save-post {
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mv-text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 30px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.mv-like-post:hover {
    background: #fee2e2;
    color: var(--mv-like);
}

.mv-save-post:hover {
    background: #e0f2fe;
    color: var(--mv-save);
}

/* Post Actions (Edit, Delete, Report) */
.mv-post-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.mv-edit-post,
.mv-delete-post,
.mv-report-post {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
    transition: all 0.2s;
}

.mv-edit-post {
    color: var(--mv-accent);
}

.mv-delete-post {
    color: #dc2626;
}

.mv-report-post {
    color: var(--mv-text-tertiary);
}

.mv-edit-post:hover {
    background: #eef2ff;
}

.mv-delete-post:hover {
    background: #fee2e2;
}

.mv-report-post:hover {
    background: #f1f5f9;
}

/* Portfolio Impact Card (Matching image style) */
/* This mimics the "+4.8%" green box from the reference */
.mv-portfolio-impact {
    background: #ecfdf5;
    border-radius: 16px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #d1fae5;
}

.mv-portfolio-impact span:first-child {
    font-size: 0.875rem;
    font-weight: 500;
    color: #065f46;
}

.mv-portfolio-value {
    font-weight: 700;
    font-size: 1.125rem;
    color: #047857;
}

/* Trending / Sidebar extras (Matches right column of image) */
.mv-trending-box,
.mv-who-to-follow {
    background: var(--mv-bg-primary);
    border-radius: 20px;
    border: 1px solid var(--mv-border);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.mv-trending-box h4,
.mv-who-to-follow h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mv-text-tertiary);
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.mv-trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--mv-border);
    font-size: 0.875rem;
}

.mv-trending-stock {
    font-weight: 600;
    color: var(--mv-text-primary);
}

.mv-trending-change {
    font-size: 0.75rem;
    color: var(--mv-accent);
}

/* Follow Button styling (matches image) */
.mv-follow-btn {
    background: transparent;
    border: 1px solid var(--mv-accent);
    color: var(--mv-accent);
    border-radius: 30px;
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mv-follow-btn:hover {
    background: var(--mv-accent);
    color: white;
}

/* Snapshot Card (My Snapshot from image) */
.mv-snapshot {
    background: var(--mv-bg-primary);
    border-radius: 20px;
    border: 1px solid var(--mv-border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.mv-snapshot h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--mv-text-tertiary);
    margin: 0 0 0.75rem 0;
}

.mv-snapshot-return {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

.mv-snapshot-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mv-text-primary);
}

/* Responsive Design */
@media (max-width: 900px) {
    #mv-feed-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .mv-feed-sidebar {
        flex: auto;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .mv-feed-sidebar a {
        display: inline-block;
        padding: 0.375rem 0.875rem;
        font-size: 0.875rem;
    }

    .mv-feed-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .mv-post {
        padding: 0.875rem;
    }

    .mv-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .mv-create-box {
        padding: 0.875rem;
    }

    #mv-post-input {
        font-size: 0.9375rem;
    }
}

/* Helper class for loading states */
.mv-loading {
    text-align: center;
    padding: 2rem;
    color: var(--mv-text-tertiary);
}

.mv-post-engagement {
    display: flex;
    gap: 18px;
    align-items: center;
}

.mv-post-engagement button {
    display: flex;
    align-items: center;
    gap: 6px;

    background: transparent;
    border: none;
    cursor: pointer;

    color: #666;
}

.mv-icon {
    width: 20px;
    height: 20px;

    fill: transparent;
    stroke: currentColor;
    stroke-width: 2;
}

.mv-like-post.active .mv-icon,
.mv-save-post.active .mv-icon {
    fill: currentColor;
}

#mv-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;

    padding: 12px 16px;

    border-radius: 10px;

    display: none;

    z-index: 9999;

    color: #fff;
}

.mv-success {
    background: #1f8f4d;
}

.mv-error {
    background: #d64545;
}

.mv-info {
    background: #333;
}

.mv-modal {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.32);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 9999;
}

.mv-modal-box {

    position: relative;

    width: 100%;
    max-width: 520px;

    background: #fff;

    border-radius: 20px;

    padding: 22px;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.04);

    animation: mvModalIn 0.15s ease;
}

@keyframes mvModalIn {

    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mv-modal-close {

    position: absolute;

    top: 14px;
    right: 14px;

    width: 34px;
    height: 34px;

    border: none;

    border-radius: 50%;

    background: transparent;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;

    color: #6b7280;

    cursor: pointer;

    transition: background 0.15s ease;
}

.mv-modal-close:hover {

    background: #f3f4f6;
}

#mv-modal-content h3 {

    margin: 0 0 18px;

    font-size: 18px;

    font-weight: 700;

    color: #111827;
}

#mv-modal-content textarea {

    width: 100%;

    min-height: 140px;

    border: none;

    background: transparent;

    resize: vertical;

    outline: none;

    padding: 0;

    font-size: 15px;

    line-height: 1.7;

    color: #111827;

    font-family: inherit;
}

#mv-modal-content textarea::placeholder {

    color: #9ca3af;
}

#mv-save-edit,
.mv-danger-btn,
.mv-modal-cancel {

    border: none;

    border-radius: 999px;

    padding: 11px 18px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.15s ease;
}

#mv-save-edit {

    margin-top: 18px;

    background: #111827;

    color: #fff;
}

#mv-save-edit:hover {

    background: #000;
}

.mv-danger-btn {

    background: #dc2626;

    color: #fff;
}

.mv-danger-btn:hover {

    background: #b91c1c;
}

.mv-modal-cancel {

    background: #f3f4f6;

    color: #374151;
}

.mv-modal-cancel:hover {

    background: #e5e7eb;
}

.mv-modal-text {

    color: #4b5563;

    line-height: 1.6;

    margin-top: -4px;
}

.mv-modal-actions {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 22px;
}

.mv-post-header a {
    text-decoration: none;
}

/* -----------------------------------
   POST MENU
----------------------------------- */

.mv-post-menu {
    position: relative;
}

.mv-post-menu-btn {

    border: none;

    background: transparent;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    cursor: pointer;

    font-size: 20px;

    color: #667085;

    transition: all 0.2s ease;
}

.mv-post-menu-btn:hover {

    background: #f5f7f7;

    color: #111827;
}

.mv-post-menu-dropdown {

    position: absolute;

    top: 40px;
    right: 0;

    min-width: 160px;

    background: #fff;

    border: 1px solid #edf1f1;

    border-radius: 14px;

    padding: 6px;

    box-shadow:
        0 10px 25px rgba(16,24,40,0.08);

    display: none;

    z-index: 50;
}

.mv-post-menu-dropdown button {

    width: 100%;

    border: none;

    background: transparent;

    text-align: left;

    padding: 10px 12px;

    border-radius: 10px;

    cursor: pointer;

    font-size: 14px;

    color: #374151;

    transition: all 0.15s ease;
}

.mv-post-menu-dropdown button:hover {

    background: #f5f7f7;
}

.mv-delete-post:hover {
    color: #dc2626;
}

.mv-report-post:hover {
    color: #dc2626;
}

.mv-modal-text {
    margin-top: 10px;
    color: #666;
    line-height: 1.5;
}

.mv-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.mv-modal-cancel {
    border: 1px solid #ddd;
    background: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
}

.mv-danger-btn {
    border: none;
    background: #e53935;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
}

.mv-feed-rightbar {

    flex: 0 0 280px;

    display: flex;

    flex-direction: column;

    gap: 16px;
}

.mv-side-card {

    background: #fff;

    border: 1px solid #edf1f1;

    border-radius: 20px;

    padding: 18px;

    box-shadow:
        0 1px 2px rgba(16,24,40,0.03);
}

.mv-side-card h4 {

    margin: 0 0 12px;

    font-size: 14px;

    font-weight: 700;

    color: #111827;
}

.mv-side-card p {

    margin: 0;

    font-size: 14px;

    line-height: 1.7;

    color: #667085;
}

.mv-rules-list {

    margin: 0;
    padding-left: 18px;
}

.mv-rules-list li {

    margin-bottom: 10px;

    font-size: 14px;

    line-height: 1.6;

    color: #667085;
}

.mv-empty-feed {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    border-radius: 18px;
    color: #64748b;
    font-weight: 600;
}

.mv-feed-loader {

    display: none;

    padding: 24px 0;

    text-align: center;
}

.mv-loader-spinner {

    width: 28px;
    height: 28px;

    margin: 0 auto 10px;

    border: 3px solid #e5e7eb;
    border-top-color: #083c71;

    border-radius: 50%;

    animation: mvSpin 0.7s linear infinite;
}

.mv-loader-text {

    font-size: 14px;
    color: #64748b;
}

@keyframes mvSpin {

    to {
        transform: rotate(360deg);
    }
}