
/* ===== FACEBOOK-STYLE PROFILE LAYOUT ===== */
/* ===== Generic Skeleton + Empty State Utilities ===== */
:root { --skel-base: #e5e7eb; --skel-highlight: #f3f4f6; }
.skel, .skeleton { position: relative; overflow: hidden; }
.skel-line, .skel-avatar, .skel-img {
    background: linear-gradient(90deg, var(--skel-base), var(--skel-highlight), var(--skel-base));
    background-size: 200% 100%;
    animation: skel-shimmer 1.25s ease-in-out infinite;
    border-radius: .5rem;
    display: block;
}
.skel-line { height: 12px; width: 100%; }
.skel-avatar { width: 40px; height: 40px; border-radius: 999px; }
.skel-img { width: 100%; aspect-ratio: 16 / 9; border-radius: .75rem; }
.skel-card {
    background:#fff; border: 0.2px solid rgba(0,0,0,0.06); border-radius:.75rem; padding:.6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04); display:flex; flex-direction:column; gap:.5rem;
}
.skel-stack { display:flex; flex-direction:column; gap:.4rem; }
.skel-row { display:flex; align-items:center; gap:.6rem; }
@keyframes skel-shimmer { 0%{background-position:0% 0} 100%{background-position:200% 0} }

.empty-state { text-align:center; color:#64748b; padding:1.25rem; }
.empty-state h3, .empty-state h4 { margin:.25rem 0; color:#0f172a; }
.empty-state p { margin:.25rem 0 .75rem; }
/* Premium Top App Bar */
.top-appbar {
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: saturate(140%) blur(10px);
    /* Deep Forest Green */
    background: #304529;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.appbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto; /* left auto, center flexible, right auto */
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
}
/* Unified header offset to clear taller brand bar */
:root { --header-offset: 6rem; }
.left-sidebar-combined.enhanced-sidebar.sidebar-container {
    top: var(--header-offset);
    height: calc(100vh - var(--header-offset));
    /* Mirror right sidebar visual container styling */
    background: #ffffff;
    border: 0.2px solid #000000;
    border-radius: 0;
    overflow-y: auto;
    padding: 0.75rem;
}
.right-sidebar-combined.enhanced-sidebar.sidebar-container {
    grid-area: right-stats;
    position: sticky;
    top: var(--header-offset);
    height: calc(100vh - var(--header-offset));
    background: #ffffff;
    border: 0.2px solid rgba(0,0,0,0.2);
    border-radius: 1rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    overflow-y: auto;
    padding: 0.75rem;
}

/* Right sidebar nav consistency with left */
.right-sidebar-combined .insights-nav-link {
    color: #0f172a;
    background: #ffffff;
    border: 0.2px solid rgba(0,0,0,0.2);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.35rem;
    border-radius: 0.625rem;
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
}
.right-sidebar-combined .insights-nav-link::before {
    content: "";
    position: absolute; left: 0.5rem; top: 0.5rem; bottom: 0.5rem; width: 2px; border-radius: 2px; background: transparent; transition: background 0.2s ease, transform 0.2s ease; transform: scaleY(0.5); opacity: 0.6;
}
.right-sidebar-combined .insights-nav-link:hover { background: #f8fafc; color: #0f172a; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.right-sidebar-combined .insights-nav-link.active { background: #ecfeff; color: #0f172a; border-color: rgba(20, 184, 166, 0.45); box-shadow: 0 1px 2px rgba(2, 132, 199, 0.12), inset 0 0 0 1px rgba(20, 184, 166, 0.25); }
.right-sidebar-combined .insights-nav-link:hover::before, .right-sidebar-combined .insights-nav-link.active::before { background: linear-gradient(180deg, #14b8a6, #38bdf8); transform: scaleY(1); }
.right-sidebar-combined .insights-nav-link i { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; margin-right: 0.75rem; border-radius: 0.75rem; background: rgba(2,6,23,0.04); color: #0f172a; box-shadow: inset 0 0 0 1px #e7e5e4; }
.right-sidebar-combined .insights-nav-link.active i { background: rgba(20, 184, 166, 0.12); color: #0f766e; box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.3); }

/* Section title consistency */
.right-sidebar-combined .sidebar-section-title {
    color: #0f172a;
    font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; margin: 1rem 0 0.5rem 0; padding: 0 0.75rem;
}

/* Insight cards styling to match Aesthetic */
.right-sidebar-combined .insights-section-card, .right-sidebar-combined .insight-stat-card, .right-sidebar-combined .insight-item {
    background: #ffffff;
    border: 0.2px solid rgba(0,0,0,0.2);
    border-radius: 0.9rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.04);
}
.right-sidebar-combined .insights-section-card { padding: .6rem; }
.right-sidebar-combined .insights-section-header { padding: .25rem .35rem; }
.right-sidebar-combined .insights-title { font-weight: 400; color: #0f172a; }

/* Spacing consistency */
.right-sidebar-combined .insights-section-content { display: flex; flex-direction: column; gap: .5rem; }
.right-sidebar-combined .insights-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.right-sidebar-combined .insight-item { padding: .5rem; }

/* Notifications Section */
.notifications-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.5rem; margin-bottom:.5rem; background: linear-gradient(180deg, #ffffff, #fafaf9); border: 0.2px solid #e7e5e4; border-radius:.75rem; box-shadow:0 1px 2px rgba(0,0,0,0.04); }
.notifications-tabs { display:flex; flex-wrap:wrap; gap:.25rem; }
/* Mint blue accent (#429E9D) for notification tabs */
.notif-tab { appearance:none; border: 0.2px solid #e5e7eb; background:#fff; color:#0f172a; border-radius:.6rem; padding:.4rem .65rem; font-size:var(--post-font-size, 0.9rem); font-weight: 400; cursor:pointer; transition:all .2s ease; }
.notif-tab:hover { background:#f0fdfa; border-color:#429E9D; }
.notif-tab.active { background:linear-gradient(180deg, #e0f7f5, #d4f4f1); border-color:rgba(66,158,157,.45); box-shadow:inset 0 0 0 1px rgba(66,158,157,.35); }
.notif-tab:focus-visible { outline: 2px solid #429E9D; outline-offset: 2px; }
.notifications-actions .pill { display:inline-flex; align-items:center; gap:.5rem; padding:.45rem .7rem; border-radius:.6rem; border: 0.2px solid #e5e7eb; background:#ffffff; color:#0f172a; font-weight: 400; transition:all .2s ease; }
.notifications-actions .pill:hover { background:#f8fafc; }

.notifications-section-body { padding:.25rem; }
.notifications-list { display:flex; flex-direction:column; gap:.5rem; }
.notification-card { display:flex; gap:.75rem; padding:.65rem .75rem; background:#ffffff; border: 0.2px solid rgba(0,0,0,0.08); border-radius:.9rem; box-shadow:0 6px 12px rgba(0,0,0,0.04); align-items:flex-start; transition:transform .15s ease, box-shadow .15s ease; }
.notification-card:hover { transform:translateY(-1px); box-shadow:0 10px 18px rgba(0,0,0,0.06); }
/* Mint blue accent for unread notifications */
.notification-card.unread { background:linear-gradient(180deg, #e0f7f5, #d4f4f1); border-color:rgba(66,158,157,.35); }
.notification-icon { width:40px; height:40px; border-radius:.75rem; display:inline-flex; align-items:center; justify-content:center; background:rgba(2,6,23,0.04); box-shadow:inset 0 0 0 1px #e7e5e4; color:#0f172a; flex-shrink:0; }
.notification-content { flex:1; min-width:0; }
.notification-title { color:#0f172a; font-weight: 400; font-size:14px; line-height:1.25; margin:0; }
.notification-text { color:#374151; font-size:var(--post-font-size, 0.9rem); margin:.15rem 0 0 0; line-height:1.35; }
.notification-meta { display:flex; align-items:center; gap:.5rem; margin-top:.3rem; color:#6b7280; font-size:11px; }
.notification-actions { display:flex; gap:.35rem; }
.notification-actions .btn { padding:.35rem .55rem; border-radius:.5rem; border: 0.2px solid #e5e7eb; background:#fff; color:#0f172a; font-weight: 400; font-size:var(--post-font-size, 0.9rem); }
.notification-actions .btn:hover { background:#f8fafc; }
.notification-avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; border: 0.2px solid #e7e5e4; box-shadow:0 1px 2px rgba(0,0,0,0.04); }
.notification-link { color:#0ea5e9; font-weight: 400; text-decoration:none; }
.notification-link:hover { text-decoration:underline; }
.main-content-area {
    top: var(--header-offset);
}
.appbar-left { display: flex; align-items: center; gap: 0.5rem; }
.brand-mark { 
    width: 32px; 
    height: 32px; 
    display: grid; 
    place-items: center; 
    border-radius: 50%; 
    background: rgba(255,255,255,0.15); 
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 2px 8px rgba(0,0,0,0.1); 
    font-size: 14px; 
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Wide text+logo variant for header */
.brand-logo {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.brand-mark:hover {
    background: rgba(255,255,255,0.25);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.brand-mark svg {
    transition: transform 0.3s ease;
}

.brand-mark:hover svg {
    transform: scale(1.1);
}
.brand-name { font-weight: 400; letter-spacing: 0.5px; color: #E8E1D0; text-shadow: none; }
.appbar-center { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.appbar-tab { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.12); color: #E8E1D0; border: var(--border-thin, 1px) solid rgba(255,255,255,0.25); font-weight: 400; font-size: 11px; transition: all .2s ease; position: relative; }
.appbar-tab:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.appbar-tab.active { background: #E8E1D0; color: #000; border-color: #000; }
.notification-bubble { position: absolute; right: 6px; top: 2px; width: 8px; height: 8px; border-radius: 999px; background: #64B5F6; display: none; }
.notification-bubble:not(.hidden) { display: block; }
.notif-unread-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #ffffff; font-size: 11px; font-weight: 400; line-height: 1; margin-left: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
@keyframes badge-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.notif-unread-badge.pop { animation: badge-pop 220ms ease-out; }
.appbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.appbar-cta { padding: 0.35rem 0.75rem; border-radius: 999px; font-weight: 400; font-size: 11px; transition: all .2s ease; border: var(--border-thin, 1px) solid transparent; }
.appbar-cta.primary { background: #304529; color: #E8E1D0; border-color: #304529; }
.appbar-cta.primary:hover { background: #3E5A36; border-color: #3E5A36; box-shadow: 0 6px 18px rgba(48, 69, 41, 0.25); }
.appbar-cta.danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.appbar-cta.danger:hover { background: #dc2626; border-color: #dc2626; box-shadow: 0 6px 18px rgba(220, 38, 38, 0.25); }

/* App bar search input/results */
.appbar-search-input {
    width: min(36vw, 380px);
    background: #FFFFFF;
    color: #111827;
    border: 0.2px solid #e5e7eb;
    border-radius: 9999px;
    padding: 8px 12px;
    font-size: var(--post-font-size, 0.9rem);
}
.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
    display: none;
    z-index: 200;
    padding: 0.5rem;
}
.global-search-results .search-result-header { font-size: 0.7rem; font-weight: 400; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin: 0.25rem 0; padding: 0 0.25rem; }
.global-search-results .search-result-item { padding: 0.5rem; border-radius: 0.5rem; display: flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.global-search-results .search-result-item:hover { background: #f9fafb; }
.global-search-results .search-result-icon { width: 28px; height: 28px; border-radius: 0.375rem; display: inline-flex; align-items: center; justify-content: center; background: #429E9D; color: #ffffff; border: 0.2px solid #000000; font-size: .8rem; }

@media (max-width: 768px) {
    .appbar-inner { grid-template-columns: 1fr auto; }
    .appbar-right { display: none; }
    .brand-name { display: none; }
        #floating-post-btn { bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); }
}

/* News pagination tabs */
.news-tabs-wrapper {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.news-tab {
    padding: 6px 12px;
    border-radius: 9999px;
    border: var(--border-thin, 1px) solid rgba(0,0,0,0.08);
    background: #FFFFFF;
    color: #374151;
    font-size: 11px;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.news-tab:hover {
    background: #F3F4F6;
}

.news-tab.active {
    background: #111827;
    color: #F9FAFB;
    border-color: #111827;
    box-shadow: 0 2px 6px rgba(17,24,39,0.25);
}

.news-tab:active {
    transform: translateY(1px);
}

/* Profile Container - Full Width Layout */
.facebook-profile-container {
    width: 100%;
    max-width: none; /* Remove max-width restriction */
    margin: 0;
    background: #ffffff;
    border-radius: var(--radius-lg, 1rem); /* Unified curve for all cards */
    overflow: hidden;
    box-shadow: none; /* Remove shadow for seamless integration */
}

/* Profile Section - render inside center column (no full-screen override) */
#profile-section {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    overflow: visible;
    z-index: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#profile-section .facebook-profile-container {
    margin: 0;
    width: 100%;
    background: transparent;
    padding: 0;
    min-height: auto;
}

/* Legacy Messages Section CSS - Now using separate messaging.html */
/* #messages-section {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    overflow: visible;
    z-index: auto;
    font-family: var(--font-primary, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Remove outer card chrome so the in-app Messages UI can breathe */
#messages-section .section-header { display: none; }
#messages-section .section-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
#messages-section .section-content { padding: 0; }

/* Remove extra header and padding inside Messages to maximize available height */
#messages-section .global-feed-header { display: none; }
#messages-section .global-feed-container,
#messages-section .global-news-section { padding: 0; margin: 0; }

/* Constrain the messages canvas within center column */
#messages-section .section-card {
    margin: 0;
    width: 100%;
    min-height: auto;
}

/* Make the messages layout fill the available height/width inside this canvas */
#messages-section .messages-layout {
    height: calc(100vh - 3.5rem - 2rem);
    /* Center within the content canvas for a premium, less-massive look */
    max-width: 1000px;
    margin: 1rem auto;
    border-radius: 16px;
}

/* Friends Section - render inside center column */
#friends-section {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    overflow: visible;
    z-index: auto;
    font-family: var(--font-primary, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sports Section - contained within center column (no viewport breakout) */
#sports-section {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    background: transparent;
    overflow: visible;
    z-index: auto;
}
#sports-section .section-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    width: 100%;
    min-height: auto;
}
#sports-section .section-content {
    padding: 0;
}

/* Remove outer card chrome so the in-app Friends UI can breathe */
#friends-section .section-header { display: none; }
#friends-section .section-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
#friends-section .section-content { padding: 0; }

/* Constrain the friends canvas within center column */
#friends-section .section-card {
    margin: 0;
    width: 100%;
    min-height: auto;
}

/* Cover Photo Section */
.profile-cover-section {
    position: relative;
    background: #f8f9fa;
    margin-bottom: 0;
}
.profile-cover-photo::before {content:"";position:absolute;inset:0;background:linear-gradient(120deg,var(--grad-deep-start,#3AAFA9),var(--grad-deep-end,#2B7A78),#4f46e5,#9333ea,var(--grad-soft-start,#DEF2F1));background-size:300% 300%;animation:profileBannerShift 20s ease infinite;mix-blend-mode:overlay;opacity:.6;pointer-events:none;}
@keyframes profileBannerShift {0%{background-position:0% 50%;}50%{background-position:100% 50%;}100%{background-position:0% 50%;}}

.profile-cover-photo {
    position: relative;
    height: 200px; /* Reduced height */
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cover-image:hover {
    transform: scale(1.01); /* Reduced scale for better performance */
}

.cover-photo-overlay {
    position: absolute;
    top: 24px;
    right: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-cover-photo:hover .cover-photo-overlay {
    opacity: 1;
}

.edit-cover-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-lg, 1rem);
    font-size: var(--post-font-size, 0.9rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.edit-cover-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Profile Main Info */
.profile-main-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* allow wrapping when narrow */
    gap: .75rem 1rem;
    padding: 1rem 2rem; /* Compact header spacing */
    position: relative;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Compact profile header modifiers */
.profile-main-info.compact { border-bottom: 1px solid rgba(23,37,42,0.06); }
.profile-picture-section.small-left { margin-right: 16px; }
.profile-picture-section.small-left .profile-picture-wrapper-large { margin-top: 0; }

.profile-picture-section {
    position: relative;
    margin-right: 24px;
    flex: 0 0 auto;
}

.profile-picture-wrapper-large {
    position: relative;
    width: 168px;
    height: 168px;
    border-radius: var(--radius-full, 9999px);
    border: var(--border-extra, 4px) solid white;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    margin-top: -84px;
    background: white;
}
.profile-picture-aura {position:relative;display:inline-block;}
.profile-picture-aura::before {content:"";position:absolute;inset:-10px;background:conic-gradient(from 0deg,var(--aura-color,#3AAFA9),transparent 70%);border-radius:50%;filter:blur(8px) saturate(140%);opacity:.5;animation:auraPulse 6s ease-in-out infinite;}
.profile-picture-aura.online::after {content:"";position:absolute;right:4px;bottom:6px;width:18px;height:18px;background:radial-gradient(circle at 30% 30%,#7dffb8,#15c978);border:var(--border-medium, 2px) solid #fff;border-radius:50%;box-shadow:0 0 0 4px rgba(21,201,120,.25);animation:onlinePulse 3s ease-in-out infinite;}
@keyframes auraPulse {0%,100%{filter:blur(8px) brightness(1);}50%{filter:blur(14px) brightness(1.25);}}
@keyframes onlinePulse {0%,100%{transform:scale(.9);opacity:.9;}50%{transform:scale(1.15);opacity:1;}}

.profile-picture-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-edit-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-picture-wrapper-large:hover .profile-picture-edit-overlay {
    opacity: 1;
}

.edit-profile-pic-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full, 9999px);
    background: #962FBF;
    color: white;
    border: 0.2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.edit-profile-pic-btn:hover {
    background: #17252A;
}

/* Profile Basic Info */
.profile-basic-info { flex: 1 1 auto; min-width: 0; margin-top: 0; }

.profile-name {
    font-size: 14px;
    font-weight: 400;
    color: #1c1e21;
    margin: 0 0 4px 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-username {
    font-size: var(--post-font-size, 0.9rem);
    color: #65676b;
    color: var(--post-header-text, inherit);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-stats-inline {
    display:none; /* replaced by stat cards */
}
.profile-stat-cards {display:flex;gap:.85rem;flex-wrap:wrap;margin:.75rem 0 1.1rem;}
.profile-stat-card {flex:0 0 auto;min-width:84px;padding:.6rem .7rem;border-radius:.85rem;background:linear-gradient(145deg,rgba(255,255,255,0.78),rgba(255,255,255,0.6));backdrop-filter:blur(10px) saturate(140%);border:var(--border-thin, 1px) solid rgba(58,175,169,0.25);box-shadow:0 2px 6px -3px rgba(23,37,42,.22),inset 0 1px 2px rgba(255,255,255,.7);display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;position:relative;overflow:hidden;}
.profile-stat-card span.label {font-size:.5rem;font-weight: 400;letter-spacing:.08em;text-transform:uppercase;color:var(--primary-medium,#2B7A78);opacity:.85;}
.profile-stat-card span.value {font-size: 14px;font-weight: 400;color:var(--primary-darkest,#17252A);line-height:1;}

.stat-item {
    display: flex;
    align-items: center;
}

.stat-divider {
    color: #bcc0c4;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.profile-action-btn {
    padding: 8px 16px;
    border-radius: var(--radius-lg, 1rem);
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.profile-action-btn.primary {
    background: #962FBF;
    color: white;
}

.profile-action-btn.primary:hover {
    background: #17252A;
    transform: translateY(-2px);
}

.profile-action-btn.secondary {
    background: #e4e6ea;
    color: #1c1e21;
}

.profile-action-btn.secondary:hover {
    background: #d8dadf;
    transform: translateY(-2px);
}

/* Profile Navigation */
.profile-navigation { border-top: 1px solid rgba(23,37,42,0.06); background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 0 2rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

.profile-nav-tabs {display:flex;gap:.5rem;padding:.25rem 2rem; /* remove bottom border to avoid double underline */ border-bottom:none; overflow-x:auto; -webkit-overflow-scrolling: touch; scroll-snap-type:x proximity; white-space: nowrap; }
.profile-nav-tab {padding:8px 12px;background:transparent;border: 0.2px solid transparent;border-radius:9999px;color:#17252A;font-size:.9rem;font-weight: 400;cursor:pointer;position:relative;transition:color .2s ease, background .2s ease, transform .12s ease;display:inline-flex;align-items:center;gap:.5rem;letter-spacing:0; scroll-snap-align:start; white-space: nowrap; font-family: inherit; line-height: 1; min-height: 36px;}
/* icon style to match sidebar: fixed box, subtle bg, rounded */
.profile-nav-tab i {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    background: rgba(2,6,23,0.04);
    color: #374151;
    font-size: .9rem; /* fixed glyph size */
    transition: background .2s ease, color .2s ease, transform .2s ease;
    /* Ensure Font Awesome renders even with global Inter override */
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
    font-weight: 400;
}

/* Explicitly ensure pseudo-element uses FA as well (some FA builds use ::before content) */
.profile-nav-tab i::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
    font-weight: 400;
}
/* Single underline only for active tab */
.profile-nav-tab::after { content: none; }
.profile-nav-tab:hover {color:#0f172a; transform: translateY(-1px);} 
.profile-nav-tab:hover i {background:rgba(2,6,23,0.06); color:#0f172a; transform: translateY(-1px);} 
.profile-nav-tab.active {color:#17252A;background:linear-gradient(180deg, #f0fdfa, #ecfeff); border-color: rgba(58,175,169,0.25); box-shadow: 0 1px 2px rgba(23,37,42,0.06);} 
.profile-nav-tab.active::after { content: none; }
.profile-nav-tab.active i {background:rgba(20,184,166,0.12); color:#0f766e;}

/* Profile Content Area */
.profile-content-area {
    background: #f7f8fa;
    min-height: 500px; /* Ensure minimum height */
    width: 100%;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.03);
}

.profile-tab-content {
    display: none;
    padding: 24px 2rem; /* Slightly tighter spacing */
    width: 100%;
    max-width: none;
}

.profile-tab-content.active {
    display: block;
}

/* Profile Posts Sub-tabs */
.profile-posts-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.profile-posts-subtab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 0.2px solid transparent;
    border-radius: 0.5rem;
    color: #6b7280;
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-posts-subtab:hover {
    color: #374151;
    background: #f9fafb;
    transform: translateY(-1px);
}

.profile-posts-subtab.active {
    color: #429E9D;
    background: linear-gradient(135deg, rgba(66, 158, 157, 0.1), rgba(66, 158, 157, 0.05));
    border-color: rgba(66, 158, 157, 0.2);
}

.profile-posts-subtab i {
    font-size: 14px;
}

.profile-posts-subtab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-posts-subtab-content.active {
    display: block;
}

/* No Content Messages */
.no-posts-message,
.no-friends-message,
.no-photos-message {
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
}

.no-posts-icon,
.no-friends-icon,
.no-photos-icon,
.mood-chart-icon {
    font-size: 14px;
    color: #bcc0c4;
    margin-bottom: 16px;
}

.no-posts-message h3,
.no-friends-message h4,
.no-photos-message h4,
.mood-chart-placeholder h4 {
    font-size: 14px;
    font-weight: 400;
    color: #1c1e21;
    margin: 0 0 8px 0;
}

.no-posts-message p,
.no-friends-message p,
.no-photos-message p,
.mood-chart-placeholder p {
    font-size: var(--post-font-size, 0.9rem);
    color: #65676b;
    margin: 0 0 20px 0;
}

.create-first-post-btn { background: #304529; color: #E8E1D0; border: var(--border-medium, 2px) solid #304529; padding: 12px 24px; border-radius: 8px; font-size: var(--post-font-size, 0.9rem); font-weight: 400; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.create-first-post-btn:hover { background: #3E5A36; border-color: #3E5A36; transform: translateY(-2px); }

/* About Section */
.about-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-card {
    background: white;
    border-radius: var(--radius-lg, 1rem);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.about-card h3 {
    font-size: 14px;
    font-weight: 400;
    color: #1c1e21;
    margin: 0 0 16px 0;
}

.about-info-grid {
    display: grid;
    gap: 16px;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}

.about-item:last-child {
    border-bottom: none;
}

.about-item i {
    width: 20px;
    color: #962FBF;
    font-size: 14px;
}

.about-item div {
    flex: 1;
}

.about-item label {
    font-size: 11px;
    color: #65676b;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.about-item span {
    font-size: var(--post-font-size, 0.9rem);
    color: #1c1e21;
    font-weight: 500;
}

/* Bio Content */
.bio-content {
    position: relative;
}

.bio-content p {
    font-size: var(--post-font-size, 0.9rem);
    color: #1c1e21;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.edit-bio-btn {
    background: #e4e6ea;
    color: #1c1e21;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: var(--post-font-size, 0.9rem);
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.edit-bio-btn:hover {
    background: #d8dadf;
}

/* Friends Grid */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* Enhanced Friends Section Styles with Mint Blue Accent (#429E9D) */
.friends-tabs { display: flex; background: #429E9D; border-radius: var(--radius-lg, 1rem) var(--radius-lg, 1rem) 0 0; padding: 4px; margin-bottom: 0; box-shadow: 0 2px 10px rgba(66,158,157,0.2); }

.friends-tab { flex: 1; padding: 14px 20px; background: transparent; color: rgba(255,255,255,0.92); border: var(--border-thin, 1px) solid transparent; border-radius: var(--radius-lg, 1rem); font-weight: 400; font-size: 15px; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .05s ease; position: relative; overflow: hidden; }

/* remove glossy overlay */
.friends-tab::before { content: none; }

.friends-tab:hover { background: rgba(255,255,255,0.12); }

.friends-tab.active { background: #ffffff; color: #429E9D; border-color: rgba(255,255,255,0.3); box-shadow: 0 2px 6px rgba(0,0,0,0.1); transform: translateY(-1px); font-weight: 400; }

.friends-tab:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

.friends-tab.active::before {
    opacity: 0;
}

.friends-content { 
    background: #fff; 
    border-radius: 0 0 var(--radius-lg, 1rem) var(--radius-lg, 1rem); 
    min-height: 500px; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); 
    overflow: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Friends View Controls - integrated inside content */
.friends-view-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    margin-bottom: 8px;
}

.view-toggles {
    display: flex;
    gap: 4px;
    background: #ffffff;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.view-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.view-toggle:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.view-toggle.active {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.view-toggle:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-select {
    padding: 8px 28px 8px 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    background: #ffffff;
    color: #10b981;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2310b981' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.sort-select:hover {
    border-color: #10b981;
    background-color: #f0fdfa;
}

.sort-select:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-color: #10b981;
}

/* Ensure grid/list content fits properly */
.friends-content-grid,
.friends-content-list {
    flex: 1;
    width: 100%;
    max-width: none;
}

.friends-search {
    padding: 24px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-bottom: 1px solid #d1fae5;
}

.friends-search-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.friends-search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px; /* Medium font size */
    z-index: 2;
}

.friends-search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: var(--border-medium, 2px) solid #d1fae5;
    border-radius: var(--radius-lg, 1rem);
    font-size: 16px; /* Medium font size */
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.friends-search-input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1), 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.friends-search-input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

/* Enhanced User Cards with Turquoise Theme */
.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 32px 24px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
}

.user-card {
    background: white;
    border-radius: var(--radius-lg, 1rem);
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.2px solid #d1fae5;
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.user-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.user-card:hover::before {
    transform: scaleX(1);
}

.user-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-card-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 0.2px solid #d1fae5;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.user-card:hover .user-card-avatar {
    border-color: #14b8a6;
    transform: scale(1.05);
}

.user-card-info h4 {
    margin: 0 0 6px 0;
    font-size: 20px; /* Heading font size */
    font-weight: 400;
    color: #111827;
    line-height: 1.2;
}

.user-card-email {
    margin: 0;
    font-size: 14px; /* Small font size */
    color: #6b7280;
    font-weight: 500;
}

.user-card-status {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-radius: var(--radius-lg, 1rem);
    font-size: 14px; /* Small font size */
    font-weight: 400;
    border: 0.2px solid #d1fae5;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 8px currentColor;
}

.status-indicator.online {
    background: #10b981;
    color: #10b981;
}

.status-indicator.offline {
    background: #9ca3af;
    color: #9ca3af;
}

.user-card-actions {
    display: flex;
    gap: 12px;
}

.user-action-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-lg, 1rem);
    font-weight: 400;
    font-size: 16px; /* Medium font size */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.user-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.user-action-btn:hover::before {
    left: 100%;
}

.user-action-btn.message-btn { background: #304529; color: #E8E1D0; border: 0.2px solid #304529; box-shadow: 0 4px 16px rgba(48, 69, 41, 0.25); }

.user-action-btn.message-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(48, 69, 41, 0.35); }

.user-action-btn.friend-btn {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #4b5563;
    border: 0.2px solid #d1d5db;
}

.user-action-btn.friend-btn:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.user-action-btn.friend-btn.sent {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
}

.user-action-btn.friend-btn.friends {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: #10b981;
}

/* Enhanced Loading and Empty States */
.loading-state,
.no-users {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: #6b7280;
    text-align: center;
}

.loading-state i,
.no-users i {
    font-size: 14px;
    margin-bottom: 24px;
    color: #d1d5db;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-state h3,
.no-users h3 {
    margin: 0 0 12px 0;
    font-size: 24px; /* Heading font size */
    font-weight: 400;
    color: #111827;
}

.loading-state p,
.no-users p {
    margin: 0;
    font-size: 16px; /* Medium font size */
    font-weight: 500;
    color: #6b7280;
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

/* Mood History */
.mood-history-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.mood-history-streak {display:flex;gap:2px;margin-top:1.25rem;height:40px;overflow:hidden;border-radius:.85rem;box-shadow:0 2px 6px -2px rgba(0,0,0,.25),inset 0 1px 2px rgba(255,255,255,.6);} 
.mood-history-streak .streak-seg {flex:1;position:relative;} 
.mood-history-streak .streak-seg::after {content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.35),rgba(255,255,255,0));mix-blend-mode:overlay;} 

.mood-chart-container {
    margin-top: 16px;
}

.mood-chart-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
}

.mood-spectrum-preview {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.mood-spectrum-item {
    padding: 6px 12px;
    border-radius: var(--radius-lg, 1rem);
    color: white;
    font-size: 11px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Profile Post Cards */
.profile-post-card {
    background: white;
    border-radius: var(--radius-lg, 1rem);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 0.2px solid rgba(23, 37, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-post-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.profile-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.profile-post-mood {
    padding: 4px 12px;
    border-radius: var(--radius-lg, 1rem);
    color: white;
    font-size: 11px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.profile-post-date {
    font-size: 11px;
    color: #65676b;
}

.profile-post-content {
    margin-bottom: 12px;
}

.profile-post-content p {
    font-size: var(--post-font-size, 0.9rem);
    color: #1c1e21;
    line-height: 1.55;
    margin: 0;
}

.profile-post-stats {
    display: flex;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}

.profile-post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #65676b;
}

.profile-post-stat i {
    font-size: 0.72rem;
    font-family: var(--font-primary, 'Inter'), sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Profile Layout */
    #profile-section {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        margin-left: 0;
    }
    
    #profile-section .facebook-profile-container {
        margin-left: 1rem; /* Simple mobile margin */
        margin-right: 1rem; /* Simple mobile margin */
        width: calc(100vw - 2rem); /* Full width minus margins */
        min-height: auto;
    }
    
    .profile-cover-photo {
        height: 240px; /* Reduce height on mobile */
    }
    
    .profile-main-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 1rem 24px; /* Consistent mobile padding */
    }
    
    .profile-picture-section {
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    .profile-basic-info {
        margin-top: 0;
    }
    
    .profile-navigation,
    .profile-tab-content {
        padding-left: 1rem; /* Consistent mobile padding */
        padding-right: 1rem; /* Consistent mobile padding */
    }
    
    .profile-nav-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
    }
    
    .profile-nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .profile-nav-tab {
        white-space: nowrap;
        min-width: auto;
        padding: 16px 20px;
    }
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
    font-family: var(--font-primary, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Accessible skip link: hidden until focused */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 3001; /* above header */
    background: #111827;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0 0.5rem 0.5rem;
    border: 0.2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    text-decoration: none;
    font-weight: 400;
}
.skip-link:focus, .skip-link:focus-visible {
    left: 0.5rem;
    top: 0.5rem;
    outline: 3px solid #f59e0b; /* amber focus to stand out */
    outline-offset: 2px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Beautiful Font System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body * { font-family: 'Inter', var(--font-primary, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { font-feature-settings: "ss01" on, "liga" on; }
body {
    background: radial-gradient(circle at 15% 20%, #F8FBFB 0%, #F2F7F7 40%, #ECF3F3 80%) fixed;
}
/* Anti-blink fade utility for dynamic sports lists */
.no-blink-fade { transition: opacity .28s ease; will-change: opacity; }
button, .btn, .profile-nav-tab, .create-first-post-btn, .post-comment-button { letter-spacing: .045em; }
h1, h2, h3, h4, h5, h6, .sidebar-section-title { letter-spacing: .04em; }

/* FontAwesome Icon System - Consistent & Elegant */
.fas, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro";
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Unified Icon System */
:root {
    --icon-size: 1.25rem;
    --icon-color: var(--accent-white, #FFFFFF);
    --icon-hover-color: #429E9D;
    --grad-soft-start: #E3F2FD;
    --grad-soft-mid: #BBDEFB;
    --grad-soft-end: #90CAF9;
    --grad-deep-start: #64B5F6;
    --grad-deep-mid: #D6249F;
    --grad-deep-end: #176B87;
    --gradient-diagonal-soft: linear-gradient(135deg, var(--grad-soft-start) 0%, var(--grad-soft-mid) 45%, var(--grad-soft-end) 100%);
    --gradient-diagonal-deep: linear-gradient(135deg, var(--grad-deep-start) 0%, var(--grad-deep-mid) 55%, var(--grad-deep-end) 100%);
    --gradient-surface: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 60%, rgba(255,255,255,0.6) 100%);
    --shadow-soft: 0 4px 14px -4px rgba(23,37,42,0.15), 0 2px 6px rgba(23,37,42,0.06);
    --shadow-softer: 0 10px 28px -10px rgba(23,37,42,0.18), 0 4px 12px -2px rgba(23,37,42,0.08);
    --radius-card: 1.75rem; /* legacy */
    --radius-unified: 14px;
}

.icon { /* base icon utility */
    font-size: var(--icon-size);
    width: var(--icon-size);
    height: var(--icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--icon-color);
    transition: transform var(--transition-fast,150ms) ease, color var(--transition-fast,150ms) ease, filter var(--transition-fast,150ms) ease;
    font-weight: 400; /* keep solid weight for consistency */
}

/* Spacing helpers when icon precedes text */
.icon-inline { margin-right: .5rem; }
.nav-link .icon, .sidebar-menu-item .icon { margin-right: .75rem; }

/* Interactive states */
button:hover .icon, a:hover .icon, .sidebar-menu-item:hover .icon, .vertical-action-btn:hover .icon { 
    color: var(--icon-hover-color);
    transform: translateY(-2px) scale(1.08);
}
button:active .icon, a:active .icon, .vertical-action-btn:active .icon { transform: translateY(0) scale(0.95); }

/* ===== POSTS SYSTEM - BEAUTIFUL CARDS ===== */

#posts-container {
    display: flex;
    flex-direction: column;
    /* Small vertical rhythm between posts */
    gap: 0.5rem;
    width: 100%;
    padding-bottom: var(--space-12, 3rem);
}
@media (min-width: 768px) {
    #posts-container { gap: 0.75rem; }
}

html {
    scroll-behavior: smooth;
}

/* Stunning Post Card Design */
.post-card {
    --post-card-radius: var(--radius-unified, 14px);
    --post-font-size: var(--post-font-size, 0.9rem);
    background: var(--gradient-surface);
    border-radius: var(--post-card-radius);
    border: 0.2px solid rgba(58,175,169,0.28);
    /* Rely on container gap for spacing between cards */
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: 0 14px 40px -18px rgba(23,37,42,0.35), 0 6px 18px -4px rgba(23,37,42,0.18), 0 2px 4px rgba(23,37,42,0.08);
    width: 100%;
    max-width: 100%;
    transition: transform .4s cubic-bezier(.4,.2,.2,1), box-shadow .4s ease, border-color .4s ease;
    backdrop-filter: blur(22px) saturate(140%);
}

/* ================= POST CREATION AREA ENHANCEMENTS ================= */
#post-creation-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(179,229,252,0.85) 100%);
    backdrop-filter: blur(22px) saturate(160%);
    border: 0.2px solid rgba(58,175,169,0.18);
    box-shadow: 0 12px 40px -6px rgba(23,37,42,0.18), 0 2px 8px rgba(23,37,42,0.08);
    overflow: hidden;
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(.4,.2,.2,1);
    z-index: 1;
}

/* Mood-specific background will be applied via JavaScript */
#post-creation-card.mood-selected {
    backdrop-filter: blur(22px) saturate(180%);
    box-shadow: 0 16px 48px 0 rgba(0,0,0,0.18), 0 2px 8px rgba(23,37,42,0.10);
}

/* Subtle glassy overlay */
#post-creation-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.18) 0%, rgba(58,175,169,0.08) 100%);
    opacity: .18;
    pointer-events: none;
    mix-blend-mode: lighten;
}

/* Soft highlight sweep */
#post-creation-card::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.45), rgba(255,255,255,0) 60%);
    opacity: .28;
    animation: postCardGlow 9s linear infinite;
    pointer-events: none;
}

@keyframes postCardGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Attachment icons group */
/* Fancy icon button group */
.post-creation-header .flex > .flex {
    background: rgba(58,175,169,0.10);
    padding: .5rem .75rem;
    border-radius: 2rem;
    border: 0.2px solid rgba(58,175,169,0.18);
    backdrop-filter: blur(8px);
    gap: .4rem;
    box-shadow: 0 2px 8px rgba(58,175,169,0.08);
}

/* Fancy circular icon buttons */
.fancy-btn {
    background: linear-gradient(135deg, #fff 60%, #e3f2fd 100%);
    border: 1.5px solid #b2ebf2;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(58,175,169,0.10);
    transition: transform 0.18s, box-shadow 0.18s;
    cursor: pointer;
}
.fancy-btn:hover {
    transform: scale(1.12) rotate(-6deg);
    box-shadow: 0 4px 16px rgba(58,175,169,0.18);
    background: linear-gradient(135deg, #e3f2fd 60%, #fff 100%);
}

/* Mood Buttons Row */
.universal-mood-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Mood Button Style */
.universal-mood-btn {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    color: #fff;
    font-weight: 400;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    outline: none;
    position: relative;
    background: var(--mood-color, #b2ebf2);
    z-index: 1;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.universal-mood-btn:hover, .universal-mood-btn.selected {
    transform: scale(1.18) rotate(-4deg);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    border-color: #fffbe7;
    z-index: 2;
}
.universal-mood-btn.selected {
    outline: 2.5px solid #fffbe7;
    outline-offset: 2px;
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%   { transform: scale(1.18) rotate(-4deg); }
    30%  { transform: scale(1.28) rotate(2deg); }
    60%  { transform: scale(1.10) rotate(-2deg); }
    100% { transform: scale(1.18) rotate(-4deg); }
}

.header-media-btn { /* normalize icon buttons */
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    color: var(--primary-medium,#2B7A78);
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
.header-media-btn .icon, .header-media-btn i { font-size: 1.1rem; }
.header-media-btn::after { /* subtle ring */
    content: ""; position:absolute; inset:0; border-radius:50%; border: 0.2px solid transparent; transition: border-color .35s ease; }
.header-media-btn:hover { background: rgba(150,47,191,0.12); color: var(--primary-dark,#D6249F); transform: translateY(-2px); }
.header-media-btn:hover::after { border-color: rgba(58,175,169,0.35); }
.header-media-btn:active { transform: scale(.92); }

/* Enhanced Share Post button (primary CTA) */
/* Share Post button — remove continuous/flashy animations for a calmer UX */
#submit-post.btn-primary, #submit-post.btn {
    --_grad1: #962FBF; --_grad2: #D6249F; --_grad3: #F58529;
    position: relative;
    background: linear-gradient(120deg, var(--_grad1), var(--_grad2) 55%, var(--_grad3));
    background-size: 100% 100%;
    color: #fff;
    font-weight: 400;
    letter-spacing: .07em;
    text-transform: uppercase;
    border: 0.2px solid rgba(255,255,255,0.4);
    height: 3.25rem;
    font-size: 0.95rem;
    border-radius: var(--radius-unified);
    box-shadow: 0 6px 22px -6px rgba(58,175,169,0.55), 0 2px 10px -2px rgba(23,37,42,0.25);
    overflow: hidden;
    transition: box-shadow .25s ease;
}
#submit-post.btn-primary:hover { box-shadow: 0 10px 28px -10px rgba(150, 47, 191, 0.3), 0 6px 16px -4px rgba(214, 36, 159, 0.45); }
#submit-post.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 60%);
    mix-blend-mode: overlay;
    opacity: .55;
    pointer-events: none;
}
/* Remove animated sweep stripe */
#submit-post.btn-primary::after {
    content: none;
    display: none;
}
@keyframes ctaSweep {
    0%, 55% { transform: skewX(-25deg) translateX(-120%); }
    70% { transform: skewX(-25deg) translateX(260%); }
    100% { transform: skewX(-25deg) translateX(260%); }
}
#submit-post.btn-primary:hover { background-position: 100% 0; box-shadow: 0 10px 28px -10px rgba(150, 47, 191, 0.3), 0 6px 16px -4px rgba(214, 36, 159, 0.45); transform: translateY(-2px); }
#submit-post.btn-primary:active { transform: translateY(0) scale(.95); }
#submit-post.btn-primary:active { box-shadow: 0 6px 22px -6px rgba(214, 36, 159, 0.55), 0 2px 10px -2px rgba(150, 47, 191, 0.25); }
#submit-post.btn-primary::after { filter: none; }
/* Remove continuous breathing glow */
@keyframes ctaGlowPulse { 0%,100% { } 50% { } }
#submit-post.btn-primary { animation: none; }
@media (prefers-reduced-motion: reduce) { #submit-post.btn-primary { animation: none; } }

/* Accessible focus */
#submit-post.btn-primary:focus-visible, .header-media-btn:focus-visible {
    outline: 3px solid rgba(58,175,169,0.55);
    outline-offset: 2px;
}

/* Override extra rocket emoji/animation declared earlier to keep CTA clean */
#submit-post::before { content: none; animation: none; }

.post-card:hover {
    box-shadow: 0 22px 60px -25px rgba(23,37,42,0.45), 0 10px 28px -8px rgba(23,37,42,0.28), 0 4px 10px rgba(23,37,42,0.12);
    transform: translateY(-6px);
    border-color: var(--grad-deep-mid);
}

/* Two Column Post Layout - Compact & Dynamic */
.post-card-layout {
    display: flex;
    flex-direction: row;
    min-height: auto; /* Dynamic height based on content */
    align-items: stretch;
    position:relative;
}

.post-main-content {flex:1;display:flex;flex-direction:column;min-width:0;min-height:auto;padding:0;} /* full bleed; padding handled by internal sections */

.post-sidebar {position:static; inset:auto; transform:none; width:100%; display:flex; flex-direction:row; align-items:center; justify-content:stretch; padding:.2rem; margin:.2rem 0 .25rem 0; z-index:auto; pointer-events:auto; background:transparent; border:none; border-radius:0; box-shadow:none;}

/* Responsive adjustments for horizontal post sidebar */
@media (max-width: 1024px) {
    .post-sidebar { padding: .4rem .6rem; }
    .post-sidebar .vertical-actions-stack { gap: .6rem; }
    .post-sidebar .vertical-action-btn { padding: .4rem .5rem; min-width: 44px; }
}

@media (max-width: 768px) {
    .post-sidebar { padding: .35rem .5rem; }
    .post-sidebar .vertical-actions-stack { gap: .5rem; }
    .post-sidebar .vertical-action-btn { padding: .35rem .4rem; min-width: 40px; }
}
.post-sidebar .vertical-actions-stack{pointer-events:auto;}

/* Elegant Action Buttons */
.vertical-actions-stack {display:flex;flex-direction:row;align-items:center;gap:.65rem;padding:.55rem .5rem;background:transparent;border:none;box-shadow:none;}

/* Overlay variant: crisp buttons inside floating white sidebar */
.post-sidebar .vertical-actions-stack { gap: .5rem; padding: 0; width:100%; display:grid; grid-template-columns: repeat(3, 1fr); align-items:center; }
.post-sidebar .vertical-action-btn { background:#ffffff; border:none; border-radius:10px; box-shadow:0 2px 6px rgba(23,37,42,.08); padding:.35rem .5rem; min-width:0; width:100%; display:flex; flex-direction:row; align-items:center; justify-content:center; gap:.4rem; transition:background .25s ease,box-shadow .25s ease,transform .2s ease,color .25s ease; }
/* Keep counts inline without extra vertical spacing in the compact bar */
.post-sidebar .vertical-action-btn .action-count { margin-top: 0; }
.post-sidebar .vertical-action-btn:hover { background:#ffffff; transform:translateY(-2px); box-shadow:0 6px 14px rgba(23,37,42,.12); }
.post-sidebar .vertical-action-btn:active { transform:translateY(0) scale(.96); background:#ffffff; box-shadow:0 3px 10px rgba(23,37,42,.10); }
.post-sidebar .vertical-action-btn .icon { font-size:1.05rem; width:1.5rem; height:1.5rem; border:0; background:transparent; box-shadow:none; color:#0b0b0b; text-shadow:none; }
.post-sidebar .vertical-action-btn .action-count { color:#0b0b0b; font-weight: 400; font-size:.7rem; text-shadow:none; }
.post-sidebar .vertical-action-btn:hover .icon { color:#429E9D; transform: scale(1.05); }
.post-sidebar .vertical-action-btn:hover .action-count { color:#1b2a2e; }
.post-sidebar .vertical-action-btn.like-btn .icon,
.post-sidebar .vertical-action-btn.comment-btn .icon,
.post-sidebar .vertical-action-btn.share-btn .icon { color:#0b0b0b; }
.post-sidebar .vertical-action-btn:hover.like-btn .icon,
.post-sidebar .vertical-action-btn:hover.comment-btn .icon,
.post-sidebar .vertical-action-btn:hover.share-btn .icon { color:#429E9D; }

.vertical-action-btn {background:linear-gradient(160deg,rgba(18,34,40,0.55) 0%,rgba(18,34,40,0.48) 70%,rgba(18,34,40,0.42) 100%);backdrop-filter:blur(10px) saturate(160%);-webkit-backdrop-filter:blur(10px) saturate(160%);border: 0.2px solid rgba(255,255,255,0.12);display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.45rem .5rem;cursor:pointer;transition:background .35s ease,box-shadow .35s ease,transform .25s ease,border-color .35s ease; border-radius:var(--post-card-radius); box-shadow:0 3px 10px -4px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.3);min-width:50px;}

.vertical-action-btn:hover {background:linear-gradient(160deg,rgba(18,34,40,0.68) 0%,rgba(18,34,40,0.6) 70%,rgba(18,34,40,0.5) 100%);border-color:rgba(255,255,255,0.22);transform:translateY(-3px);box-shadow:0 8px 20px -8px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.1);}

.vertical-action-btn:active {transform:translateY(0) scale(.94);background:linear-gradient(160deg,rgba(12,26,32,0.7) 0%,rgba(14,30,36,0.62) 100%);box-shadow:0 4px 12px -6px rgba(0,0,0,.65),0 0 0 1px rgba(255,255,255,.12);}

.vertical-action-btn .icon {
    position: relative;
}

.vertical-action-btn .icon::after {
    content:"";
    position:absolute; inset:-4px; border: 0.2px solid rgba(255,255,255,0.18); border-radius:var(--post-card-radius); pointer-events:none; opacity:0; transition:opacity .3s ease;
}
.vertical-action-btn:hover .icon::after { opacity:1; }

/* Beautiful Icons with Fallbacks */
.vertical-action-btn .icon {font-size:1.15rem;line-height:1;display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:.05rem;border-radius:.55rem;background:linear-gradient(145deg,rgba(255,255,255,0.1),rgba(255,255,255,0));border: 0.2px solid rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(255,255,255,.18);margin:0;color:#ffffff;transition:color .3s ease, filter .3s ease, box-shadow .3s ease, background .3s ease; text-shadow:0 1px 3px rgba(0,0,0,.55);}

/* Specific accent colors */
.vertical-action-btn.like-btn .icon {color:#ff5c8a;}
.vertical-action-btn.comment-btn .icon {color:#4fd8d1;}
.vertical-action-btn.share-btn .icon {color:#ffd36b;}
.vertical-action-btn:hover.like-btn .icon {color:#ff7ca1;box-shadow:0 0 0 2px rgba(255,92,138,.35),0 0 10px 2px rgba(255,92,138,.4);}
.vertical-action-btn:hover.comment-btn .icon {color:#6ff0e8;box-shadow:0 0 0 2px rgba(79,216,209,.35),0 0 10px 2px rgba(79,216,209,.4);}
.vertical-action-btn:hover.share-btn .icon {color:#ffe08f;box-shadow:0 0 0 2px rgba(255,211,107,.35),0 0 10px 2px rgba(255,211,107,.45);}

/* High contrast counts */
.vertical-action-btn .action-count {color:#fff;font-weight: 400;font-size:.7rem;text-shadow:0 1px 2px rgba(0,0,0,.55);} 

/* Icon Fallbacks */
.vertical-action-btn .fa-heart.icon::before, .vertical-action-btn .fa-heart::before {
    content: "♥";
}

.vertical-action-btn .fa-comment-alt.icon::before, .vertical-action-btn .fa-comment-alt::before {
    content: "💬";
}

.vertical-action-btn .fa-share.icon::before, .vertical-action-btn .fa-share::before {
    content: "🔗";
}

/* FontAwesome Icons */
.fa-heart::before {
    content: "\f004";
}

.fa-comment-alt::before {
    content: "\f27a";
}

.fa-share::before {
    content: "\f064";
}

/* Action Counts */
.action-count {
    font-size: var(--post-font-size, 0.9rem);
    color: var(--primary-dark, #2B7A78);
    font-weight: 400;
    text-align: center;
    line-height: 1;
    margin-top: var(--space-1, 0.25rem);
}

/* Beautiful Hover Effects */
.vertical-action-btn:hover .icon {
    color: var(--primary-dark, #2B7A78);
    transform: scale(1.1);
}

.vertical-action-btn:hover .action-count {
    color: var(--primary-darkest, #17252A);
    font-weight: 400;
}

/* Specific Button Hover Colors */
.vertical-action-btn[data-action="like"]:hover .icon {
    color: var(--error, #DC2626);
}

.vertical-action-btn[data-action="like"]:hover .action-count {
    color: var(--error, #DC2626);
}

.vertical-action-btn[data-action="comment"]:hover .icon {
    color: var(--primary-light, #3AAFA9);
}

.vertical-action-btn[data-action="comment"]:hover .action-count {
    color: var(--primary-light, #3AAFA9);
}

.vertical-action-btn[data-action="share"]:hover .icon {
    color: var(--success, #059669);
}

.vertical-action-btn[data-action="share"]:hover .action-count {
    color: var(--success, #059669);
}



/* ===== BEAUTIFUL POST HEADER SYSTEM - COMPACT ===== */

.post-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem; /* Much smaller padding */
    border-bottom: 1px solid var(--primary-lightest, #DEF2F1);
    background: 
        linear-gradient(135deg, 
            rgba(58, 175, 169, 0.08) 0%, 
            rgba(43, 122, 120, 0.05) 50%, 
            rgba(23, 37, 42, 0.03) 100%
        );
    border-radius: var(--post-card-radius) var(--post-card-radius) 0 0;
}

/* Elegant Avatar */
.post-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full, 50%);
    margin-right: var(--space-3, 0.75rem);
    border: 0.2px solid var(--primary-light, #3AAFA9);
    background: var(--primary-lightest, #DEF2F1);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all var(--transition-base, 200ms) ease;
    box-shadow: 0 2px 8px rgba(58, 175, 169, 0.15);
}

.post-avatar:hover {
    transform: scale(1.05);
    border-color: var(--primary-medium, #2B7A78);
    box-shadow: 0 4px 12px rgba(43, 122, 120, 0.25);
}

/* Header Content */
.post-header-content {
    flex-grow: 1;
    color: var(--post-header-text, inherit);
}

.post-username {
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    color: var(--post-header-text, var(--primary-darkest, #17252A));
    line-height: 1.2;
    margin-bottom: .15rem;
    letter-spacing: .01em;
}

.post-meta {
    font-size: var(--post-font-size, 0.9rem);
    color: var(--post-header-text, var(--primary-medium, #2B7A78));
    font-weight: 400;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ===== BEAUTIFUL POST CONTENT - COMPACT & DYNAMIC ===== */

.post-content-area {
    /* Slightly reduced bottom padding to tighten footer area */
    padding: 0.75rem 84px 0.75rem 1rem; /* add right space only here for floating actions */
    flex-grow: 1;
    background: var(--accent-white, #FEFFFF);
    min-height: auto; /* Allow dynamic height */
    border-radius: 0 0 var(--post-card-radius) var(--post-card-radius);
}

.post-content-text {
    font-size: 11px;
    line-height: 1.5; /* Slightly tighter line height */
    color: #000000;
    margin-bottom: 0.5rem; /* Slightly tighter */
    white-space: pre-wrap;
    word-wrap: break-word;

    /* Dynamic height based on content */
    max-height: none;
    overflow: visible;

    /* Responsive text sizing */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow-wrap: break-word;
}







/* Post Header Styling */
.post-header {display:flex;align-items:center;padding:1rem;border-bottom:1px solid rgba(100,181,246,0.25);background:var(--post-header-bg,transparent);border-radius:var(--post-card-radius) var(--post-card-radius) 0 0;color:var(--post-header-text,#fff);} 
/* Inline tiny edit/delete controls */
.post-owner-inline-actions {display:flex;gap:.4rem;margin-top:.4rem;}
.post-inline-btn {background:rgba(0,0,0,0.35);border: 0.2px solid rgba(255,255,255,0.25);color:#fff;padding:.25rem .45rem;display:inline-flex;align-items:center;justify-content:center;font-size:.6rem;line-height:1;border-radius:.45rem;cursor:pointer;backdrop-filter:blur(4px);transition:background .25s ease,transform .25s ease,border-color .25s ease,color .25s ease;}
.post-inline-btn i {font-size:.7rem;line-height:1;}
.post-inline-btn:hover {background:rgba(0,0,0,0.55);border-color:rgba(255,255,255,0.4);transform:translateY(-2px);} 
.post-inline-btn:active {transform:translateY(0) scale(.93);} 
.post-inline-btn.edit-post-inline {color:#7cd9ff;}
.post-inline-btn.delete-post-inline {color:#ff8b8b;}
.post-inline-btn.edit-post-inline:hover {color:#b2ecff;}
.post-inline-btn.delete-post-inline:hover {color:#ffc1c1;}

.post-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 0.2px solid rgba(255, 255, 255, 0.3);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-avatar:hover {
    transform: scale(1.05);
}

.post-header-content {
    flex-grow: 1;
    display: flex;
    flex-direction: row; /* single row layout */
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap; /* allow wrapping on narrow screens */
}

.post-username {
    font-weight: 400;
    font-size: var(--post-font-size, 0.95rem);
    font-family: var(--font-primary, 'Inter'), sans-serif;
    color: #000000; /* black text over colored header */
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.post-username:hover {
    opacity: 0.8;
}

.post-meta {
    font-size: .8rem;
    color: #000000; /* black text over colored header */
    opacity: 0.85;
    margin-top: 0; /* inline with username */
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

/* Make header internals transparent; keep header's own background color
    Important: only clear background-color to avoid wiping background-image on elements like .post-avatar */
.post-header * { background-color: transparent; }
.post-avatar { border-color: #00000033; }
.post-tag-pill { background: transparent; color: #000; border: 0.2px solid #000; }

.post-actions-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Post Content Area - Compact Version */
.post-content-area {
    /* Make padding symmetric so media centers naturally */
    padding: 0.75rem 1rem; /* previously: 0.75rem 84px 0.75rem 1rem */
    flex-grow: 1;
    background: white;
    min-height: auto; /* Dynamic height */
    border-radius: 0 0 var(--post-card-radius) var(--post-card-radius);
}

.post-content-text {
    font-size: 11px;
    line-height: 1.5; /* Tighter line height */
    color: #000000;
    margin-bottom: 0.5rem; /* tighter to avoid big gap before shares */
}

.image-preview-container {
    /* Normalize: let sibling rule control spacing */
    margin: 0 auto;
    margin-top: 0;
    border-radius: var(--post-card-radius);
    overflow: hidden;
    /* Reserve space to prevent CLS before image natural size is known */
    aspect-ratio: 16 / 9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview {
    width: 100%;
    height: auto;
    display: block;
}

/* Ensure post images don’t take over the feed */
.post-card .image-preview {
    max-height: 360px; /* desktop default */
    width: 100%;
    height: auto;
    object-fit: contain; /* keep full image visible */
}

/* Comments attached images */
.comment-image {
    max-width: 100%;
    height: auto;
    max-height: 240px;
    display: block;
    border-radius: 8px;
    /* Provide a reasonable default aspect ratio placeholder to avoid layout shift */
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

/* Tweak for narrower screens */
@media (max-width: 1024px) {
    .post-card .image-preview { max-height: 300px; }
}
@media (max-width: 768px) {
    .post-card .image-preview { max-height: 220px; }
    .comment-image { max-height: 180px; }
}

/* Consistent, small gaps between content blocks within a post */
.post-content-area > * + * { margin-top: 0.5rem; }

/* Avoid double spacing when utilities like mt-3 are present */
.post-content-area > .card.mt-3 { margin-top: 0; }
.post-content-area > .card.mt-2 { margin-top: 0; }
.post-content-area > .card.mt-1 { margin-top: 0; }
.post-content-area > .image-preview-container:first-child { margin-top: 0; }

.shared-card {
    padding: 0;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Ensure media blocks fill available width and center inside post content */
.post-content-area .image-preview-container,
.post-content-area .video-preview-container,
.post-content-area .video-container,
.post-content-area .post-image-preview,
.post-content-area .shared-card {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.post-content-area .image-preview,
.post-content-area video,
.post-content-area img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Enhanced Commentary Card Styles */
.enhanced-commentary {
    border: 0.2px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.enhanced-commentary:hover {
    border-color: #d1d5db;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Commentary Header */
.commentary-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.commentary-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.commentary-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.commentary-icon {
    font-size: 18px;
    color: white;
}

.commentary-label {
    flex: 1;
}

.commentary-action {
    font-weight: 400;
    font-size: 14px;
    display: block;
    margin-bottom: 0.25rem;
}

.commentary-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--post-font-size, 0.9rem);
    opacity: 0.9;
}

.original-author {
    font-weight: 400;
}

.time-separator {
    opacity: 0.7;
}

.original-time {
    font-variant-numeric: tabular-nums;
}

/* Visual Separator */
.commentary-separator {
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    position: relative;
}



.shared-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.shared-card-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    letter-spacing: 0.01em;
}

.shared-card-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.shared-card-author { font-weight: 400; }
.shared-card-time { font-variant-numeric: tabular-nums; }
.shared-card-divider { opacity: 0.7; }

.shared-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 0.2px solid currentColor;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.shared-card-header .shared-card-chip {
    background-color: rgba(255, 255, 255, 0.12);
}

.shared-card-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shared-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 11px;
    opacity: 0.85;
}

.shared-card-description {
    margin-top: 0.5rem;
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.45;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-card-description + .shared-card-description { margin-top: 0.25rem; }

.shared-card-entities {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.shared-card-entity { font-weight: 400; }

.shared-card-team-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.shared-card-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.shared-card-actions.align-end { justify-content: flex-end; }

.shared-card-thumbnail {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.shared-card-thumbnail--small {
    width: 56px;
    height: 56px;
    border-radius: 10px;
}

.shared-card-headline {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.shared-card--commentary .shared-card-description,
.shared-card--article .shared-card-description {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.shared-card--sports .shared-card-description {
    font-style: normal;
    color: #1f2937;
}

.shared-card-meta-row i { margin-right: 0.25rem; }

.pill-link { text-decoration: none; }

.shared-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.shared-card-tags .shared-card-chip,
.shared-card-meta-row .shared-card-chip {
    font-size: 0.7rem;
}

/* Mobile inline actions row: add a slight buffer from content */
.post-actions-row { margin-top: 0.5rem; }

/* Search overlay: matched term highlight */
.gso-highlight { background: #fff3b0; color: inherit; padding: 0 .08em; border-radius: 2px; }

/* Generic pill utility (used for recent searches) */
.pill {
    display: inline-flex; align-items: center; gap: .25rem;
    background: var(--surface-2, #f3f4f6);
    color: inherit; border: 0.2px solid var(--border, #e5e7eb);
    padding: .25rem .6rem; border-radius: 999px; cursor: pointer;
    line-height: 1.2; transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.pill:hover { background: var(--surface-3, #e5e7eb); }
.pill:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce){ .pill { transition: none; } }

/* Chat image preview sizing to avoid sudden jumps */
.chat-image-preview {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1 / 1; /* square placeholder */
    object-fit: contain;
}

/* Messaging inline images */
.message-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

/* ===== ELEGANT COMMENTS SYSTEM - CLICK TO EXPAND ===== */

 .comments-section {
    /* Fully collapsed: remove background & border to eliminate thin strip */
    background: transparent;
    border-top: 0;
    overflow: hidden;
    max-height: 0; /* Hidden by default */
    transition: max-height 0.4s ease-out, background .25s ease, border-top-color .25s ease;
    border-radius: 0 0 var(--post-card-radius) var(--post-card-radius);
    margin: 0;
    padding: 0; /* ensure no height */
}

 .comments-section.open {
    background: linear-gradient(180deg, var(--primary-lightest, #DEF2F1) 0%, var(--accent-white, #FEFFFF) 100%);
    border-top: 1px solid rgba(58,175,169,0.25);
    max-height: 2000px;
    overflow: visible;
    padding-top: .25rem; /* small breathing space when revealed */
}

.comments-container {
    padding: 1rem; /* Compact but readable */
    margin: 0;
}

/* Beautiful Comments Header */
.comments-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(58, 175, 169, 0.2);
}

.comments-header h4 {
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    color: var(--primary-darkest, #17252A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

/* ========== Centralized Overlays & Modals ========== */
/* Thread Viewer Overlay */
#thread-viewer { display:none; position:fixed; inset:0; z-index:5000; background:rgba(0,0,0,0.65); }
#thread-viewer .viewer-root { position:absolute; inset:0; display:flex; flex-direction:column; }
#thread-viewer .viewer-header { display:none; align-items:center; gap:.5rem; padding:.5rem; background:#ffffff; border-bottom:1px solid rgba(0,0,0,0.08); }
#thread-viewer .viewer-header .viewer-title { font-weight: 400; color:#0f172a; }
#thread-viewer-scroll { flex:1; overflow:auto; -webkit-overflow-scrolling:touch; }
#thread-viewer-content { max-width:min(100%, 980px); margin: 0 auto; padding: 1rem; }

/* Comment Modal */
#comment-modal { display:none; position:fixed; inset:0; z-index:5500; background: rgba(0,0,0,0.55); }
#comment-modal-dialog { position:absolute; left:50%; top:50%; transform:translate(-50%, -50%); width:auto; min-width:1800px; max-width:95vw; background:#fff; border-radius:24px; box-shadow:0 20px 60px rgba(0,0,0,0.3); overflow:hidden; border: 0.2px solid #000; }
#comment-modal-dialog .modal-header { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding: 1rem 1.25rem; border-bottom:1px solid rgba(0,0,0,0.08); background:linear-gradient(180deg, #ffffff, #fafafa); }
#comment-step-1, #comment-step-2, #comment-step-3 { padding: 1rem 1.25rem; max-height: 70vh; overflow:auto; }
#comment-step-2, #comment-step-3 { display:none; }
#comment-mood-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
#comment-type-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
#comment-modal h3 { font-weight: 400; color:#0f172a; margin-bottom:.5rem; }
#comment-tag-wrapper small { color:#555; font-size:0.65rem; line-height:1.2; }

/* Comment modal typography and small elements */
#comment-modal-title { font-weight: 400; letter-spacing: .2px; color: #0f172a; }
#comment-modal .helper-text { margin-bottom: .5rem; font-size: .75rem; opacity: .7; }
#comment-modal .hint-text { margin: -.25rem 0 .75rem; font-size: .75rem; opacity: .7; }
#comment-modal-preview { margin-bottom: .75rem; }
#comment-modal .back-btn { background: none; border: 0.2px solid #000; color: #111; margin-bottom: .75rem; }
#comment-modal .footer-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }
#comment-modal-submit { background:#10b981; border: 0.2px solid #000; color:#fff; font-weight: 400; }

/* Post Modal */
#post-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99999; align-items: center; justify-content: center; padding: 2rem; }
#post-modal-content { background: #FFFFFF; border-radius: 1.5rem; width: auto; min-width: 680px; max-width: 800px; max-height: 85vh; box-shadow: 0 20px 60px rgba(0,0,0,0.3); padding: 2rem; position: relative; overflow-y: auto; border: 0.2px solid #000000; margin: 0 auto; }
#close-post-modal { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; color: #000000; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s; }
#post-modal h2 { margin-bottom: 1.5rem; color: #000000; font-size: 1.5rem; font-weight: bold; }
#post-step-2, #post-step-3 { display: none; }
#post-modal .back-link { background: none; border: none; color: #6E6E6E; cursor: pointer; font-size: 14px; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; transition: color 0.2s; }
#post-modal .back-link:hover { color: #000; }
#post-input-area { margin-bottom: 1.5rem; }
#post-tag-wrapper { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
#post-tag-wrapper label { font-weight: 400; font-size: var(--post-font-size, 0.9rem); color: #111; }
#post-tag-input { border: 0.2px solid #000; border-radius:0.5rem; padding:0.65rem 0.9rem; outline:none; font-size:0.95rem; }
#post-tag-suggestions { display:flex; flex-wrap:wrap; gap:0.4rem; }
.tag-suggestion-btn, .comment-tag-suggestion-btn { background:#f3f4f6; border: 0.2px solid #000; padding:0.35rem 0.7rem; border-radius:1rem; font-size: 11px; cursor:pointer; }
#post-modal .actions-row { display: flex; gap: 1rem; justify-content: flex-end; }
#cancel-post { background: #FFFFFF; color: #000000; border: 0.2px solid #000000; padding: 0.75rem 1.5rem; border-radius: 0.5rem; cursor: pointer; transition: background 0.2s; }
#cancel-post:hover { background: #F5F5F5; }
#submit-post { background: #429E9D; color: #FFFFFF; border: 0.2px solid #000000; padding: 0.75rem 1.5rem; border-radius: 0.5rem; cursor: pointer; font-weight: bold; transition: filter 0.2s; }
#submit-post:hover { filter: brightness(0.95); }
#close-post-modal:hover { background:#f3f4f6; }

/* Fullscreen variant */
#post-modal-content.modal-fullscreen { position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: min(2.5rem, 4vw); border: 0; }
/* Ensure composer text is readable */
#post-modal textarea,
#post-modal input[type="text"],
#post-modal [contenteditable="true"] { color: #000; }

/* Individual Comments - Improved Formatting */
.comments-list {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Space between comments */
}

.comment-item {
    margin-bottom: 0;
    border-radius: var(--post-card-radius);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(58, 175, 169, 0.08);
    border: 0.2px solid rgba(58, 175, 169, 0.1);
    transition: all var(--transition-base, 200ms) ease;
    /* Allow mood-based background colors - removed fixed background */
    /* background: var(--accent-white, #FEFFFF); */
}

.comment-item:hover {
    box-shadow: 0 4px 10px rgba(58, 175, 169, 0.15);
    border-color: rgba(58, 175, 169, 0.2);
    transform: translateY(-1px);
}

/* Comment Header with Dynamic Mood Colors */
.comment-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    color: var(--accent-white, #FEFFFF);
    font-weight: 400;
    /* Allow parent comment background to show through */
    background: transparent;
}


.comment-avatar {
    width: 24px; /* Smaller for better proportion */
    height: 24px;
    border-radius: var(--radius-full, 50%);
    border: 0.2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    background: var(--primary-lightest, #DEF2F1);
    transition: all var(--transition-fast, 150ms) ease;
    flex-shrink: 0;
}

.comment-avatar:hover {
    transform: scale(1.05);
    border-color: var(--accent-white, #FEFFFF);
}

.comment-username {
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    cursor: pointer;
    transition: opacity var(--transition-fast, 150ms) ease;
    flex: 1;
}

.comment-username:hover {
    opacity: 0.9;
}

.comment-mood-info {
    font-size: var(--post-font-size, 0.9rem);
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.comment-content-area {
    padding: 0.75rem;
    /* Allow parent comment background to show through */
    background: transparent;
}

.comment-text {
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.5;
    color: var(--text-secondary, #374151);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== BEAUTIFUL ADD COMMENT FORM - COMPACT ===== */

.add-comment-form {
    border-top: 1px solid rgba(58, 175, 169, 0.2);
    padding-top: 0.75rem;
    background: var(--accent-white, #FEFFFF);
    border-radius: 0 0 var(--post-card-radius) var(--post-card-radius);
}

.comment-input-section {
    margin-bottom: 0.75rem;
}

.comment-textarea {
    width: 100%;
    min-height: 60px; /* Smaller height */
    padding: 0.5rem;
    border: 0.2px solid var(--primary-lightest, #DEF2F1);
    border-radius: var(--post-card-radius);
    resize: vertical;
    font-size: var(--post-font-size, 0.9rem);
    font-family: var(--font-primary, 'Inter'), sans-serif;
    transition: all var(--transition-base, 200ms) ease;
    background: var(--accent-white, #FEFFFF);
    color: var(--text-primary, #1F2937);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-light, #3AAFA9);
    box-shadow: 0 0 0 3px rgba(58, 175, 169, 0.1);
    background: var(--accent-white, #FEFFFF);
}

.comment-mood-section {
    margin-bottom: 0.75rem;
}

.mood-selection-label {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    font-size: 11px;
    font-weight: 400;
    color: var(--primary-medium, #2B7A78);
    margin-bottom: 0.375rem;
}

.comment-mood-buttons-row {
    display: grid; /* Match universal mood row - use grid not flex */
    grid-template-columns: repeat(17, 1fr); /* 17 equal columns like universal */
    gap: 0; /* No gap like universal mood row */
    overflow: hidden; /* Match universal mood row */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* height determined by tile aspect-ratio */
    border-radius: var(--radius-lg, 1rem); /* Match universal border radius */
    border: 0.2px solid var(--primary-medium, #2B7A78); /* Match universal border */
    box-sizing: border-box; /* Match universal mood row */
    background: transparent; /* Match universal background */
    padding: 0; /* Match universal padding */
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(23, 37, 42, 0.1)); /* Match universal shadow */
}

.comment-mood-buttons-row::-webkit-scrollbar {
    display: none;
}

.comment-mood-button {
    display: flex; /* Match universal mood button display */
    align-items: center; /* Match universal mood button alignment */
    justify-content: center; /* Match universal mood button alignment */
    height: auto; /* Height from aspect-ratio */
    font-size: 0.54rem; /* Match universal mood button font size exactly */
    font-weight: 400;
    color: var(--accent-white, #FEFFFF); /* White text like universal */
    text-shadow: 0 1px 3px rgba(23, 37, 42, 0.5); /* Match universal text shadow */
    cursor: pointer;
    transition: all var(--transition-base, 200ms) ease;
    border: none; /* Remove borders like universal mood buttons */
    padding: 0; /* Match universal mood button padding */
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-family: var(--font-primary, 'Inter'), sans-serif;
    letter-spacing: -0.01em;
    border-radius: 0; /* No individual button border radius in grid */
    position: relative;
    z-index: 10;
}

.comment-mood-button:hover {
    transform: scale(1.05); /* Match universal mood button hover */
    z-index: 15;
    box-shadow: 0 4px 12px rgba(23, 37, 42, 0.3);
    filter: brightness(1.1);
}

.comment-mood-button.selected {
    transform: scale(1.1); /* Match universal mood button selected */
    z-index: 20;
    box-shadow: 0 8px 20px rgba(23, 37, 42, 0.4);
    filter: brightness(1.2);
    border: 0.2px solid rgba(255, 255, 255, 0.8);
}

/* Hover and selected states for global feed mood buttons - match universal mood row */
.mood-buttons-row .universal-mood-btn:hover,
.news-mood-btn:hover {
    transform: scale(1.05); /* Match universal mood button hover scale */
    filter: brightness(1.1); /* Slight brightness increase on hover */
    z-index: 15; /* Lift above other buttons */
    box-shadow: 0 4px 12px rgba(23, 37, 42, 0.3);
}

.mood-buttons-row .universal-mood-btn.selected,
.news-mood-btn.selected {
    transform: scale(1.08); /* Match universal mood button selected scale */
    filter: brightness(1.2) contrast(1.1); /* Enhanced brightness for selected state */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 20; /* Highest priority for selected button */
    border: 0.2px solid rgba(255, 255, 255, 0.8);
}

/* Active state for immediate feedback */
.mood-buttons-row .universal-mood-btn:active,
.news-mood-btn:active {
    transform: scale(0.98); /* Match universal mood button active scale */
    filter: brightness(0.95);
}

.selected-comment-mood-indicator {
    margin-top: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem);
    background: var(--primary-lightest, #DEF2F1);
    border-radius: var(--post-card-radius);
    font-size: var(--post-font-size, 0.9rem);
    text-align: center;
    color: var(--primary-medium, #2B7A78);
    border: 0.2px solid rgba(58, 175, 169, 0.2);
}

/* Beautiful Post Comment Button */
.post-comment-button {
    background: 
        linear-gradient(135deg, 
            var(--primary-light, #3AAFA9) 0%, 
            var(--primary-medium, #2B7A78) 100%
        );
    color: var(--accent-white, #FEFFFF);
    border: none;
    border-radius: var(--post-card-radius);
    padding: var(--space-3, 0.75rem) var(--space-6, 1.5rem);
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    transition: all var(--transition-base, 200ms) ease;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(58, 175, 169, 0.2);
}

/* Fix for mood button interaction issues - ensure proper clickability */
.universal-mood-btn,
.comment-mood-button,
.news-mood-btn {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    z-index: 10;
    min-height: 28px;
    min-width: 28px;
}

/* Override any conflicting styles for universal mood buttons */
.universal-mood-btn {
    padding: 4px 6px; /* Override the padding: 0 that was preventing clicks */
}

/* Ensure comment mood buttons are definitely clickable */
.comment-mood-buttons-row {
    position: relative;
    z-index: 5;
}

/* ===== SPORTS LAYOUT (Reference Style) ===== */
.sports-layout {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
}

.sports-nav-bar {
    background: #4a5568;
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.nav-tabs {
    display: flex;
    gap: 32px;
}

.nav-tab {
    background: none;
    border: none;
    color: #cbd5e0;
    font-weight: 400;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
    letter-spacing: 0.05em;
}

.nav-tab:hover {
    color: #ffffff;
}

.nav-tab.active {
    color: #ffffff;
    border-bottom: 2px solid #ffffff;
}

.sports-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #f7fafc;
    min-height: 600px;
}

.sports-table-container {
    background: #ffffff;
    border: 0.2px solid #e2e8f0;
    padding: 0;
}

.table-title {
    background: #f7fafc;
    margin: 0;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 400;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
}

.sports-table {
    width: 100%;
}

.table-header {
    background: #f7fafc;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.col-team {
    text-align: left;
}

.col-stat {
    text-align: center;
    min-width: 40px;
}

.table-body {
    display: flex;
    flex-direction: column;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background-color 0.15s ease;
}

.table-row:hover {
    background: #f8fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row.live-row {
    background: #fef7f7;
    border-left: 3px solid #e53e3e;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.team-logo {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 0.2px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.team-initials {
    font-weight: 400;
    font-size: 0.7rem;
    color: #4a5568;
}

.team-badge-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-name {
    font-weight: 400;
    color: #2d3748;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-cell {
    text-align: center;
    font-weight: 400;
    color: #4a5568;
    font-size: var(--post-font-size, 0.9rem);
    min-width: 40px;
}

.stat-cell.live-score {
    color: #e53e3e;
    font-weight: 400;
}

.stat-cell.live-time {
    color: #e53e3e;
    font-weight: 400;
    font-size: 11px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sports-nav-bar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .nav-tabs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .sports-grid-layout {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        padding: 10px 16px;
    }
    
    .team-name {
        font-size: var(--post-font-size, 0.9rem);
    }
}

/* ===== SIDEBAR ENHANCEMENTS & UNIFIED GRADIENT APPLICATION ===== */
.matches-toolbar { display:flex; flex-direction:column; gap:12px; margin-bottom:12px; }
.matches-toolbar .toolbar-row { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; }
.date-chips { display:flex; gap:6px; }
.date-chip { background:#fff; border: 0.2px solid rgba(0,0,0,.08); color:#0f172a; font-weight: 400; padding:6px 10px; border-radius:10px; box-shadow:0 1px 2px rgba(0,0,0,.04); cursor:pointer; transition:all .2s ease; }
.date-chip:hover { transform:translateY(-1px); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.date-chip.active { background:linear-gradient(135deg, #ffffff, #f1f5f9); border-color:#429E9D; color:#0f172a; }
.filter-pills { display:flex; gap:6px; }
.filter-pill { background:#fff; border: 0.2px solid rgba(0,0,0,.08); color:#0f172a; font-weight: 400; padding:6px 12px; border-radius:9999px; box-shadow:0 1px 2px rgba(0,0,0,.04); cursor:pointer; transition:all .2s ease; }
.filter-pill:hover { transform:translateY(-1px); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.filter-pill.active { background:#429E9D; color:#ffffff; border-color:#000; }

.matches-list { display:flex; flex-direction:column; gap:14px; }
.league-group { background:linear-gradient(180deg,#ffffff,#fafafa); border: 0.2px solid rgba(0,0,0,.06); border-radius:14px; overflow:hidden; }
.league-header { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; background:linear-gradient(135deg, rgba(67,160,159,0.06), rgba(23,37,42,0.03)); border-bottom:1px solid rgba(2,6,23,0.06); }
.league-title { font-weight: 400; color:#0f172a; letter-spacing:.02em; text-transform:none; }
.league-action { color:#1e40af; font-weight: 400; font-size:.85rem; text-decoration:none; }
.league-matches { display:flex; flex-direction:column; }

.match-row { display:grid; grid-template-columns: 88px 1fr; align-items:stretch; padding:6px 10px; border-bottom:1px solid rgba(0,0,0,.045); }
.match-row:last-child { border-bottom:none; }
.match-row.is-live { background:rgba(254,242,242,0.7); }
.match-row.is-finished { background:rgba(240,249,255,0.5); }
.match-meta { display:flex; align-items:center; justify-content:center; }
.status-badge { font-size:.75rem; font-weight: 400; padding:4px 8px; border-radius:9999px; border: 0.2px solid rgba(0,0,0,.08); background:#fff; color:#334155; }
.status-badge.live { color:#dc2626; background:rgba(239,68,68,.08); border-color:#fca5a5; }
.status-badge.finished { color:#059669; background:rgba(16,185,129,.08); border-color:#6ee7b7; }
.match-teams { display:flex; flex-direction:column; gap:6px; }

@media (max-width: 768px) {
    .matches-toolbar .toolbar-row { flex-direction:column; align-items:stretch; }
    .match-row { grid-template-columns: 72px 1fr; }
}
.left-sidebar-combined, .sidebar-container {
    background: linear-gradient(135deg, #962FBF, #D6249F, #F58529, #FEDA77);
    backdrop-filter: blur(26px) saturate(160%);
    border-right: 1px solid rgba(150, 47, 191, 0.25);
}
.sidebar-nav-section .sidebar-menu-item, .sidebar-nav-section .nav-link { position: relative; overflow: hidden; }
.sidebar-nav-section .sidebar-menu-item::before, .sidebar-nav-section .nav-link::before {
    content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
    background: #429E9D;
    opacity:0; transition: opacity .3s ease, transform .3s ease; transform: translateX(-4px); border-radius:0 4px 4px 0;
}
.sidebar-nav-section .sidebar-menu-item.active::before, .sidebar-nav-section .nav-link.active::before { opacity:1; transform: translateX(0); }
.sidebar-nav-section .sidebar-menu-item:hover::before, .sidebar-nav-section .nav-link:hover::before { opacity:.55; transform: translateX(0); }
.sidebar-nav-section .sidebar-menu-item, .sidebar-nav-section .nav-link { transition: background .35s ease, color .35s ease; border-radius:.85rem; }
.sidebar-nav-section .sidebar-menu-item:hover, .sidebar-nav-section .nav-link:hover { background: linear-gradient(135deg, rgba(150, 47, 191, 0.35), rgba(214, 36, 159, 0.3), rgba(245, 133, 41, 0.25)); }
.sidebar-nav-section .sidebar-menu-item.active, .sidebar-nav-section .nav-link.active { background: #000000; color: #FFFFFF; font-weight: 400; box-shadow: 0 0 0 2px #429E9D, 0 4px 12px rgba(0, 0, 0, 0.3); }

/* Mood buttons unified gradient */
/* UNIVERSAL MOOD BUTTONS (17 moods) - now square tiles */
.universal-mood-row { display:grid; grid-template-columns:repeat(17,1fr); gap:0; width:100%; overflow:hidden; }
.universal-mood-row .universal-mood-btn {
    backdrop-filter: blur(3px);
    border: 0.2px solid rgba(255,255,255,.25);
    aspect-ratio: 1 / 1; /* Square */
    width: 100%;
    height: auto; /* Let aspect-ratio determine height */
    box-sizing: border-box;
    border-radius: 0; /* Perfect square tiles */
    display: flex; align-items: center; justify-content: center;
    font-size:.55rem; font-weight: 400; letter-spacing:.02em;
    padding:0; margin:0; border-radius:0;
    color:#0f1f29; position:relative; user-select:none; cursor:pointer;
    transition:filter .35s ease, transform .35s ease, box-shadow .35s ease;
    box-shadow:inset 0 1px 2px rgba(255,255,255,.6), 0 2px 5px -2px rgba(0,0,0,.25);
}
.universal-mood-row .universal-mood-btn:hover { filter:brightness(1.08) saturate(1.05); transform:translateY(-2px); box-shadow:0 6px 14px -6px rgba(0,0,0,.35); }
.universal-mood-row .universal-mood-btn:active { transform:translateY(0) scale(.97); }
.universal-mood-row .universal-mood-btn.selected { outline:2px solid rgba(255,255,255,.85); outline-offset:-2px; box-shadow:0 0 0 2px rgba(0,0,0,.15),0 6px 18px -6px rgba(0,0,0,.4); color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.35); }

/* Prevent any white backgrounds on mood buttons (scoped to the mood row only) */
.universal-mood-row .universal-mood-btn[data-mood] {
    background: transparent; /* Reset any inherited white backgrounds inside the grid */
}

/* 17 mood color tiles using new color chart */
/* Mood Level Color Assignments (1-17) */
.universal-mood-row .universal-mood-btn[data-mood="Love"]{background: #D94F70;}
.universal-mood-row .universal-mood-btn[data-mood="Happy"]{background: #B05BA4;}
.universal-mood-row .universal-mood-btn[data-mood="Amused"]{background: #8E6BB8;}
.universal-mood-row .universal-mood-btn[data-mood="Excitement"]{background: #6A7BC3;}
.universal-mood-row .universal-mood-btn[data-mood="Excited"]{background: #6A7BC3;} /* synonym */
.universal-mood-row .universal-mood-btn[data-mood="Optimistic"]{background: #4F91C8;}
.universal-mood-row .universal-mood-btn[data-mood="Interested"]{background: #3CAEC2;}
.universal-mood-row .universal-mood-btn[data-mood="Surprise"]{background: #4EBF9F;}
.universal-mood-row .universal-mood-btn[data-mood="Surprised"]{background: #4EBF9F;} /* synonym */
.universal-mood-row .universal-mood-btn[data-mood="Relief"]{background: #7AC36A;}
.universal-mood-row .universal-mood-btn[data-mood="Neutral"]{background: #A5C14A;}
.universal-mood-row .universal-mood-btn[data-mood="Disappointed"]{background: #D2B94A;}
.universal-mood-row .universal-mood-btn[data-mood="Embarrassed"]{background: #E8A24A;}
.universal-mood-row .universal-mood-btn[data-mood="Anxious"]{background: #F0824F;}
.universal-mood-row .universal-mood-btn[data-mood="Disgust"]{background: #EC6A5E;}
.universal-mood-row .universal-mood-btn[data-mood="Envy"]{background: #DA5157;}
.universal-mood-row .universal-mood-btn[data-mood="Fear"]{background: #B84549;}
.universal-mood-row .universal-mood-btn[data-mood="Sadness"]{background: #8A3239;}
.universal-mood-row .universal-mood-btn[data-mood="Angry"]{background: #661E23;}
.universal-mood-row .universal-mood-btn[data-mood="Fear"]{background: linear-gradient(135deg, #B84549 0%, #A53D41 100%);}
.universal-mood-row .universal-mood-btn[data-mood="Sadness"]{background: linear-gradient(135deg, #8A3239 0%, #7B2D33 100%);}
.universal-mood-row .universal-mood-btn[data-mood="Sad"]{background: linear-gradient(135deg, #8A3239 0%, #7B2D33 100%);} /* synonym */
.universal-mood-row .universal-mood-btn[data-mood="Angry"]{background: linear-gradient(135deg, #661E23 0%, #5A1B20 100%);}

/* Universal mood button colors for ANY context (not just universal-mood-row) */
.universal-mood-btn[data-mood="Happy"]{background: linear-gradient(135deg, #B05BA4 0%, #9A4D94 100%);}
.universal-mood-btn[data-mood="Love"]{background: linear-gradient(135deg, #D94F70 0%, #C44462 100%);}
.universal-mood-btn[data-mood="Amused"]{background: linear-gradient(135deg, #8E6BB8 0%, #7F5DA5 100%);}
.universal-mood-btn[data-mood="Excitement"]{background: linear-gradient(135deg, #6A7BC3 0%, #5B6CB0 100%);}
.universal-mood-btn[data-mood="Excited"]{background: linear-gradient(135deg, #6A7BC3 0%, #5B6CB0 100%);} /* synonym */
.universal-mood-btn[data-mood="Optimistic"]{background: linear-gradient(135deg, #962FBF, #D6249F);}
.universal-mood-btn[data-mood="Interested"]{background: linear-gradient(135deg, #F58529, #FEDA77);}
.universal-mood-btn[data-mood="Surprise"]{background: linear-gradient(135deg, #4EBF9F 0%, #44AC8C 100%);}
.universal-mood-btn[data-mood="Surprised"]{background: linear-gradient(135deg, #4EBF9F 0%, #44AC8C 100%);} /* synonym */
.universal-mood-btn[data-mood="Relief"]{background: linear-gradient(135deg, #7AC36A 0%, #6DB05E 100%);}
.universal-mood-btn[data-mood="Neutral"]{background: linear-gradient(135deg, #A5C14A 0%, #94AE42 100%);}
.universal-mood-btn[data-mood="Disappointed"]{background: linear-gradient(135deg, #D2B94A 0%, #BFA642 100%);}
.universal-mood-btn[data-mood="Embarrassed"]{background: linear-gradient(135deg, #E8A24A 0%, #D59142 100%);}
.universal-mood-btn[data-mood="Anxious"]{background: linear-gradient(135deg, #F0824F 0%, #DD7447 100%);}
.universal-mood-btn[data-mood="Disgust"]{background: linear-gradient(135deg, #EC6A5E 0%, #D96055 100%);}
.universal-mood-btn[data-mood="Envy"]{background: linear-gradient(135deg, #DA5157 0%, #C7494F 100%);}
.universal-mood-btn[data-mood="Fear"]{background: linear-gradient(135deg, #B84549 0%, #A53D41 100%);}
.universal-mood-btn[data-mood="Sadness"]{background: linear-gradient(135deg, #8A3239 0%, #7B2D33 100%);}
.universal-mood-btn[data-mood="Sad"]{background: linear-gradient(135deg, #8A3239 0%, #7B2D33 100%);} /* synonym */
.universal-mood-btn[data-mood="Angry"]{background: linear-gradient(135deg, #661E23 0%, #5A1B20 100%);}

/* Post header dynamic mood color mapping (apply data-mood on .post-card or header wrapper) */
/* Post header mapping to new 17 moods (and synonyms) - WITH PROPER CONTRAST AND */
.post-header[data-mood="Happy"], .post-card[data-mood="Happy"] .post-header { --post-header-bg:#B05BA4; }
.post-header[data-mood="Love"], .post-card[data-mood="Love"] .post-header { --post-header-bg:#D94F70; --post-header-text:#fff; }
.post-header[data-mood="Love"] *, .post-card[data-mood="Love"] .post-header * { color: #fff; }
.post-header[data-mood="Amused"], .post-card[data-mood="Amused"] .post-header { --post-header-bg:#8E6BB8; --post-header-text:#fff; }
.post-header[data-mood="Amused"] *, .post-card[data-mood="Amused"] .post-header * { color: #fff; }
.post-header[data-mood="Amused"] .post-username, .post-card[data-mood="Amused"] .post-header .post-username { color: #fff; }
.post-header[data-mood="Amused"] .post-meta, .post-card[data-mood="Amused"] .post-header .post-meta { color: #fff; }
.post-header[data-mood="Amused"] .post-header-content, .post-card[data-mood="Amused"] .post-header .post-header-content { color: #fff; }
.post-header[data-mood="Amused"] .post-header-content *, .post-card[data-mood="Amused"] .post-header .post-header-content * { color: #fff; }
.post-header[data-mood="Excitement"], .post-card[data-mood="Excitement"] .post-header { --post-header-bg:#6A7BC3; --post-header-text:#fff; }
.post-header[data-mood="Excitement"] *, .post-card[data-mood="Excitement"] .post-header * { color: #fff; }
.post-header[data-mood="Excited"], .post-card[data-mood="Excited"] .post-header { --post-header-bg:#6A7BC3; --post-header-text:#fff; }
.post-header[data-mood="Excited"] *, .post-card[data-mood="Excited"] .post-header * { color: #fff; }
.post-header[data-mood="Optimistic"], .post-card[data-mood="Optimistic"] .post-header { --post-header-bg:#962FBF; --post-header-text:#fff; }
.post-header[data-mood="Optimistic"] *, .post-card[data-mood="Optimistic"] .post-header * { color: #fff; }
.post-header[data-mood="Interested"], .post-card[data-mood="Interested"] .post-header { --post-header-bg:#D6249F; --post-header-text:#fff; }
.post-header[data-mood="Interested"] *, .post-card[data-mood="Interested"] .post-header * { color: #fff; }
.post-header[data-mood="Interested"] .post-username, .post-card[data-mood="Interested"] .post-header .post-username { color: #fff; }
.post-header[data-mood="Interested"] .post-meta, .post-card[data-mood="Interested"] .post-header .post-meta { color: #fff; }
.post-header[data-mood="Interested"] .post-header-content, .post-card[data-mood="Interested"] .post-header .post-header-content { color: #fff; }
.post-header[data-mood="Interested"] .post-header-content *, .post-card[data-mood="Interested"] .post-header .post-header-content * { color: #fff; }
.post-header[data-mood="Surprise"], .post-card[data-mood="Surprise"] .post-header { --post-header-bg:#4EBF9F; --post-header-text:#fff; }
.post-header[data-mood="Surprise"] *, .post-card[data-mood="Surprise"] .post-header * { color: #fff; }
.post-header[data-mood="Surprised"], .post-card[data-mood="Surprised"] .post-header { --post-header-bg:#4EBF9F; --post-header-text:#fff; }
.post-header[data-mood="Surprised"] *, .post-card[data-mood="Surprised"] .post-header * { color: #fff; }
.post-header[data-mood="Relief"], .post-card[data-mood="Relief"] .post-header { --post-header-bg:#7AC36A; --post-header-text:#fff; }
.post-header[data-mood="Relief"] *, .post-card[data-mood="Relief"] .post-header * { color: #fff; }
.post-header[data-mood="Neutral"], .post-card[data-mood="Neutral"] .post-header { --post-header-bg:#A5C14A; --post-header-text:#000; }
.post-header[data-mood="Neutral"] *, .post-card[data-mood="Neutral"] .post-header * { color: #000; }
.post-header[data-mood="Disappointed"], .post-card[data-mood="Disappointed"] .post-header { --post-header-bg:#D2B94A; --post-header-text:#000; }
.post-header[data-mood="Disappointed"] *, .post-card[data-mood="Disappointed"] .post-header * { color: #000; }
.post-header[data-mood="Embarrassed"], .post-card[data-mood="Embarrassed"] .post-header { --post-header-bg:#E8A24A; --post-header-text:#000; }
.post-header[data-mood="Embarrassed"] *, .post-card[data-mood="Embarrassed"] .post-header * { color: #000; }
.post-header[data-mood="Anxious"], .post-card[data-mood="Anxious"] .post-header { --post-header-bg:#F0824F; --post-header-text:#000; }
.post-header[data-mood="Anxious"] *, .post-card[data-mood="Anxious"] .post-header * { color: #000; }
.post-header[data-mood="Disgust"], .post-card[data-mood="Disgust"] .post-header { --post-header-bg:#EC6A5E; --post-header-text:#fff; }
.post-header[data-mood="Disgust"] *, .post-card[data-mood="Disgust"] .post-header * { color: #fff; }
.post-header[data-mood="Envy"], .post-card[data-mood="Envy"] .post-header { --post-header-bg:#DA5157; --post-header-text:#fff; }
.post-header[data-mood="Envy"] *, .post-card[data-mood="Envy"] .post-header * { color: #fff; }
.post-header[data-mood="Fear"], .post-card[data-mood="Fear"] .post-header { --post-header-bg:#B84549; --post-header-text:#fff; }
.post-header[data-mood="Fear"] *, .post-card[data-mood="Fear"] .post-header * { color: #fff; }
.post-header[data-mood="Sadness"], .post-card[data-mood="Sadness"] .post-header { --post-header-bg:#8A3239; --post-header-text:#fff; }
.post-header[data-mood="Sadness"] *, .post-card[data-mood="Sadness"] .post-header * { color: #fff; }
.post-header[data-mood="Sad"], .post-card[data-mood="Sad"] .post-header { --post-header-bg:#8A3239; --post-header-text:#fff; }
.post-header[data-mood="Sad"] *, .post-card[data-mood="Sad"] .post-header * { color: #fff; }
.post-header[data-mood="Angry"], .post-card[data-mood="Angry"] .post-header { --post-header-bg:#661E23; --post-header-text:#fff; }
.post-header[data-mood="Angry"] *, .post-card[data-mood="Angry"] .post-header * { color: #fff; }

/* Enhanced Universal Mood Button Color-Specific Effects */
.universal-mood-row .universal-mood-btn[data-mood="Happy"]:hover,
.universal-mood-btn[data-mood="Happy"]:hover { box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Love"]:hover,
.universal-mood-btn[data-mood="Love"]:hover { box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(255, 105, 180, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Amused"]:hover,
.universal-mood-btn[data-mood="Amused"]:hover { box-shadow: 0 8px 25px rgba(173, 255, 47, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(173, 255, 47, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Excitement"]:hover,
.universal-mood-row .universal-mood-btn[data-mood="Excited"]:hover,
.universal-mood-btn[data-mood="Excitement"]:hover,
.universal-mood-btn[data-mood="Excited"]:hover { box-shadow: 0 8px 25px rgba(255, 165, 0, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(255, 165, 0, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Optimistic"]:hover,
.universal-mood-btn[data-mood="Optimistic"]:hover { box-shadow: 0 8px 25px rgba(135, 206, 235, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(135, 206, 235, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Interested"]:hover,
.universal-mood-btn[data-mood="Interested"]:hover { box-shadow: 0 8px 25px rgba(64, 224, 208, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(64, 224, 208, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Surprise"]:hover,
.universal-mood-row .universal-mood-btn[data-mood="Surprised"]:hover,
.universal-mood-btn[data-mood="Surprise"]:hover,
.universal-mood-btn[data-mood="Surprised"]:hover { box-shadow: 0 8px 25px rgba(30, 144, 255, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(30, 144, 255, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Relief"]:hover,
.universal-mood-btn[data-mood="Relief"]:hover { box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(50, 205, 50, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Neutral"]:hover,
.universal-mood-btn[data-mood="Neutral"]:hover { box-shadow: 0 8px 25px rgba(65, 105, 225, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(65, 105, 225, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Disappointed"]:hover,
.universal-mood-btn[data-mood="Disappointed"]:hover { box-shadow: 0 8px 25px rgba(72, 61, 139, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(72, 61, 139, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Embarrassed"]:hover,
.universal-mood-btn[data-mood="Embarrassed"]:hover { box-shadow: 0 8px 25px rgba(255, 127, 80, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(255, 127, 80, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Anxious"]:hover,
.universal-mood-btn[data-mood="Anxious"]:hover { box-shadow: 0 8px 25px rgba(138, 43, 226, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(138, 43, 226, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Disgust"]:hover,
.universal-mood-btn[data-mood="Disgust"]:hover { box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(50, 205, 50, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Envy"]:hover,
.universal-mood-btn[data-mood="Envy"]:hover { box-shadow: 0 8px 25px rgba(173, 255, 47, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(173, 255, 47, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Fear"]:hover,
.universal-mood-btn[data-mood="Fear"]:hover { box-shadow: 0 8px 25px rgba(199, 21, 133, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(199, 21, 133, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Sadness"]:hover,
.universal-mood-row .universal-mood-btn[data-mood="Sad"]:hover,
.universal-mood-btn[data-mood="Sadness"]:hover,
.universal-mood-btn[data-mood="Sad"]:hover { box-shadow: 0 8px 25px rgba(72, 61, 139, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(72, 61, 139, 0.3)); }

.universal-mood-row .universal-mood-btn[data-mood="Angry"]:hover,
.universal-mood-btn[data-mood="Angry"]:hover { box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4); filter: brightness(1.2) drop-shadow(0 4px 8px rgba(139, 0, 0, 0.3)); }

/* Enhanced Selected States with Color-Specific Glows */
.universal-mood-row .universal-mood-btn[data-mood="Happy"].selected,
.universal-mood-btn[data-mood="Happy"].selected { box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Love"].selected,
.universal-mood-btn[data-mood="Love"].selected { box-shadow: 0 12px 35px rgba(255, 105, 180, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Amused"].selected,
.universal-mood-btn[data-mood="Amused"].selected { box-shadow: 0 12px 35px rgba(173, 255, 47, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Excitement"].selected,
.universal-mood-row .universal-mood-btn[data-mood="Excited"].selected,
.universal-mood-btn[data-mood="Excitement"].selected,
.universal-mood-btn[data-mood="Excited"].selected { box-shadow: 0 12px 35px rgba(255, 165, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Optimistic"].selected,
.universal-mood-btn[data-mood="Optimistic"].selected { box-shadow: 0 12px 35px rgba(135, 206, 235, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Interested"].selected,
.universal-mood-btn[data-mood="Interested"].selected { box-shadow: 0 12px 35px rgba(64, 224, 208, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Surprise"].selected,
.universal-mood-row .universal-mood-btn[data-mood="Surprised"].selected,
.universal-mood-btn[data-mood="Surprise"].selected,
.universal-mood-btn[data-mood="Surprised"].selected { box-shadow: 0 12px 35px rgba(30, 144, 255, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Relief"].selected,
.universal-mood-btn[data-mood="Relief"].selected { box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Neutral"].selected,
.universal-mood-btn[data-mood="Neutral"].selected { box-shadow: 0 12px 35px rgba(65, 105, 225, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Disappointed"].selected,
.universal-mood-btn[data-mood="Disappointed"].selected { box-shadow: 0 12px 35px rgba(72, 61, 139, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Embarrassed"].selected,
.universal-mood-btn[data-mood="Embarrassed"].selected { box-shadow: 0 12px 35px rgba(255, 127, 80, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Anxious"].selected,
.universal-mood-btn[data-mood="Anxious"].selected { box-shadow: 0 12px 35px rgba(138, 43, 226, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Disgust"].selected,
.universal-mood-btn[data-mood="Disgust"].selected { box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Envy"].selected,
.universal-mood-btn[data-mood="Envy"].selected { box-shadow: 0 12px 35px rgba(173, 255, 47, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Fear"].selected,
.universal-mood-btn[data-mood="Fear"].selected { box-shadow: 0 12px 35px rgba(199, 21, 133, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Sadness"].selected,
.universal-mood-row .universal-mood-btn[data-mood="Sad"].selected,
.universal-mood-btn[data-mood="Sadness"].selected,
.universal-mood-btn[data-mood="Sad"].selected { box-shadow: 0 12px 35px rgba(72, 61, 139, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.universal-mood-row .universal-mood-btn[data-mood="Angry"].selected,
.universal-mood-btn[data-mood="Angry"].selected { box-shadow: 0 12px 35px rgba(139, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

/* Mood-buttons-row Color Assignments (for main feed mood buttons) */
.mood-buttons-row .universal-mood-btn:nth-child(1),
.mood-buttons-row .news-mood-btn:nth-child(1) { background: linear-gradient(135deg, #D94F70 0%, #C44462 100%); color: #fff; } /* Love - Pink */

.mood-buttons-row .universal-mood-btn:nth-child(2),
.mood-buttons-row .news-mood-btn:nth-child(2) { background: linear-gradient(135deg, #B05BA4 0%, #9A4D94 100%); color: #fff; } /* Happy - Purple */

.mood-buttons-row .universal-mood-btn:nth-child(3),
.mood-buttons-row .news-mood-btn:nth-child(3) { background: linear-gradient(135deg, #8E6BB8 0%, #7F5DA5 100%); color: #fff; } /* Amused - Purple */

.mood-buttons-row .universal-mood-btn:nth-child(4),
.mood-buttons-row .news-mood-btn:nth-child(4) { background: linear-gradient(135deg, #F58529, #FEDA77); color: #fff; } /* Excitement - Orange */

.mood-buttons-row .universal-mood-btn:nth-child(5),
.mood-buttons-row .news-mood-btn:nth-child(5) { background: linear-gradient(135deg, #962FBF, #D6249F); color: #fff; } /* Optimistic - Purple */

.mood-buttons-row .universal-mood-btn:nth-child(6),
.mood-buttons-row .news-mood-btn:nth-child(6) { background: linear-gradient(135deg, #F58529, #FEDA77); color: #fff; } /* Interested - Orange */

.mood-buttons-row .universal-mood-btn:nth-child(7),
.mood-buttons-row .news-mood-btn:nth-child(7) { background: linear-gradient(135deg, #4EBF9F 0%, #44AC8C 100%); color: #fff; } /* Surprise - Green */

.mood-buttons-row .universal-mood-btn:nth-child(8),
.mood-buttons-row .news-mood-btn:nth-child(8) { background: linear-gradient(135deg, #7AC36A 0%, #6DB05E 100%); color: #fff; } /* Relief - Green */

.mood-buttons-row .universal-mood-btn:nth-child(9),
.mood-buttons-row .news-mood-btn:nth-child(9) { background: linear-gradient(135deg, #A5C14A 0%, #94AE42 100%); color: #fff; } /* Neutral - Green */

.mood-buttons-row .universal-mood-btn:nth-child(10),
.mood-buttons-row .news-mood-btn:nth-child(10) { background: linear-gradient(135deg, #D2B94A 0%, #BFA642 100%); color: #fff; } /* Disappointed - Yellow */

.mood-buttons-row .universal-mood-btn:nth-child(11),
.mood-buttons-row .news-mood-btn:nth-child(11) { background: linear-gradient(135deg, #E8A24A 0%, #D59142 100%); color: #fff; } /* Embarrassed - Orange */

.mood-buttons-row .universal-mood-btn:nth-child(12),
.mood-buttons-row .news-mood-btn:nth-child(12) { background: linear-gradient(135deg, #F0824F 0%, #DD7447 100%); color: #fff; } /* Anxious - Orange */

.mood-buttons-row .universal-mood-btn:nth-child(13),
.mood-buttons-row .news-mood-btn:nth-child(13) { background: linear-gradient(135deg, #EC6A5E 0%, #D96055 100%); color: #fff; } /* Disgust - Red */

.mood-buttons-row .universal-mood-btn:nth-child(14),
.mood-buttons-row .news-mood-btn:nth-child(14) { background: linear-gradient(135deg, #DA5157 0%, #C7494F 100%); color: #fff; } /* Envy - Red */

.mood-buttons-row .universal-mood-btn:nth-child(15),
.mood-buttons-row .news-mood-btn:nth-child(15) { background: linear-gradient(135deg, #B84549 0%, #A53D41 100%); color: #fff; } /* Fear - Dark Red */

.mood-buttons-row .universal-mood-btn:nth-child(16),
.mood-buttons-row .news-mood-btn:nth-child(16) { background: linear-gradient(135deg, #8A3239 0%, #7B2D33 100%); color: #fff; } /* Sadness - Dark Red */

.mood-buttons-row .universal-mood-btn:nth-child(17),
.mood-buttons-row .news-mood-btn:nth-child(17) { background: linear-gradient(135deg, #661E23 0%, #5A1B20 100%); color: #fff; } /* Angry - Very Dark Red */

/* Color-specific hover effects for mood-buttons-row */
.mood-buttons-row .universal-mood-btn:nth-child(1):hover,
.mood-buttons-row .news-mood-btn:nth-child(1):hover { box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(2):hover,
.mood-buttons-row .news-mood-btn:nth-child(2):hover { box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(3):hover,
.mood-buttons-row .news-mood-btn:nth-child(3):hover { box-shadow: 0 8px 25px rgba(173, 255, 47, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(4):hover,
.mood-buttons-row .news-mood-btn:nth-child(4):hover { box-shadow: 0 8px 25px rgba(255, 165, 0, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(5):hover,
.mood-buttons-row .news-mood-btn:nth-child(5):hover { box-shadow: 0 8px 25px rgba(135, 206, 235, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(6):hover,
.mood-buttons-row .news-mood-btn:nth-child(6):hover { box-shadow: 0 8px 25px rgba(64, 224, 208, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(7):hover,
.mood-buttons-row .news-mood-btn:nth-child(7):hover { box-shadow: 0 8px 25px rgba(30, 144, 255, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(8):hover,
.mood-buttons-row .news-mood-btn:nth-child(8):hover { box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(9):hover,
.mood-buttons-row .news-mood-btn:nth-child(9):hover { box-shadow: 0 8px 25px rgba(65, 105, 225, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(10):hover,
.mood-buttons-row .news-mood-btn:nth-child(10):hover { box-shadow: 0 8px 25px rgba(72, 61, 139, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(11):hover,
.mood-buttons-row .news-mood-btn:nth-child(11):hover { box-shadow: 0 8px 25px rgba(255, 127, 80, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(12):hover,
.mood-buttons-row .news-mood-btn:nth-child(12):hover { box-shadow: 0 8px 25px rgba(138, 43, 226, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(13):hover,
.mood-buttons-row .news-mood-btn:nth-child(13):hover { box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(14):hover,
.mood-buttons-row .news-mood-btn:nth-child(14):hover { box-shadow: 0 8px 25px rgba(173, 255, 47, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(15):hover,
.mood-buttons-row .news-mood-btn:nth-child(15):hover { box-shadow: 0 8px 25px rgba(199, 21, 133, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(16):hover,
.mood-buttons-row .news-mood-btn:nth-child(16):hover { box-shadow: 0 8px 25px rgba(72, 61, 139, 0.4); filter: brightness(1.15); }

.mood-buttons-row .universal-mood-btn:nth-child(17):hover,
.mood-buttons-row .news-mood-btn:nth-child(17):hover { box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4); filter: brightness(1.15); }

/* Color-specific selected effects for mood-buttons-row */
.mood-buttons-row .universal-mood-btn:nth-child(1).selected,
.mood-buttons-row .news-mood-btn:nth-child(1).selected { box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(2).selected,
.mood-buttons-row .news-mood-btn:nth-child(2).selected { box-shadow: 0 12px 35px rgba(255, 105, 180, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(3).selected,
.mood-buttons-row .news-mood-btn:nth-child(3).selected { box-shadow: 0 12px 35px rgba(173, 255, 47, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(4).selected,
.mood-buttons-row .news-mood-btn:nth-child(4).selected { box-shadow: 0 12px 35px rgba(255, 165, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(5).selected,
.mood-buttons-row .news-mood-btn:nth-child(5).selected { box-shadow: 0 12px 35px rgba(135, 206, 235, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(6).selected,
.mood-buttons-row .news-mood-btn:nth-child(6).selected { box-shadow: 0 12px 35px rgba(64, 224, 208, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(7).selected,
.mood-buttons-row .news-mood-btn:nth-child(7).selected { box-shadow: 0 12px 35px rgba(30, 144, 255, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(8).selected,
.mood-buttons-row .news-mood-btn:nth-child(8).selected { box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(9).selected,
.mood-buttons-row .news-mood-btn:nth-child(9).selected { box-shadow: 0 12px 35px rgba(65, 105, 225, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(10).selected,
.mood-buttons-row .news-mood-btn:nth-child(10).selected { box-shadow: 0 12px 35px rgba(72, 61, 139, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(11).selected,
.mood-buttons-row .news-mood-btn:nth-child(11).selected { box-shadow: 0 12px 35px rgba(255, 127, 80, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(12).selected,
.mood-buttons-row .news-mood-btn:nth-child(12).selected { box-shadow: 0 12px 35px rgba(138, 43, 226, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(13).selected,
.mood-buttons-row .news-mood-btn:nth-child(13).selected { box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(14).selected,
.mood-buttons-row .news-mood-btn:nth-child(14).selected { box-shadow: 0 12px 35px rgba(173, 255, 47, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(15).selected,
.mood-buttons-row .news-mood-btn:nth-child(15).selected { box-shadow: 0 12px 35px rgba(199, 21, 133, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(16).selected,
.mood-buttons-row .news-mood-btn:nth-child(16).selected { box-shadow: 0 12px 35px rgba(72, 61, 139, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.mood-buttons-row .universal-mood-btn:nth-child(17).selected,
.mood-buttons-row .news-mood-btn:nth-child(17).selected { box-shadow: 0 12px 35px rgba(139, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4); }

.comment-mood-buttons-row .universal-mood-btn {
    min-height: 42px;
    padding: 0; /* Match universal mood row */
}

/* Make global feed/news mood buttons look like universal mood row */
.mood-buttons-row {
    display: grid; /* Match universal mood row - use grid not flex */
    grid-template-columns: repeat(17, 1fr); /* 17 equal columns like universal */
    gap: 0; /* No gap like universal mood row */
    overflow: hidden; /* Match universal mood row */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* height determined by tile aspect-ratio */
    border-radius: var(--radius-lg, 1rem); /* Match universal border radius */
    border: 0.2px solid var(--primary-medium, #2B7A78); /* Match universal border */
    box-sizing: border-box; /* Match universal mood row */
    background: transparent; /* Match universal background */
    padding: 0; /* Match universal padding */
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(23, 37, 42, 0.1)); /* Match universal shadow */
    position: relative;
    z-index: 5;
}

.mood-buttons-row::-webkit-scrollbar {
    display: none;
}

.mood-buttons-row .universal-mood-btn,
.news-mood-btn {
    display: flex; /* Match universal mood button display */
    align-items: center; /* Match universal mood button alignment */
    justify-content: center; /* Match universal mood button alignment */
    height: auto; /* Height from aspect-ratio */
    font-size: 0.54rem; /* Match universal mood button font size exactly */
    font-weight: 400;
    color: var(--accent-white, #FEFFFF); /* White text like universal */
    text-shadow: 0 1px 3px rgba(23, 37, 42, 0.5); /* Match universal text shadow */
    cursor: pointer;
    transition: all var(--transition-base, 200ms) ease;
    border: none; /* Remove borders like universal mood buttons */
    padding: 0; /* Match universal mood button padding */
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-family: var(--font-primary, 'Inter'), sans-serif;
    letter-spacing: -0.01em;
    border-radius: 0; /* No individual button border radius in grid */
    position: relative;
    z-index: 10;
}

.post-comment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(58, 175, 169, 0.3);
    background: 
        linear-gradient(135deg, 
            var(--primary-medium, #2B7A78) 0%, 
            var(--primary-dark, #17252A) 100%
        );
}

.post-comment-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(58, 175, 169, 0.2);
}

/* ===== BEAUTIFUL ANIMATIONS ===== */

@keyframes heartPulse {
    0%, 100% { 
        transform: scale(1); 
        color: var(--primary-medium, #2B7A78);
    }
    50% { 
        transform: scale(1.3); 
        color: var(--error, #DC2626);
    }
}

@keyframes gentleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes elegantSlideDown {
    from { 
        max-height: 0; 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        max-height: 600px; 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes elegantSlideUp {
    from { 
        max-height: 600px; 
        opacity: 1;
        transform: translateY(0);
    }
    to { 
        max-height: 0; 
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes tealGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(58, 175, 169, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(58, 175, 169, 0.6);
    }
}

/* Reaction Animations */
.post-reaction-heart.reacted,
.like-btn.liked .post-reaction-heart {
    color: #429E9D;
    animation: heartPulse 0.6s ease;
}

.vertical-action-btn.loading i {
    animation: gentleSpin 1s linear infinite;
}

/* ===== ACCESSIBILITY & FOCUS STYLES ===== */

.comment-textarea:focus,
.post-comment-button:focus,
.comment-mood-button:focus,
.vertical-action-btn:focus {
    outline: 2px solid var(--primary-light, #3AAFA9);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(58, 175, 169, 0.1);
}

/* ===== LOAD MORE COMMENTS BUTTON ===== */

.load-more-comments-btn {
    background: var(--primary-lightest, #DEF2F1);
    border: 0.2px solid var(--primary-light, #3AAFA9);
    color: var(--primary-medium, #2B7A78);
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    border-radius: var(--post-card-radius);
    cursor: pointer;
    transition: all var(--transition-base, 200ms) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2, 0.5rem);
    margin: var(--space-4, 1rem) auto;
}

.load-more-comments-btn:hover {
    background: var(--primary-light, #3AAFA9);
    color: var(--accent-white, #FEFFFF);
    border-color: var(--primary-medium, #2B7A78);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 175, 169, 0.25);
}

.load-more-comments-btn:active {
    transform: translateY(0);
}

/* Hidden Comments */
.hidden-comment {
    display: none;
}

/* ===== BEAUTIFUL GRADIENT BAR ===== */

.collective-comments-gradient-bar-enhanced {
    background: #f8f9fa;
    border-radius: 0 0 var(--post-card-radius) var(--post-card-radius);
    height: 70px;
    margin: 0;
    position: relative;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    border-top: 1px solid #e9ecef;
}

/* ===== RIGHT SIDEBAR ULTRA-COMPACT OPTIMIZATION ===== */

/* Ultra-compact trending pages navigation */
.trending-pages-nav {
    margin-bottom: 0.5rem; /* Much smaller margin */
    padding: 2px; /* Much smaller padding */
}

.trending-page-btn {
    padding: 4px 6px; /* Much smaller button padding */
    font-size: var(--post-font-size, 0.9rem); /* Standardized to 0.9rem */
    line-height: 1;
}

/* Ultra-compact section headers */
.insights-section-header {
    padding: 0.125rem 0.25rem 0.125rem; /* Minimal header padding */
}

.insights-title {
    font-size: var(--post-font-size, 0.9rem); /* Standardized to 0.9rem */
    line-height: 1;
    margin: 0; /* Remove margin for minimal space */
}

.live-indicator {
    display: none; /* Hide LOCAL DATA indicator for space */
}

.live-text {
    font-size: var(--post-font-size, 0.9rem); /* Standardized to 0.9rem */
    line-height: 1;
}

.pulse-dot {
    font-size: var(--post-font-size, 0.9rem); /* Standardized to 0.9rem */
}

/* Dynamic viewport optimization for 100% zoom */
@media screen and (max-height: 900px) {
    .insights-section-content {
        padding: 0.375rem; /* Even more compact on smaller screens */
    }
    
    .insight-stat-card {
        padding: 0.375rem;
    }
    
    .insights-stats-grid {
        gap: 0.375rem;
    }
    
    .trending-mood-circle {
        width: 20px;
        height: 20px;
        font-size: 0.4rem;
    }
    
    .insight-item {
        padding: 0.25rem 0;
    }
    
    .quick-action-btn {
        padding: 0.25rem 0.125rem;
        font-size: 0.4rem;
    }
    
    .quick-action-btn i {
        font-size: 0.5rem;
    }
    
    .quick-action-btn span {
        font-size: 0.4rem;
    }
}

/* Additional optimization for very compact screens */
@media screen and (max-height: 800px) {
    .insights-section-card {
        margin-bottom: 0.25rem;
    }
    
    .insights-section-header {
        padding: 0.125rem 0.25rem 0.125rem; /* Minimal even on smaller screens */
    }
    
    .insights-title {
        font-size: var(--post-font-size, 0.9rem); /* Keep consistent size */
    }
    
    .live-text {
        font-size: var(--post-font-size, 0.9rem); /* Keep consistent size */
    }
}

/* ===== TRENDING PAGES NAVIGATION ===== */

.trending-pages-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
    background: rgba(58, 175, 169, 0.1);
    border-radius: 12px;
    padding: 4px;
    border: 0.2px solid rgba(58, 175, 169, 0.2);
}

.trending-page-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--primary-medium, #2B7A78);
    font-size: 11px;
    font-weight: 400;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.trending-page-btn:hover {
    background: rgba(58, 175, 169, 0.2);
    color: var(--primary-dark, #17252A);
}

.trending-page-btn.active {
    background: var(--primary-light, #3AAFA9);
    color: white;
    box-shadow: 0 2px 8px rgba(58, 175, 169, 0.3);
}

.trending-page {
    display: none;
}

.trending-page.active {
    display: block;
}

.insight-circle.trending {
    background: linear-gradient(135deg, var(--primary-light, #3AAFA9), var(--primary-medium, #2B7A78));
    color: white;
}

/* ===== RESPONSIVE DESIGN - ELEGANT & FUNCTIONAL ===== */

@media (max-width: 768px) {
    .post-card-layout {
        flex-direction: column;
    }
    .post-sidebar {position:static;transform:none;width:100%;height:auto;flex-direction:row;justify-content:space-evenly;padding:var(--space-4,1rem);background:linear-gradient(90deg,var(--primary-lightest,#DEF2F1) 0%,rgba(58,175,169,0.1) 50%,var(--primary-lightest,#DEF2F1) 100%);border-top:1px solid rgba(58,175,169,0.2);border-radius:0 0 var(--post-card-radius) var(--post-card-radius);pointer-events:auto;}
    
    .vertical-actions-stack {
        flex-direction: row;
        gap: var(--space-8, 2rem);
        width: 100%;
        justify-content: space-evenly;
    }
    
    .comment-mood-buttons-row {
        flex-wrap: wrap;
        gap: var(--space-1, 0.25rem);
    }
    
    .comment-mood-button {
        flex: 1 1 calc((100% - 2rem) / 4);
        min-width: calc((100% - 2rem) / 4);
        max-width: calc((100% - 2rem) / 4);
        margin-bottom: var(--space-1, 0.25rem);
    }
    
    .comments-container {
        padding: var(--space-4, 1rem);
    }
    
    .post-header {
        padding: 0.5rem 0.75rem; /* Even more compact on mobile */
    }
    
    .post-content-area {
        padding: 0.5rem 0.75rem; /* Even more compact on mobile */
    }
    
    .vertical-actions-stack {
        flex-direction: row;
        gap: var(--space-8, 2rem);
        width: 100%;
        justify-content: space-evenly;
    }
    
    .comment-mood-buttons-row {
        flex-wrap: wrap;
        gap: var(--space-1, 0.25rem);
    }
    
    .comment-mood-button {
        flex: 1 1 calc((100% - 2rem) / 4);
        min-width: calc((100% - 2rem) / 4);
        max-width: calc((100% - 2rem) / 4);
        margin-bottom: var(--space-1, 0.25rem);
    }
    
    .comments-container {
        padding: var(--space-4, 1rem);
    }
    
    .post-header {
        padding: 0.5rem 0.75rem; /* Compact for smaller screens */
    }
    
    .post-content-area {
        padding: 0.5rem 0.75rem; /* Compact for smaller screens */
    }
}

/* ===== Pockets removed: styles deleted intentionally ===== */

/* ===== GLOBAL NEWS FEED STYLES - TOP TIER DESIGN ===== */

/* News Card Container - 30% Wider Premium Design */
.global-news-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.2px solid rgba(226, 232, 240, 0.8);
    width: 130%; /* 30% wider */
    max-width: 130%; /* 30% wider */
    position: relative;
    backdrop-filter: blur(10px);
}

.global-news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(66, 158, 157, 0.3), transparent);
}

.global-news-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(66, 158, 157, 0.2);
}

/* News Card Header - Enhanced Layout */
.news-card-header {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.7);
    position: relative;
}

.news-image-wrapper {
    flex-shrink: 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    transition: transform 0.3s ease;
}

.news-thumbnail:hover {
    transform: scale(1.05);
}

.news-text-content {
    flex: 1;
    min-width: 0;
}

.news-headline {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
    color: #0f172a;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-headline-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-headline-link:hover {
    color: #429E9D;
    -webkit-text-fill-color: #429E9D;
}

.news-info {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 20px;
    width: fit-content;
    backdrop-filter: blur(4px);
}

.news-source-name {
    font-weight: 400;
    color: #429E9D;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
}

.news-dot {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

.news-publish-date {
    color: #94a3b8;
    font-weight: 500;
}

.news-description {
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.6;
    color: #475569;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
}

/* News Card Actions - Premium Design */
.news-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.5);
}

.news-reactions-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 0.2px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.news-reactions-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #429E9D;
    border-color: #429E9D;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 158, 157, 0.15);
}

.read-full-article-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #429E9D 0%, #3a8f8a 100%);
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: 400;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 158, 157, 0.25);
}

.read-full-article-btn:hover {
    background: linear-gradient(135deg, #3a8f8a 0%, #2d7a79 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 158, 157, 0.35);
}

/* Community Reactions - Premium */
.community-reactions {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.community-reactions.hidden {
    display: none;
}

.reactions-title h4 {
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reactions-display {
    min-height: 2rem;
}

.no-reactions {
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    font-style: normal;
    margin: 0;
    padding: 1rem 0;
}

/* Mood Reaction Bar - EXACT COPY FROM POST CREATION */
.news-mood-bar {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    backdrop-filter: blur(8px);
}

.mood-bar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mood-bar-header i {
    color: #64748b;
    font-size: 11px;
}

/* Use the EXACT universal mood row styling */
.news-mood-bar .universal-mood-row {
    display: grid;
    grid-template-columns: repeat(17, 1fr);
    grid-auto-columns: 1fr;
    gap: 0;
    margin-top: var(--space-3, 0.75rem);
    width: 100%;
    height: 40px;
    border-radius: var(--radius-lg, 1rem);
    overflow: hidden;
    border: 0.2px solid var(--primary-medium, #2B7A78);
    box-sizing: border-box;
    background: transparent;
    flex-wrap: unset;
    justify-content: unset;
    align-items: unset;
    padding: 0;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(23, 37, 42, 0.1));
}

.news-mood-bar .universal-mood-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
    font-size: 0.54rem;
    font-weight: 400;
    color: var(--accent-white, #FEFFFF);
    text-shadow: 0 1px 3px rgba(23, 37, 42, 0.5);
    cursor: pointer;
    transition: all var(--transition-base, 200ms) ease;
    border: none;
    padding: 0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-primary, 'Inter'), sans-serif;
    letter-spacing: -0.01em;
    flex: 1 1 auto;
    grid-column: span 1;
}

.news-mood-bar .universal-mood-btn:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(23, 37, 42, 0.3);
    filter: brightness(1.1);
}

.news-mood-bar .universal-mood-btn.selected {
    transform: scale(1.1);
    z-index: 20;
    box-shadow: 0 6px 20px rgba(23, 37, 42, 0.4);
    filter: brightness(1.2);
    border: 0.2px solid var(--accent-white, #FEFFFF);
}

/* Ensure news mood buttons fill their grid cells completely */
.news-mood-bar .article-mood-row > .universal-mood-btn,
.news-mood-bar .full-width-mood-row > .universal-mood-btn {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

/* Consensus Bar - Premium */
.mood-consensus-bar {
    height: 32px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0 0 16px 16px;
}

.consensus-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background 0.3s ease;
    border-radius: 0 0 16px 16px;
}

.consensus-label {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 400;
    text-align: center;
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.consensus-label.fade-out {
    opacity: 0.8;
}

/* Global feed filter tabs */
.news-filter-tabs {
    display: inline-flex;
    background: #fff;
    border: 0.2px solid rgba(0,0,0,0.06);
    border-radius: 9999px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.news-filter-tabs .filter-tab {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 400;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
}
.news-filter-tabs .filter-tab:hover {
    background: #F3F4F6;
}
.news-filter-tabs .filter-tab.active {
    background: #111827;
    color: #F9FAFB;
}

/* Responsive Design - Premium */
@media (max-width: 768px) {
    .global-news-card {
        width: 120%; /* Slightly less on mobile */
        max-width: 120%;
        margin-bottom: 1.25rem;
        border-radius: 12px;
    }
    
    .news-card-header {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .news-thumbnail {
        width: 85px;
        height: 85px;
    }
    
    .news-headline {
        font-size: 14px;
    }
    
    .news-description {
        font-size: var(--post-font-size, 0.9rem);
    }
    
    .news-mood-bar .universal-mood-btn {
        font-size: 0.5rem;
    }
    
    .news-card-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        padding: 1rem 1.25rem;
    }
    
    .read-full-article-btn {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .global-news-card {
        width: 110%;
        max-width: 110%;
    }
    
    .news-mood-bar .universal-mood-btn {
        font-size: 0.45rem;
    }
}

/* ===== ENHANCED PROFILE STYLES ===== */

/* Profile Posts Container */
.profile-posts-header,
.profile-reactions-header,
.profile-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.profile-posts-header h3,
.profile-reactions-header h3,
.profile-activity-header h3 {
    font-size: 14px;
    font-weight: 400;
    color: #1e293b;
    margin: 0;
}

.posts-stats,
.reactions-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--post-font-size, 0.9rem);
    color: #64748b;
    font-weight: 500;
}

.stat-item i {
    font-size: 11px;
}

/* Profile Posts Grid */
.profile-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.profile-post-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 0.2px solid #e2e8f0;
}

.profile-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #429E9D;
}

.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(66, 158, 157, 0.05);
    border-bottom: 1px solid #e2e8f0;
}

.post-date {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-action-btn {
    background: #429E9D;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
}

.post-action-btn:hover {
    background: #3a8f8a;
    transform: scale(1.05);
}

.post-card-content {
    padding: 1rem;
}

.post-text {
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.5;
    color: #374151;
    margin-bottom: 0.75rem;
}

.post-image-preview {
    border-radius: 8px;
    overflow: hidden;
    max-height: 280px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-image-preview img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid #e2e8f0;
}

.mood-indicator {
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Profile Reactions List */
.profile-reactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reaction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 0.2px solid #f1f5f9;
    transition: all 0.2s ease;
}

.reaction-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

.reaction-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    flex-shrink: 0;
}

.reaction-content {
    flex: 1;
}

.reaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.reaction-type {
    font-size: 11px;
    font-weight: 400;
    color: #429E9D;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reaction-date {
    font-size: 11px;
    color: #94a3b8;
}

.reaction-details {
    font-size: var(--post-font-size, 0.9rem);
    color: #4b5563;
    line-height: 1.4;
}

.mood-chip {
    display: inline-block;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0 0.25rem;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    border: 0.2px solid #f1f5f9;
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: var(--post-font-size, 0.9rem);
    color: #374151;
    font-weight: 500;
}

.activity-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 0.125rem;
}

/* No Content States */
.no-posts-message,
.no-reactions-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.no-posts-icon,
.no-reactions-icon {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.no-posts-message h3,
.no-reactions-message h3 {
    font-size: 14px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-posts-message p,
.no-reactions-message p {
    font-size: var(--post-font-size, 0.9rem);
    margin-bottom: 1.5rem;
}

/* Loading and Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.loading-state i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #429E9D;
}

.error-state i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #ef4444;
}

/* Responsive Profile Design */
@media (max-width: 768px) {
    .profile-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-posts-header,
    .profile-reactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .posts-stats,
    .reactions-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .reaction-item {
        padding: 0.75rem;
    }
    
    .profile-post-card {
        margin-bottom: 1rem;
    }
}

/* Enhanced Messages System Styles */
.messages-layout {
    display: flex;
    /* height now controlled by #messages-section override; keep fallback for safety */
    height: calc(100vh - 200px);
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 0.2px solid #e5e7eb;
    font-family: var(--font-primary, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.conversations-sidebar {
    width: 360px; /* Slightly wider for better readability */
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.conversations-header {
    padding: 20px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    position: relative;
}

.conversations-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(150, 47, 191, 0.4), transparent);
}

.header-title-section {
    display: flex;
    flex-direction: column;
}

.conversations-header h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 400;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.messages-subtitle {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.new-message-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #962FBF, #D6249F);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(72, 209, 204, 0.25);
    flex-shrink: 0;
}

.new-message-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(72, 209, 204, 0.35); 
}

.conversations-search {
    padding: 16px 20px 12px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    z-index: 2;
    font-size: 14px;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.conversations-search-input {
    width: 100%;
    height: 36px;
    padding: 8px 40px 8px 40px;
    border: 0.2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #1f2937;
}

.conversations-search-input:focus {
    outline: none;
    border-color: #962FBF;
    box-shadow: 0 0 0 3px rgba(150, 47, 191, 0.08);
    background: #ffffff;
}

.conversations-search-input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.conversations-list { 
    flex: 1 1 auto; 
    overflow-y: auto; 
    padding: 8px 16px 16px; 
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    min-height: 0; /* allow independent scroll */
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
}

.loading-spinner {
    font-size: 24px;
    margin-bottom: 12px;
    color: #48D1CC;
}

.loading-state p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 4px 0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: #ffffff;
    border: 0.2px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.conversation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
    background: #fafbfc;
}

.conversation-item.active {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%);
    border-color: #48D1CC;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 209, 204, 0.15);
}

.conversation-item.active .conversation-name,
.conversation-item.active .last-message,
.conversation-item.active .conversation-time {
    color: #0f172a;
}

.conversation-avatar-wrapper {
    position: relative;
    margin-right: 16px;
    flex-shrink: 0;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Ensure inner image is clipped correctly */
    overflow: hidden;
    border: 0.2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Make sure the actual image fits the avatar container */
.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* Support legacy and new status indicator class names */
.conversation-status,
.conversation-avatar .status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 0.2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.conversation-status.online,
.conversation-avatar .status-indicator.online {
    background: #10b981;
}

.conversation-status.offline,
.conversation-avatar .status-indicator.offline {
    background: #9ca3af;
}

.conversation-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.conversation-name {
    font-weight: 400;
    font-size: 15px;
    color: #111827;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 8px;
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.last-message {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.unread-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.no-conversations {
    padding: 60px 32px;
    text-align: center;
    color: #64748b;
}

.no-conversations-icon {
    font-size: 14px;
    margin-bottom: 24px;
    color: #cbd5e1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.no-conversations h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #1f2937;
    font-weight: 400;
}

.no-conversations p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.start-conversation-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #48D1CC 0%, #40E0D0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 400;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(72, 209, 204, 0.3);
}

.start-conversation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(72, 209, 204, 0.4);
}

.start-new-chat-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #48D1CC 0%, #40E0D0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(72, 209, 204, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.start-new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(72, 209, 204, 0.35);
}

.no-search-results {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    display: none;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.no-search-results h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 400;
}

.no-search-results p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
    font-weight: 500;
}

/* Enhanced Chat Area Styles */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    /* subtle divider to the left for structure */
    border-left: 1px solid #e5e7eb;
}

.no-conversation-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
}

.no-conversation-icon {
    font-size: 80px;
    margin-bottom: 32px;
    color: #e2e8f0;
    animation: float 3s ease-in-out infinite;
}

.no-conversation-selected h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    color: #1f2937;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.no-conversation-selected p {
    margin: 0;
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.5;
}

.chat-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-user-info {
    display: flex;
    align-items: center;
}

.chat-avatar-wrapper {
    position: relative;
    margin-right: 16px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    /* Clip inner <img> and prevent overflow/glitches */
    overflow: hidden;
    border: 0.2px solid #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Ensure header avatar image fills container without distortion */
.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* Support legacy and new status indicator class names */
.chat-status,
.chat-avatar .status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 0.2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-status.online,
.chat-avatar .status-indicator.online {
    background: #10b981;
}

.chat-status.offline,
.chat-avatar .status-indicator.offline {
    background: #94a3b8;
}

.chat-user-details h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 400;
    color: #111827;
}
.chat-user-email {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.chat-user-status {
    margin: 0;
    font-size: 13px; /* Small font size */
    color: #10b981;
    font-weight: 400;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8fafc;
    border: 0.2px solid #e5e7eb;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.chat-action-btn:hover {
    background: #14b8a6;
    border-color: #14b8a6;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
}

/* Enhanced Chat Messages */
.chat-messages {
    /* messages scroller inside panel */
    padding: 20px;
    padding-bottom: 120px; /* keep latest message clear of the input bar */
    overflow-y: auto;
    background: #fbfcfd;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0; /* allow scrolling within grid row */
}

/* Ensure proper flex sizing in the Messages section so scrolling works */
#messages-section .chat-panel { min-height: 0; }
/* Messages grid: hide info panel by default; expand chat area so text doesn't stack */
.messages-main-container { 
    grid-template-columns: 280px minmax(420px, 1fr); 
    height: calc(100vh - var(--header-offset, 6rem)); /* fill below header */
    align-items: stretch; 
}
.messages-main-container .chat-info-panel { display: none; }
.messages-main-container.with-info { grid-template-columns: 280px minmax(0,1fr) 300px; }
.messages-main-container.with-info .chat-info-panel { display: block; }

/* Welcome state centering and word-wrapping normalization */
.chat-panel { 
    display: grid; 
    grid-template-rows: auto 1fr auto; 
    min-width: 0; 
    min-height: 0; 
    overflow: hidden; /* prevent panel from scrolling; inner area scrolls */
}
.conversations-panel { display: flex; flex-direction: column; min-height: 0; }
.conversations-controls { flex: 0 0 auto; }
.chat-panel * { min-width: 0; }
.chat-panel .message-group, .chat-panel .message { min-width: 0; }
.chat-panel .chat-welcome-state { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.chat-welcome-state .welcome-content { max-width: 520px; margin: 0 auto; text-align: center; }
.chat-welcome-state, .chat-welcome-state * { white-space: normal; word-break: normal; }

/* Friends re-layout: sidebar + content that fits the center column */
.friends-main-container { align-items: start; }
.friends-sidebar { position: sticky; top: calc(var(--header-offset, 6rem) + 12px); align-self: start; }
.friends-sidebar-inner {
    background: #ffffff;
    border: 0.2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.friends-sidebar-title { font-size: 14px; font-weight: 400; margin: 4px 8px 8px; color: #111827; }
.friends-nav { display: grid; gap: 8px; margin: 8px 0; }
.friends-nav .friends-tab-btn { 
    display: flex; align-items: center; gap: 8px; 
    padding: 10px 12px; border-radius: 10px; 
    background: #f9fafb; border: 0.2px solid #e5e7eb; 
    font-weight: 400; font-size: 13px; color: #111827; cursor: pointer; 
}
.friends-nav .friends-tab-btn.active { background: #111827; color: #fff; border-color: #111827; }
.friends-search { padding: 8px 0; }
.friends-sidebar .search-input-wrapper { position: relative; }
.friends-sidebar .search-input-wrapper i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #6b7280; }
.friends-sidebar .friends-search-input { width: 100%; padding: 10px 12px 10px 34px; border: 0.2px solid #e5e7eb; border-radius: 10px; }
.friends-sidebar-actions { margin-top: 8px; display: flex; }

.friends-content-scroll { min-height: 300px; padding: 0; }
.friends-content-scroll #friends-content { 
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%); 
    border: 1px solid #a7f3d0; 
    border-radius: 16px; 
    padding: 8px; 
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
    width: 100%; max-width: none;
}

@media (max-width: 900px) {
    .friends-main-container { grid-template-columns: 1fr; }
    .friends-sidebar { position: static; }
}
#messages-section .chat-header { position: sticky; top: 0; z-index: 2; }
#messages-section .chat-input-area { position: sticky; bottom: 0; z-index: 2; }
/* Only the messages list should scroll; keep input and header sticky */
#messages-section #chat-messages,
#messages-section .chat-messages,
#messages-section .chat-messages-area { overflow-y: auto; overflow-x: hidden; min-height: 0; }

.message-bubble {
    display: flex;
    max-width: 75%;
    margin-bottom: 12px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.own-message {
    align-self: flex-end;
}

.message-bubble.other-message {
    align-self: flex-start;
}

/* Disabled - using message-components.css instead */
/*
.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    border: 0.2px solid #e5e7eb;
}

.own-message .message-content {
    background: #eef2ff;
    color: #0f172a;
    border: 0.2px solid #dbeafe;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.other-message .message-content {
    background: white;
    color: #111827;
}
*/

.message-text {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    font-weight: 500;
}

.message-time {
    font-size: 11px; /* Small font size */
    color: #9ca3af;
    display: block;
    text-align: right;
    font-weight: 400;
}

/* Date separators between message groups */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 11px;
    font-weight: 400;
    margin: 12px 0 20px 0;
}
.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.date-separator span {
    margin: 0 12px;
    background: #eef2f7;
    padding: 4px 12px;
    border-radius: 999px;
    border: 0.2px solid #d9e2ec;
}

.no-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    padding: 60px 40px;
}

.no-messages-icon {
    font-size: 14px;
    margin-bottom: 24px;
    color: #e2e8f0;
    animation: float 3s ease-in-out infinite;
}

.no-messages p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #64748b;
}

/* Fix vertical stacking in welcome actions/features */
.welcome-actions button, .welcome-features .feature-item { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.welcome-features { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* Enhanced Chat Input */
.chat-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #eef2f7;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    flex: 0 0 auto; /* keep pinned at bottom */
    position: sticky;
    bottom: 0;
    z-index: 2; /* stick within chat panel scroll context */
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border-radius: 18px;
    padding: 8px;
    border: 0.2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
    background: #ffffff;
}

.chat-attach-btn,
.chat-emoji-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.chat-attach-btn:hover,
.chat-emoji-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: scale(1.1);
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 120px;
    font-weight: 500;
    color: #111827;
}

.message-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #429E9D 0%, #3a8f8a 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(66, 158, 157, 0.3);
    font-size: 14px;
}

.chat-send-btn:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 8px 24px rgba(66, 158, 157, 0.35);
}

/* Generic small rounded button used in headers/sidebars */
.premium-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    border: 0.2px solid #e5e7eb;
    background: #fff;
    color: #111827;
    transition: all 0.2s ease;
}
.premium-btn:hover {
    background: #f0fdfa;
    border-color: #429E9D;
    color: #429E9D;
}
.premium-btn:focus-visible {
    outline: 2px solid #429E9D;
    outline-offset: 2px;
}
.premium-btn.primary {
    background: #429E9D;
    color: #fff;
    border-color: #429E9D;
}
.premium-btn.primary:hover {
    background: #3a8f8a;
    border-color: #3a8f8a;
    color: #fff;
}
.premium-btn.secondary {
    background: #f9fafb;
    color: #111827;
    border-color: #e5e7eb;
}
.premium-btn.large {
    height: 44px;
    padding: 10px 16px;
    font-size: 15px;
}
.premium-btn i {
    font-size: 14px;
}

.loading-messages,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.loading-messages i,
.loading-state i {
    font-size: 24px;
    margin-bottom: 12px;
    color: #429E9D;
}

    .user-action-btn {
        flex: 1;
        padding: 10px 14px;
        border: none;
        border-radius: var(--radius-lg, 1rem);
        font-weight: 400;
        font-size: 14px;
        cursor: pointer;
        transition: all .3s cubic-bezier(.4,0,.2,1);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
        line-height: 1.1;
}

.retry-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Enhanced Responsive Design for Friends and Messages */
@media (max-width: 1024px) {
    .user-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 24px 20px;
    }
    
    .conversations-sidebar {
        width: 320px;
    }
    
    .friends-tab {
        padding: 14px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .messages-layout {
        height: calc(100vh - 140px);
        border-radius: 16px;
    }
    
    .conversations-sidebar {
        width: 100%;
        display: block;
    }
    
    .chat-area {
        display: none;
    }
    
    .conversations-sidebar.hidden {
        display: none;
    }
    
    .chat-area.mobile-active {
        display: flex;
        width: 100%;
    }
    
    .chat-header {
        padding: 20px 24px;
    }
    
    .chat-messages {
        padding: 20px 24px;
    }
    
    .chat-input-area {
        padding: 20px 24px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .user-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .user-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .user-card-header {
        margin-bottom: 16px;
    }
    
    .user-card-avatar {
        width: 56px;
        height: 56px;
        margin-right: 16px;
    }
    
    .user-card-info h4 {
        font-size: 18px;
    }
    
    .user-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .friends-search {
        padding: 16px 20px;
    }
    
    .friends-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .conversations-header {
        padding: 20px;
    }
    
    .conversations-header h3 {
        font-size: 20px;
    }
    
    .new-message-btn {
        width: 40px;
        height: 40px;
    }
    
    .no-conversation-selected {
        padding: 40px 20px;
    }
    
    .no-conversation-icon {
        font-size: 60px;
        margin-bottom: 20px;
    }
    
    .no-conversation-selected h3 {
        font-size: 24px;
    }
    
    .no-conversation-selected p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .friends-content {
        border-radius: 0 0 12px 12px;
    }
    
    .friends-tabs {
        border-radius: 12px 12px 0 0;
    }
    
    .friends-tab {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .user-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .user-card-avatar {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }
    
    .user-card-info h4 {
        font-size: 16px;
    }
    
    .user-action-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .conversations-header {
        padding: 16px;
    }
    
    .conversations-search {
        padding: 8px;
    }
    
    .friends-search {
        padding: 16px;
    }
    
    .friends-search-input,
    .conversations-search-input {
        padding: 14px 18px 14px 46px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-area {
        padding: 16px;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .message-content {
        padding: 12px 16px;
        border-radius: 16px;
    }
    
    .chat-input-wrapper {
        padding: 8px;
        border-radius: 20px;
    }
    
    .message-input {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Enhanced Scrollbar Styling for Messages and Friends */
.conversations-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.conversations-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.conversations-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
    border: 0.2px solid transparent;
    background-clip: content-box;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    background-clip: content-box;
}

/* Custom Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.conversation-item {
    animation: slideInLeft 0.3s ease forwards;
}

.user-card {
    animation: slideInRight 0.3s ease forwards;
}

.friends-tab {
    position: relative;
}

.friends-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    animation: expandWidth 0.3s ease;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 20px; }
}

/* Advanced Settings Styles */
.settings-nav-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.settings-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-tab:hover {
    color: #374151;
    background-color: #f9fafb;
}

.settings-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    background-color: #f3f4f6;
}

.settings-tab i {
    font-size: var(--post-font-size, 0.9rem);
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.setting-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-weight: 400;
    color: #1f2937;
    display: block;
    margin-bottom: 0.25rem;
}

.setting-description {
    font-size: var(--post-font-size, 0.9rem);
    color: #6b7280;
}

.setting-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.setting-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #7c3aed;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.setting-select {
    padding: 0.5rem 0.75rem;
    border: 0.2px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #374151;
    font-size: var(--post-font-size, 0.9rem);
    min-width: 150px;
}

.setting-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.setting-button {
    padding: 0.5rem 1rem;
    border: 0.2px solid #7c3aed;
    background: #7c3aed;
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-button:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}

.setting-button.secondary {
    background: white;
    color: #7c3aed;
}

.setting-button.secondary:hover {
    background: #f3f4f6;
}

.setting-button.danger {
    background: #dc2626;
    border-color: #dc2626;
}

.setting-button.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.theme-selector {
    display: flex;
    gap: 1rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.theme-option input {
    display: none;
}

.theme-preview {
    width: 60px;
    height: 40px;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.theme-option input:checked + .theme-preview {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.light-theme {
    background: #ffffff;
}

.light-theme .theme-header {
    height: 12px;
    background: #f3f4f6;
    margin-bottom: 2px;
}

.light-theme .theme-content {
    height: 26px;
    background: #e5e7eb;
}

.dark-theme {
    background: #1f2937;
}

.dark-theme .theme-header {
    height: 12px;
    background: #374151;
    margin-bottom: 2px;
}

.dark-theme .theme-content {
    height: 26px;
    background: #4b5563;
}

.auto-theme {
    background: linear-gradient(45deg, #ffffff 50%, #1f2937 50%);
}

.auto-theme .theme-header {
    height: 12px;
    background: linear-gradient(45deg, #f3f4f6 50%, #374151 50%);
    margin-bottom: 2px;
}

.auto-theme .theme-content {
    height: 26px;
    background: linear-gradient(45deg, #e5e7eb 50%, #4b5563 50%);
}

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
}

.setting-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: none;
}

.font-size-value {
    font-weight: 400;
    color: #7c3aed;
    min-width: 40px;
}

.notification-group {
    background: white;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.notification-group-title {
    font-weight: 400;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 14px;
}

.quiet-hours-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.time-input {
    padding: 0.5rem;
    border: 0.2px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #374151;
}

.cache-controls {
    display: flex;
    gap: 0.75rem;
}

.danger-zone {
    background: #fef2f2;
    border: 0.2px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone-title {
    font-weight: 400;
    color: #dc2626;
    margin-bottom: 1rem;
    font-size: 14px;
}

.settings-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.save-settings-btn {
    padding: 0.75rem 2rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-settings-btn:hover {
    background: #059669;
}

.save-status {
    color: #6b7280;
    font-size: var(--post-font-size, 0.9rem);
}

.save-status.success {
    color: #10b981;
}

.save-status.error {
    color: #dc2626;
}

/* Dark mode styles */
body.dark-mode .setting-item {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

body.dark-mode .setting-item:hover {
    background: #4b5563;
}

body.dark-mode .setting-label {
    color: #f9fafb;
}

body.dark-mode .setting-description {
    color: #d1d5db;
}

body.dark-mode .settings-section-title {
    color: #f9fafb;
    border-color: #4b5563;
}

body.dark-mode .notification-group {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .danger-zone {
    background: #3f1f20;
    border-color: #7f1d1d;
}

/* Theme Mode Implementations */
body.dark-mode {
    background-color: #1f2937;
    color: #f9fafb;
}

body.dark-mode .section-card {
    background-color: #374151;
    border-color: #4b5563;
}

body.dark-mode .post-card {
    background-color: #374151;
    border-color: #4b5563;
}

body.dark-mode .sidebar-container {
    background-color: #374151;
    border-color: #4b5563;
}

body.dark-mode input, 
body.dark-mode select, 
body.dark-mode textarea {
    background-color: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

body.dark-mode .nav-link {
    color: #d1d5db;
}

body.dark-mode .nav-link:hover {
    color: #f9fafb;
    background-color: #4b5563;
}

/* Compact Mode */
body.compact-mode .post-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

body.compact-mode .post-header {
    padding: 0.5rem;
}

body.compact-mode .setting-item {
    padding: 0.75rem;
}

body.compact-mode .section-card {
    padding: 1rem;
}

/* Reduce Motion */
body.reduce-motion * {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
}

/* Performance Modes */
body.battery-saver * {
    animation: none;
    transition: none;
    transform: none;
}

body.battery-saver .post-card {
    box-shadow: none;
}

body.minimal-mode .post-card {
    border: 0.2px solid #e5e7eb;
    box-shadow: none;
    background: white;
}

body.minimal-mode .sidebar-container {
    box-shadow: none;
}

body.high-performance .post-card {
    will-change: transform;
    transform: translateZ(0);
}

/* Colorblind Support */
body.protanopia {
    filter: url(#protanopia-filter);
}

body.deuteranopia {
    filter: url(#deuteranopia-filter);
}

body.tritanopia {
    filter: url(#tritanopia-filter);
}

/* Font Size Adjustments */
:root {
    --base-font-size: 14px;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    /* Accent system */
    --accent: #429E9D; /* primary teal */
    --accent-hover: #377f7e;
    --accent-muted: #d1f4f3;
    --on-accent: #ffffff;
    --focus-ring: 0 0 0 3px rgba(66,158,157,0.45);
}

/* Theming via data-theme attribute */
[data-theme="dark"] {
    /* New dark palette (dark light grey + matte white text) */
    --bg-app: #1c1f24; /* overall page background */
    --bg-primary: #23272e; /* primary surface (body/base) */
    --bg-secondary: #2c3139; /* cards / panels */
    --bg-tertiary: #343a44; /* elevated surfaces, hovers */
    --header-bg: #1e2228; /* header bar */
    --text-primary: #f2f3f5; /* matte white */
    --text-secondary: #c1c5cc; /* subdued */
    --border-color: #3d444c; /* subtle border */
    --shadow-color: 0 4px 16px rgba(0,0,0,.55);
    --accent: #429E9D;
    --accent-hover: #3a8d8b;
    --accent-muted: #2c4f52;
    --on-accent: #ffffff;
    --focus-ring: 0 0 0 3px rgba(90,190,188,.55);
}

/* Dim (mid) theme */
[data-theme="dim"] {
    --bg-app: #f2f3f5;
    --bg-primary: #f6f7f8;
    --bg-secondary: #eceef1;
    --bg-tertiary: #e2e5e9;
    --header-bg: #e9ebee;
    --text-primary: #202428;
    --text-secondary: #575d63;
    --border-color: #cfd4d9;
    --shadow-color: 0 4px 14px rgba(0,0,0,.08);
    --accent: #5662d6; /* subtle purple for dim */
    --accent-hover: #4955c7;
    --accent-muted: #dde0fa;
    --on-accent: #ffffff;
    --focus-ring: 0 0 0 3px rgba(86,98,214,.4);
}

[data-theme="dim"] body { background: var(--bg-app); color: var(--text-primary); }
[data-theme="dim"] header,
[data-theme="dim"] #site-header { background: var(--header-bg); }
[data-theme="dim"] .post-card,
[data-theme="dim"] .section-card,
[data-theme="dim"] .sidebar-container { background: var(--bg-secondary); }

[data-theme="dark"] body {
    background: var(--bg-app);
    color: var(--text-primary);
}

[data-theme="dark"] header,
[data-theme="dark"] #site-header,
[data-theme="dark"] .main-header {
    background: var(--header-bg);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
}

[data-theme="dark"] main,
[data-theme="dark"] .main-container,
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .feed-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Elevation surfaces adopt secondary */
[data-theme="dark"] .post-card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .sidebar-container,
[data-theme="dark"] .setting-item,
[data-theme="dark"] .notification-group,
[data-theme="dark"] .global-news-card,
[data-theme="dark"] #mobile-slide-menu,
[data-theme="dark"] #global-search-results {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .post-card:hover,
[data-theme="dark"] .section-card:hover,
[data-theme="dark"] .setting-item:hover,
[data-theme="dark"] .global-news-card:hover {
    background-color: var(--bg-tertiary);
}
[data-theme="dark"] a,
[data-theme="dark"] button,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .mobile-nav-link { color: var(--text-primary); }

/* Force override common inline white backgrounds */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color: #111827"] {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Form controls */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #24324b;
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Navigation link adjustments */
[data-theme="dark"] .nav-link { color: var(--text-secondary); }
[data-theme="dark"] .nav-link:hover { color: var(--text-primary); background: #24324b; }

/* Helper utility classes so we can switch inline-styled legacy elements */
.bg-surface { background: var(--bg-secondary); }
.bg-base { background: var(--bg-primary); }
.text-base { color: var(--text-primary); }
.text-dim { color: var(--text-secondary); }
.border-base { border-color: var(--border-color); }

/* Override some common inline button / link styling in dark mode without touching markup */
[data-theme="dark"] a.header-btn,
[data-theme="dark"] #mobile-slide-menu .mobile-nav-link,
[data-theme="dark"] #mobile-slide-menu button,
[data-theme="dark"] #global-search-results { 
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] #mobile-slide-menu { box-shadow: 4px 0 15px rgba(0,0,0,0.55); }

[data-theme="dark"] #global-search { background: var(--bg-primary); color: var(--text-primary); }

/* Accent usage utilities */
.btn-accent, [data-theme] .btn-accent { background: var(--accent); color: var(--on-accent); border: 0.2px solid var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.pill-accent { background: var(--accent-muted); color: var(--accent); }

/* Focus accessibility */
*:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }

/* Smooth theme transitions (opt-in if prefers-reduced-motion is off) */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] body, html[data-theme] .post-card, html[data-theme] .section-card, html[data-theme] .sidebar-container, html[data-theme] input, html[data-theme] textarea, html[data-theme] select, html[data-theme] .setting-item {
      transition: background-color .35s ease, color .35s ease, border-color .35s ease;
  }
}

body {
    font-size: var(--base-font-size);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.post-card {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.section-card {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.sidebar-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

input, textarea, select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.post-content-text {
    font-size: 11px;
    color: #000000;
}

.setting-label {
    font-size: calc(var(--base-font-size) + 1px);
}

/* Profile popup animations and styles */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Profile modal responsive design */
@media (max-width: 640px) {
    .profile-modal {
        margin: 1rem;
        padding: 1.5rem;
        max-height: 85vh;
    }
}

/* Notification system styles */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #f0f9ff;
    border-left: 4px solid #7c3aed;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.notification-content-text {
    flex: 1;
    color: #000000;
}

.notification-title {
    font-weight: 400;
    color: #000000;
    margin-bottom: 0.25rem;
}

.notification-message {
    color: #000000;
    font-size: var(--post-font-size, 0.9rem);
    margin-bottom: 0.5rem;
}

.notification-time {
    color: #6b7280;
    font-size: 11px;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.notification-action {
    padding: 0.25rem 0.75rem;
    border: 0.2px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    color: #374151;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action:hover {
    background: #f3f4f6;
}

.notification-action.primary {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

.notification-action.primary:hover {
    background: #6d28d9;
}

@media (max-width: 640px) {
    .notification-item {
        padding: 0.75rem;
    }
    
    .notification-avatar {
        width: 35px;
        height: 35px;
    }
}

/* Responsive adjustments for settings */
@media (max-width: 768px) {
    .settings-nav-tabs {
        flex-wrap: wrap;
    }
    
    .settings-tab {
        padding: 0.5rem 1rem;
        font-size: var(--post-font-size, 0.9rem);
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .theme-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .cache-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .quiet-hours-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Notification styles */
.notification {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Settings accessibility improvements */
.setting-toggle:focus-within .toggle-slider {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

.settings-tab:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

.setting-button:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Header text color driven by data-mood for stable targeting */
.post-header[data-mood] *, .post-card[data-mood] .post-header * { color: var(--post-header-text, inherit); }

/* Light moods → black text for contrast */
.post-header[data-mood="Happy"], .post-card[data-mood="Happy"] .post-header { --post-header-text:#000; }
.post-header[data-mood="Neutral"], .post-card[data-mood="Neutral"] .post-header { --post-header-text:#000; }
.post-header[data-mood="Disappointed"], .post-card[data-mood="Disappointed"] .post-header { --post-header-text:#000; }
.post-header[data-mood="Embarrassed"], .post-card[data-mood="Embarrassed"] .post-header { --post-header-text:#000; }
.post-header[data-mood="Anxious"], .post-card[data-mood="Anxious"] .post-header { --post-header-text:#000; }

/* Dark moods → white text for contrast */
.post-header[data-mood="Love"], .post-card[data-mood="Love"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Amused"], .post-card[data-mood="Amused"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Excitement"], .post-card[data-mood="Excitement"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Excited"], .post-card[data-mood="Excited"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Optimistic"], .post-card[data-mood="Optimistic"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Interested"], .post-card[data-mood="Interested"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Surprise"], .post-card[data-mood="Surprise"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Relief"], .post-card[data-mood="Relief"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Disgust"], .post-card[data-mood="Disgust"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Envy"], .post-card[data-mood="Envy"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Fear"], .post-card[data-mood="Fear"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Sadness"], .post-card[data-mood="Sadness"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Sad"], .post-card[data-mood="Sad"] .post-header { --post-header-text:#fff; }
.post-header[data-mood="Angry"], .post-card[data-mood="Angry"] .post-header { --post-header-text:#fff; }

/* ===== PAGES (Tags + Moods) UNIFIED MOSAIC ===== */
#pages-section { display:flex; flex-direction:column; }
#pages-section.packed-layout #pages-list { width:100%; }
#pages-section .page-tile { opacity:1; transition:opacity .35s ease, transform .35s ease; }
#pages-section.fading-tiles .page-tile { opacity:0; pointer-events:none; }
#pages-section.tiles-hidden #pages-list { display:none; }
#pages-section #pages-list { 
    display:grid;
    grid-auto-flow:dense;
    grid-template-columns:repeat(auto-fill,minmax(110px,1fr));
    /* Increased base dimensions for fuller coverage */
    --tile-h-unit: 34px; 
    --tile-col-w: 110px; 
    column-gap:0; 
    row-gap:0; 
    align-items:start;
    width:100%;
    max-width:100%;
    margin: 0 0 1.25rem 0;
    box-sizing:border-box;
}

#pages-section .page-tile { 
    --tile-bg: #111827; 
    --tile-fg: #ffffff; 
    --tile-border: #000; 
    --tile-shadow: 2px 2px 0 #000; 
    position:relative; 
    background: var(--tile-bg); 
    color: var(--tile-fg); 
    border: 0.2px solid var(--tile-border); 
    border-radius:.6rem; 
    padding:0.4rem .45rem 0.38rem; 
    font-size:.58rem; 
    font-weight: 400; 
    cursor:pointer; 
    display:flex; 
    align-items:flex-start; 
    justify-content:flex-start; 
    text-align:left; 
    line-height:1.1; 
    box-shadow: var(--tile-shadow); 
    overflow:hidden; 
    isolation:isolate; 
    transition:transform .28s cubic-bezier(.4,.2,.2,1), box-shadow .28s ease, background .28s ease; 
}
#pages-section .page-tile.size-h4, 
#pages-section .page-tile.size-h5 { padding-top:1rem; }

#pages-section .page-tile span { position:relative; z-index:2; }

#pages-section .page-tile::after { 
    content:""; 
    position:absolute; 
    inset:0; 
    background:
        linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 55%),
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 65%); 
    opacity:.55; 
    pointer-events:none; 
    z-index:1; 
    mix-blend-mode:overlay; 
    transition:opacity .35s ease; 
}

#pages-section .page-tile:hover { 
    transform:translateY(-6px) rotate(-2deg); 
    box-shadow:6px 10px 0 #000, 0 8px 18px rgba(0,0,0,.25); 
}

/* Video-specific styles for post display */
.video-container {
    position: relative;
    margin: 0.75rem auto;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #000;
    border: 0.2px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-video {
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: contain !important;
    background: #000 !important;
    border-radius: 0.75rem !important;
    display: block !important;
}

/* Video upload preview styling */
.video-preview-container {
    position: relative;
    margin: 0.5rem auto 0 auto;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 0.2px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-preview-container video {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    background: #000;
    display: block;
}

/* Video upload area styling */
#video-upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
}

#video-upload-area:hover {
    border-color: #962FBF !important;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 158, 157, 0.2);
}

/* Video caption styling */
#video-caption {
    transition: border-color 0.2s ease;
}

#video-caption:focus {
    border-color: #962FBF !important;
    box-shadow: 0 0 0 3px rgba(150, 47, 191, 0.1) !important;
}

/* Responsive video styling */
@media (max-width: 768px) {
    .post-video {
        max-height: 300px !important;
    }
    
    .video-preview-container video {
        max-height: 300px;
    }
    
    #video-upload-area {
        padding: 2rem !important;
    }
}

/* Video controls enhancement */
.post-video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.8));
}

.post-video::-webkit-media-controls-play-button,
.post-video::-webkit-media-controls-fullscreen-button {
    filter: brightness(1.2);
}

#pages-section .page-tile:active { transform:translateY(-2px) scale(.96); }

/* Five unified size classes (only height differs; all one column wide) */
#pages-section .page-tile.size-1 { height: calc(var(--tile-h-unit) * 1.3); }
#pages-section .page-tile.size-2 { height: calc(var(--tile-h-unit) * 1.6); }
#pages-section .page-tile.size-3 { height: calc(var(--tile-h-unit) * 2.4); }
#pages-section .page-tile.size-4 { height: calc(var(--tile-h-unit) * 3.2); }
#pages-section .page-tile.size-5 { height: calc(var(--tile-h-unit) * 4.2); }

/* Packed masonry override (JS adds .packed-layout to #pages-section) */
#pages-section.packed-layout #pages-list { display:block; position:relative; width:100%; max-width:100%; margin: 0 0 1.25rem 0; }
#pages-section.packed-layout #pages-list .page-tile { 
    position:absolute; 
    width:var(--tile-col-w); 
    left:0; top:0; 
    will-change:transform; 
}
#pages-section #pages-list .page-tile { max-width:100%; }
#pages-section.packed-layout #pages-list .page-tile.wide { width:calc(var(--tile-col-w) * 2); }

/* Ensure content doesn't overflow and scrollbars don't appear */
#pages-section .page-tile { overflow:hidden; }

/* Slight top/bottom padding scaling for taller tiles */
#pages-section .page-tile.size-h3 span, 
#pages-section .page-tile.size-h4 span, 
#pages-section .page-tile.size-h5 span { font-size:.85rem; line-height:1.2; }

/* Slightly larger padding on large vertical spans for visual balance */
#pages-section .page-tile.size-r3 span, 
#pages-section .page-tile.size-c2r3 span { font-size:.85rem; line-height:1.2; }

/* Responsive fallback: collapse large spans on narrow screens */
@media (max-width: 640px) {
    #pages-section .page-tile.size-wide,
    #pages-section .page-tile.size-tall,
    #pages-section .page-tile.size-large { grid-column: span 1; grid-row: span 1; }
    /* Force grid mode and remove absolute positioning on mobile */
    #pages-section #pages-list { display:grid; position: static; height: auto; }
    #pages-section.packed-layout #pages-list { display:grid; position: static; height: auto; }
    #pages-section.packed-layout #pages-list .page-tile { position: static; transform: none; width: auto; }
}

/* Pages feed styling */
#pages-section #pages-feed { 
    display:flex; 
    flex-direction:column; 
    gap:1rem; 
}

#pages-section #pages-back-btn { 
    background:#fff; 
    border: 0.2px solid #000; 
    padding:.45rem .8rem; 
    border-radius:.5rem; 
    font-size:.75rem; 
    cursor:pointer; 
    font-weight: 400; 
    transition:background .25s ease, transform .25s ease; 
}
#pages-section #pages-back-btn:hover { background:#f1f5f9; transform:translateY(-2px); }

/* Accessibility focus */
#pages-section .page-tile:focus-visible { outline:3px solid #fff; outline-offset:2px; }

/* Dark/Light contrast adjustments auto via luminance JS -> sets vars */

/* Mobile bottom navigation */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
        background: #ffffff;
        border-top: 2px solid #000;
        box-shadow: 0 -6px 16px rgba(0,0,0,0.08);
        z-index: 1000;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
    }
    .mobile-bottom-nav .mbn-btn {
        appearance: none;
        background: transparent;
        border: none;
        height: 100%;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
            position: relative;
        color: #111827;
        font-weight: 400;
        font-size: 10px;
        text-decoration: none;
        cursor: pointer;
    }
    .mobile-bottom-nav .mbn-btn i { font-size: 18px; }
    .mobile-bottom-nav .mbn-btn[aria-current="page"],
    .mobile-bottom-nav .mbn-btn.active {
        color: #0f172a;
        background: linear-gradient(180deg, #f0fdfa, #ecfeff);
    }
    .mobile-bottom-nav .mbn-center {
        position: relative;
    }
    .mobile-bottom-nav .mbn-create {
        position: absolute;
        top: -22px;
        left: 50%;
        transform: translateX(-50%);
        background: #429E9D;
        color: #fff;
        border: 0.2px solid #000;
        width: 48px;
        height: 48px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 18px rgba(66,158,157,0.35);
    }
    .mobile-bottom-nav .mbn-create i { font-size: 20px; }
}

/* Desktop header positioning */
@media (min-width: 768px) {
    #site-header {
        left: calc(max(var(--gap), (100vw - var(--center-max)) / 2 + var(--gap)));
        right: calc(max(var(--gap), (100vw - var(--center-max)) / 2 + var(--gap)));
        padding: 0;
    }
    
    .header-inner {
        min-height: var(--header-offset, 6rem);
        gap: 0.75rem;
    }
    
    #logo-link img {
        height: var(--header-offset, 6rem);
        max-height: var(--header-offset, 6rem);
    }
    
    #mobile-hamburger-btn {
        display: none;
    }
    
    /* Show text labels on larger screens */
    .hidden-sm {
        display: inline;
    }
}

/* Mobile header optimizations */
@media (max-width: 767px) {
    /* Header adjustments - simple white header */
    #site-header {
        left: 0;
        right: 0;
        width: 100vw;
    padding: 0.5rem 0.75rem;
        background: #ffffff;
        border-bottom: 2px solid #000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .header-inner {
    gap: 0.5rem;
    min-height: 2.75rem;
        padding: 0;
        justify-content: space-between;
    }
    
    /* Logo - smaller */
    #logo-link img {
    height: 2rem;
    max-height: 2rem;
    }
    
    /* Hide search bar on mobile */
    .header-search {
        display: none;
    }
    
    /* Show all buttons as icon-only */
    #header-friends-btn,
    #header-messages-btn,
    #create-post-desktop {
        display: inline-flex;
    padding: 0.4rem;
        min-width: auto;
    width: 2.25rem;
    height: 2.25rem;
        justify-content: center;
        align-items: center;
    }
    
    /* Maintain create post button color in responsive view */
    #create-post-desktop {
        background-color: #429E9D;
        color: white;
        border: none;
    }
    
    /* Hide text labels - icons only */
    .hidden-sm {
        display: none;
    }
    
    /* Show hamburger button */
    #mobile-hamburger-btn {
        display: block;
        flex-shrink: 0;
    padding: 0.4rem;
    width: 2.25rem;
    height: 2.25rem;
    }
    
    /* Header actions container */
    .header-actions {
        display: flex;
        align-items: center;
    gap: 0.5rem;
        margin-left: auto;
    }
    
    /* Update CSS variable for mobile header height */
    :root {
    --header-offset: 3rem;
    }
}

/* Medium screens - hide text labels but keep buttons */
@media (min-width: 768px) and (max-width: 1024px) {
    .hidden-sm {
        display: none;
    }
    
    .header-btn {
        padding: 0.6rem;
    }
}

/* ===== Profile Customization Overlay ===== */
#profile-customize-overlay { display:none; position: fixed; inset: 0; z-index: 1000; }
#profile-customize-overlay .profile-customize-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; padding: 16px; }
#profile-customize-overlay .profile-customize-panel { background: var(--surface, #111); color: var(--text, #fff); width: min(720px, 100%); max-height: 90vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); display:flex; flex-direction:column; overflow:hidden; border: 0.2px solid rgba(255,255,255,0.08); }
#profile-customize-overlay .panel-header { display:flex; align-items:center; justify-content:space-between; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
#profile-customize-overlay .panel-header h2 { font-size: 18px; margin:0; }
#profile-customize-overlay .icon-btn { background: transparent; border: none; color: inherit; cursor: pointer; font-size: 16px; padding: 6px; border-radius: 6px; }
#profile-customize-overlay .icon-btn:hover { background: rgba(255,255,255,0.08); }
#profile-customize-overlay .panel-body { padding: 12px 16px; overflow:auto; }
#profile-customize-overlay .form-row { display:flex; flex-direction:column; gap: 6px; margin-bottom: 12px; }
#profile-customize-overlay label { font-size: 11px; opacity: 0.8; }
#profile-customize-overlay input, #profile-customize-overlay textarea, #profile-customize-overlay select { background: rgba(255,255,255,0.06); border: 0.2px solid rgba(255,255,255,0.12); color: inherit; border-radius: 8px; padding: 10px 12px; outline:none; }
#profile-customize-overlay input:focus, #profile-customize-overlay textarea:focus, #profile-customize-overlay select:focus { border-color: rgba(255,255,255,0.3); box-shadow: 0 0 0 2px rgba(255,255,255,0.08) inset; }
#profile-customize-overlay .grid-2 { display:grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { #profile-customize-overlay .grid-2 { grid-template-columns: 1fr 1fr; } }
#profile-customize-overlay .form-footer { display:flex; justify-content:flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); position: sticky; bottom: 0; background: inherit; }

/* Overlay buttons */
#profile-customize-overlay .btn { border-radius: 8px; padding: 10px 14px; border: 0.2px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: inherit; cursor: pointer; }
#profile-customize-overlay .btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
#profile-customize-overlay .btn.secondary { background: rgba(255,255,255,0.06); }

/* ===== Header Inline Badges ===== */
#profile-badges { display:none; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
#profile-badges .badge { display:flex; align-items:center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,0.04); border: 0.2px solid rgba(0,0,0,0.08); }
@media (prefers-color-scheme: dark) { #profile-badges .badge { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); } }
#profile-badges .b-ico { font-size: 16px; line-height: 1; }
#profile-badges .b-title { font-size: 11px; font-weight: 400; }
#profile-badges .b-sub { font-size: 11px; opacity: 0.7; margin-top: -2px; }

/* Privacy selects in customization */
#profile-customize-overlay .privacy-select { margin-top: 6px; opacity: 0.9; }

/* Cover photo overlay hover */
.profile-cover-photo .cover-photo-overlay { opacity: 0; transition: opacity .2s ease; }
.profile-cover-photo:hover .cover-photo-overlay { opacity: 1; }

/* Toast container lives inline styled; normalize size */
.toast { font-size: var(--post-font-size, 0.9rem); }

/* Enhanced Commentary Card - Additional Styles */
.original-post-preview {
    padding: 1.25rem;
    background: white;
}

.preview-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.content-media {
    flex-shrink: 0;
}

.original-post-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.original-post-excerpt {
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.original-post-details {
    font-size: var(--post-font-size, 0.9rem);
    line-height: 1.4;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* Tags Section */
.original-post-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.tags-label {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.post-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 0.2px solid #f3f4f6;
}

/* Commentary Footer */
.commentary-footer {
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.footer-actions {
    display: flex;
    justify-content: flex-end;
}

.thread-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: var(--post-font-size, 0.9rem);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.thread-action-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thread-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.thread-action-btn i {
    font-size: 11px;
}

/* Responsive Commentary Card */
@media (max-width: 768px) {
    .commentary-header {
        padding: 0.875rem 1rem;
    }
    
    .commentary-icon-wrapper {
        width: 36px;
        height: 36px;
    }
    
    .commentary-icon {
        font-size: 16px;
    }
    
    .commentary-action {
        font-size: var(--post-font-size, 0.9rem);
    }
    
    .commentary-context {
        font-size: 11px;
    }
    
    .original-post-preview {
        padding: 1rem;
    }
    
    .preview-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .content-media {
        align-self: center;
    }
    
    .original-post-title {
        font-size: 14px;
    }
    
    .original-post-tags {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .post-thumbnail {
        width: 64px;
        height: 64px;
    }
    
    .commentary-footer {
        padding: 0.875rem 1rem;
    }
    
    .thread-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .thread-action-btn span {
        display: none;
    }
    
    .thread-action-btn {
        padding: 0.5rem;
        border-radius: 50%;
        min-width: 40px;
        justify-content: center;
    }
}

/* Profile Viewing System */
.profile-link {
    color: #429E9D;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-link:hover {
    color: #3a8f8a;
    text-decoration: underline;
}

.profile-view-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-view-actions .btn-primary,
.profile-view-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 400;
    font-size: var(--post-font-size, 0.9rem);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.profile-view-actions .btn-primary {
    background: linear-gradient(135deg, #429E9D 0%, #3a8f8a 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(66, 158, 157, 0.3);
}

.profile-view-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 158, 157, 0.4);
}

.profile-view-actions .btn-secondary {
    background: #ffffff;
    color: #429E9D;
    border: 0.2px solid #429E9D;
}

.profile-view-actions .btn-secondary:hover:not(:disabled) {
    background: #f0fdfa;
    transform: translateY(-1px);
}

.profile-view-actions .btn-primary:disabled,
.profile-view-actions .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #e5e7eb;
    color: #6b7280;
    border-color: #e5e7eb;
}

/* Profile Posts Grid */
.profile-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.profile-post-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 0.2px solid rgba(0, 0, 0, 0.06);
}

.profile-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(66, 158, 157, 0.3);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8fafc;
}

.post-card-content {
    padding: 1.25rem;
}

.post-card-text {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #6b7280;
}

.post-card-date {
    font-weight: 500;
}

.post-card-stats {
    display: flex;
    gap: 1rem;
}

.post-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-card-stats i {
    color: #429E9D;
    font-size: 11px;
}

/* Profile Error State */
.profile-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
}

.profile-error .error-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.profile-error h3 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 0.75rem 0;
}

.profile-error p {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 2rem 0;
    max-width: 400px;
}

.profile-error .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #429E9D 0%, #3a8f8a 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(66, 158, 157, 0.3);
}

.profile-error .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 158, 157, 0.4);
}

/* About Section for Profile Viewing */
.about-section .about-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 1rem;
    border: 0.2px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.about-section .about-item h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 0.75rem 0;
}

.about-section .about-item h4 i {
    color: #429E9D;
    font-size: 14px;
}

.about-section .about-item p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design for Profile Viewing */
@media (max-width: 768px) {
    .profile-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.75rem 0;
    }
    
    .profile-view-actions {
        flex-direction: column;
    }
    
    .profile-view-actions .btn-primary,
    .profile-view-actions .btn-secondary {
        justify-content: center;
        width: 100%;
    }
    
    .profile-error {
        padding: 3rem 1rem;
    }
    
    .profile-error .error-icon {
        font-size: 14px;
    }
    
    .about-section .about-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* ===== POLL STYLES ===== */
.poll-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.75rem;
}

.poll-question {
    font-weight: 400;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.poll-options {
    margin-bottom: 1rem;
}

.poll-option {
    cursor: pointer;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 0.2px solid #e5e7eb;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #ffffff;
}

.poll-option:hover {
    border-color: #429E9D;
    box-shadow: 0 2px 4px rgba(66, 158, 157, 0.1);
}

.poll-option.voted {
    border-color: #429E9D;
    background: #f0fdfc;
}

.poll-option.winning {
    border-color: #059669;
    background: #ecfdf5;
}

.poll-option-background {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #f3f4f6;
    transition: width 0.3s ease;
    z-index: 1;
    border-radius: 0 0.375rem 0.375rem 0;
}

.poll-option.voted .poll-option-background {
    background-color: rgba(66, 158, 157, 0.2);
}

.poll-option.winning .poll-option-background {
    background-color: rgba(5, 150, 105, 0.2);
}

.poll-option-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option-text {
    font-weight: 400;
    font-size: 0.9rem;
    color: #374151;
}

.poll-option.voted .poll-option-text {
    font-weight: 500;
    color: #1f2937;
}

.poll-option-stats {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
}

.poll-footer {
    margin-top: 1rem;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    padding-top: 0.75rem;
    border-top: 0.2px solid #e5e7eb;
}

/* Poll creation styles */
.poll-option-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.poll-option-input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 0.2px solid #e9ecef;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.poll-option-input:focus {
    border-color: #429E9D;
    box-shadow: 0 0 0 2px rgba(66, 158, 157, 0.1);
}

.remove-option-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem;
    margin-left: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.remove-option-btn:hover:not(:disabled) {
    background: #dc2626;
}

.remove-option-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

#add-poll-option {
    background: #429E9D;
    color: white;
    border: 0.2px solid #000000;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 400;
    transition: background-color 0.2s ease;
}

#add-poll-option:hover {
    background: #368a89;
}

@media (max-width: 767px) {
    .poll-container {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .poll-question {
        font-size: 14px;
    }
    
    .poll-option-text {
        font-size: 14px;
    }
    
    .poll-option {
        padding: 0.625rem;
    }
}

/* ===== SPAM PROTECTION STYLES ===== */
.submit-btn-cooldown {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

#submit-post:disabled,
.submit-post-btn:disabled,
button[data-action="submit-post"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.cooldown-indicator {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Comprehensive media centering for post cards */
.post-card .image-preview-container,
.post-card .video-preview-container,
.post-card .video-container,
.post-card .post-image-preview,
.post-card .shared-card {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure media elements within post cards are centered */
.post-card img,
.post-card video {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

