﻿/* ================================================================
   COMMODITY SAMACHAR — Premium Financial Community
   Design: Editorial luxe — Lora + Albert Sans
   Deep shadows, gradient accents, user avatars, rich cards
   ================================================================ */

/* -- RESET -------------------------------------------------- */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* -- LIGHT THEME -------------------------------------------- */
:root, [data-theme="light"] {
    --bg-primary:    #ffffff;
    --bg-secondary:  #f5f3ef;
    --bg-tertiary:   #ece9e2;
    --bg-card:       #ffffff;
    --bg-input:      #fafaf8;
    --bg-hover:      rgba(0,0,0,0.025);
    --bg-sidebar:    #faf9f7;

    --border:        #e2dfd8;
    --border-light:  #edebe6;
    --border-focus:  #0d9488;

    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;
    --text-dim:       #94a3b8;

    --accent:         #0d9488;
    --accent-hover:   #0f766e;
    --accent-light:   #f0fdfa;
    --accent-glow:    rgba(13,148,136,0.12);
    --accent-gradient: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);

    --gold:           #b45309;
    --gold-light:     #fffbeb;
    --gold-border:    #fde68a;
    --gold-gradient:  linear-gradient(135deg, #d97706 0%, #f59e0b 100%);

    --success:        #15803d;
    --success-light:  #f0fdf4;
    --danger:         #dc2626;
    --danger-light:   #fef2f2;

    --cat-options:        #b45309;
    --cat-options-bg:     #fffbeb;
    --cat-options-border: #fde68a;
    --cat-commodity:        #15803d;
    --cat-commodity-bg:     #f0fdf4;
    --cat-commodity-border: #bbf7d0;
    --cat-forex:        #1d4ed8;
    --cat-forex-bg:     #eff6ff;
    --cat-forex-border: #bfdbfe;

    --shadow-xs:   0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:   0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-xl:   0 20px 50px -12px rgba(0,0,0,0.15);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 12px 28px -8px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.04);

    --navbar-bg:      rgba(255,255,255,0.82);
    --modal-backdrop: rgba(15,23,42,0.55);

    --radius:    8px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --font-heading: 'Lora', Georgia, serif;
    --font-body:    'Albert Sans', system-ui, sans-serif;

    color-scheme: light;
}

/* -- DARK THEME --------------------------------------------- */
[data-theme="dark"] {
    --bg-primary:    #0e0e0d;
    --bg-secondary:  #080808;
    --bg-tertiary:   #1a1917;
    --bg-card:       #141413;
    --bg-input:      #1a1917;
    --bg-hover:      rgba(255,255,255,0.04);
    --bg-sidebar:    #0e0e0d;

    --border:        #282724;
    --border-light:  #1e1d1a;
    --border-focus:  #2dd4bf;

    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;
    --text-dim:       #64748b;

    --accent:         #2dd4bf;
    --accent-hover:   #14b8a6;
    --accent-light:   rgba(45,212,191,0.07);
    --accent-glow:    rgba(45,212,191,0.18);
    --accent-gradient: linear-gradient(135deg, #2dd4bf 0%, #22d3ee 100%);

    --gold:           #fbbf24;
    --gold-light:     rgba(251,191,36,0.06);
    --gold-border:    rgba(251,191,36,0.18);
    --gold-gradient:  linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);

    --success:        #4ade80;
    --success-light:  rgba(74,222,128,0.07);
    --danger:         #f87171;
    --danger-light:   rgba(248,113,113,0.08);

    --cat-options:        #fbbf24;
    --cat-options-bg:     rgba(251,191,36,0.07);
    --cat-options-border: rgba(251,191,36,0.18);
    --cat-commodity:        #4ade80;
    --cat-commodity-bg:     rgba(74,222,128,0.07);
    --cat-commodity-border: rgba(74,222,128,0.15);
    --cat-forex:        #60a5fa;
    --cat-forex-bg:     rgba(96,165,250,0.07);
    --cat-forex-border: rgba(96,165,250,0.15);

    --shadow-xs:   0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md:   0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg:   0 10px 30px rgba(0,0,0,0.5);
    --shadow-xl:   0 20px 50px rgba(0,0,0,0.6);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.02);
    --shadow-card-hover: 0 12px 28px rgba(0,0,0,0.45);

    --navbar-bg:      rgba(14,14,13,0.88);
    --modal-backdrop: rgba(0,0,0,0.7);

    color-scheme: dark;
}

/* -- BASE --------------------------------------------------- */
html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.35s ease, color 0.35s ease;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: #fff; }

/* -- KEYFRAMES ---------------------------------------------- */
@keyframes fadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes slideUp { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }
@keyframes pulse   { 0%,100% { opacity:1 } 50% { opacity:.6 } }
@keyframes glow    { 0%,100% { box-shadow: 0 0 8px var(--accent-glow) } 50% { box-shadow: 0 0 20px var(--accent-glow) } }
@keyframes shimmer { 0% { background-position:-200% center } 100% { background-position:200% center } }

/* -- NAVBAR ------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-bottom: 1px solid var(--border-light);
    height: 64px;
}
.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.6;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-primary);
    transition: opacity 0.2s;
}
.navbar-brand:hover { opacity: 0.85; color: var(--text-primary); }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.brand-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 100px;
}

.user-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
    animation: pulse 2.5s ease infinite;
}

/* -- THEME TOGGLE ------------------------------------------- */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
    transform: rotate(20deg);
}
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* -- BUTTONS ------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: #ffffff;
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(220,38,38,0.2);
}
.btn-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.btn-sm { font-size: 0.78rem; padding: 0.42rem 0.9rem; }
.btn-xs { font-size: 0.72rem; padding: 0.32rem 0.7rem; }
.btn-full { width: 100%; }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius);
    transition: all 0.15s;
    line-height: 1;
}
.btn-icon-danger:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* -- BADGES ------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.62rem;
    padding: 0.18rem 0.6rem;
    border-radius: 100px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.5;
}

.badge-admin {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-glow);
}
.badge-cat { border: 1px solid; }

.badge-options {
    color: var(--cat-options);
    border-color: var(--cat-options-border);
    background: var(--cat-options-bg);
}
.badge-commodity {
    color: var(--cat-commodity);
    border-color: var(--cat-commodity-border);
    background: var(--cat-commodity-bg);
}
.badge-forex {
    color: var(--cat-forex);
    border-color: var(--cat-forex-border);
    background: var(--cat-forex-bg);
}

.badge-sm { font-size: 0.58rem; padding: 0.12rem 0.45rem; }

/* -- AVATARS ------------------------------------------------ */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.72rem;
    color: #fff;
    background: hsl(var(--hue, 200), 55%, 50%);
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.avatar::before { content: attr(data-initial); }
.avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar-lg { width: 42px; height: 42px; font-size: 0.85rem; }

/* -- 3-COLUMN LAYOUT ---------------------------------------- */
.layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 0;
    min-height: calc(100vh - 64px);
}

/* -- SIDEBARS ----------------------------------------------- */
.sidebar {
    padding: 1.75rem 1.5rem;
}

.sidebar-left {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-right {
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-light);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2.25rem;
}

.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-light);
}

/* Category nav */
.cat-nav { list-style: none; }

.cat-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 3px;
    position: relative;
}
.cat-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.cat-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.cat-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.cat-dot.cat-options   { background: var(--cat-options); }
.cat-dot.cat-commodity { background: var(--cat-commodity); }
.cat-dot.cat-forex     { background: var(--cat-forex); }

/* Stats */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
}

.stat-item {
    text-align: center;
    padding: 0.85rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}
.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
    display: block;
}

/* -- FEED --------------------------------------------------- */
.feed {
    padding: 2rem 2.25rem;
    min-width: 0;
    background: var(--bg-secondary);
}

.feed-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1.15rem;
    border-bottom: 2px solid var(--border);
}

.feed-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    line-height: 1.2;
}

.feed-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* -- POST CARDS --------------------------------------------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    padding: 1.4rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.post-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: var(--border);
}
.post-card:hover::before {
    opacity: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.post-author {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-left: auto;
    font-weight: 500;
}

.post-title {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.4rem;
}
.post-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}
.post-title a:hover { color: var(--accent); }

.post-snippet {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.7rem;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.3rem;
}

.comment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}
.comment-indicator svg { opacity: 0.5; }

/* -- TRENDING ----------------------------------------------- */
.trending-list { list-style: none; }

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.trending-item:last-child { border-bottom: none; }

.trending-rank {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    min-width: 1.3rem;
    text-align: center;
    padding-top: 0.05rem;
    color: var(--text-dim);
}
.trending-item:first-child .trending-rank {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.trending-item:nth-child(2) .trending-rank {
    color: var(--accent);
}

.trending-link {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
    display: block;
    margin-bottom: 0.3rem;
    transition: color 0.2s;
}
.trending-link:hover { color: var(--accent); }

.trending-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.info-block {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding: 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    position: relative;
}
.info-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient);
    border-radius: 3px 0 0 3px;
}

.muted-text {
    color: var(--text-dim);
    font-size: 0.76rem;
}

/* -- PINNED POSTS ------------------------------------------- */
.post-pinned {
    border-left: 3px solid var(--gold);
    background: var(--gold-light);
}
.post-pinned::before {
    background: var(--gold-gradient) !important;
    opacity: 1 !important;
}

.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

/* -- POST MEDIA (feed cards) -------------------------------- */
.post-media {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.6rem;
    position: relative;
    max-height: 240px;
}
.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.post-card:hover .post-media img {
    transform: scale(1.02);
}

.yt-thumb-wrap {
    display: block;
    position: relative;
}
.yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 52px;
    height: 52px;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.25s, box-shadow 0.25s;
}
.yt-thumb-wrap:hover .yt-play-btn {
    transform: translate(-50%,-50%) scale(1.1);
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

/* -- PAGINATION --------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all 0.2s;
}
.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}
.page-link.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* -- EMPTY STATE -------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
    font-size: 0.92rem;
}

/* -- MODAL -------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--modal-backdrop);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 34px;
    height: 34px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

/* -- FORMS -------------------------------------------------- */
.form-group {
    margin-bottom: 1.15rem;
}
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.label-optional {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.78rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; line-height: 1.6; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
}

/* -- EDITOR TOOLBAR ----------------------------------------- */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar + textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
}
.toolbar-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.toolbar-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 0.35rem;
    flex-shrink: 0;
}

.editor-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-style: italic;
}

/* -- IMAGE UPLOAD ------------------------------------------- */
.image-upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s;
}
.image-upload-area:hover {
    border-color: var(--accent);
}
.image-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 0.84rem;
}
.upload-icon { font-size: 1.5rem; }

.upload-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
}
.upload-preview img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

/* -- ALERTS ------------------------------------------------- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    animation: slideUp 0.3s ease;
}
.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.15);
}

/* -- AUTH PAGE ----------------------------------------------- */
.auth-page {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
}
.auth-page::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.04;
    filter: blur(100px);
    pointer-events: none;
}
.auth-page::after {
    content: '';
    position: fixed;
    bottom: -40%;
    left: -20%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: var(--gold-gradient);
    opacity: 0.03;
    filter: blur(100px);
    pointer-events: none;
}

.auth-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
    position: relative;
    z-index: 1;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}
.auth-brand .logo-mark {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
    margin: 0 auto 0.85rem;
}
.auth-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.brand-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-style: italic;
}

.auth-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.55rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.auth-form { margin-bottom: 1.25rem; }
.auth-form .btn-primary { margin-top: 0.5rem; }

.auth-footer {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.auth-footer a { font-weight: 600; }

/* -- VIEW POST LAYOUT --------------------------------------- */
.view-layout {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    animation: fadeIn 0.3s ease;
}

.view-main { width: 100%; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { opacity: 0.4; }
.bc-current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* -- POST DETAIL -------------------------------------------- */
.post-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2.25rem;
    margin-bottom: 2rem;
    animation: slideUp 0.4s ease;
    position: relative;
}
.post-detail.post-pinned {
    border-left: 4px solid var(--gold);
}

.post-detail-header {
    margin-bottom: 1.25rem;
}
.post-detail-header .pin-badge {
    margin-bottom: 0.7rem;
}
.post-detail-header .badge {
    margin-bottom: 0.65rem;
}

.post-detail-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.post-detail-meta .post-author {
    font-weight: 600;
    color: var(--text-primary);
}
.post-detail-meta .post-time {
    margin-left: 0;
    color: var(--text-dim);
}

.detail-author {
    font-weight: 600;
    color: var(--text-primary);
}

/* Post media in detail view */
.post-detail-media {
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.post-detail-media img {
    width: 100%;
    display: block;
}

/* YouTube embed */
.yt-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.yt-embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-lg);
}

/* -- POST DETAIL BODY (Markdown) ---------------------------- */
.post-detail-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 1rem 0;
}
.post-detail-body p { margin-bottom: 0.8rem; }
.post-detail-body p:last-child { margin-bottom: 0; }
.post-detail-body strong { font-weight: 700; color: var(--text-primary); }
.post-detail-body em { font-style: italic; color: var(--text-primary); }
.post-detail-body del { opacity: 0.5; }

.post-detail-body ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}
.post-detail-body ul li {
    margin-bottom: 0.35rem;
}

.post-detail-body blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    padding: 0.85rem 1.15rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
}

.post-detail-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* -- POST ACTIONS ------------------------------------------- */
.post-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.inline-form { display: inline; }

/* -- EDIT POST FORM ----------------------------------------- */
.edit-post-form { margin-top: 1rem; }
.edit-current-image {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.edit-current-image img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.edit-remove-image {
    font-size: 0.82rem;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.edit-remove-image input { width: 16px; height: 16px; accent-color: var(--danger); }

/* -- COMMENTS SECTION --------------------------------------- */
.comments-section {
    animation: slideUp 0.5s ease;
}

.comments-heading {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.comment-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 0.45rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-gradient);
    border-radius: 100px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-xs);
    animation: slideUp 0.3s ease forwards;
    opacity: 0;
    transition: all 0.2s;
}
.comment-card:hover {
    box-shadow: var(--shadow-sm);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.comment-author {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-primary);
}
.comment-time {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-left: auto;
}

.comment-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.comment-body p { margin-bottom: 0.5rem; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body strong { font-weight: 700; color: var(--text-primary); }
.comment-body em { font-style: italic; }
.comment-body blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    padding: 0.65rem 0.9rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 0.5rem 0;
    font-style: italic;
}
.comment-body ul { list-style: disc; padding-left: 1.5rem; }

/* -- COMMENT FORM ------------------------------------------- */
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.comment-form .btn-primary {
    margin-top: 0.5rem;
}

.auth-prompt {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.88rem;
}
.auth-prompt a { font-weight: 600; }

/* -- ADMIN PAGE --------------------------------------------- */
.admin-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.admin-header {
    margin-bottom: 1.5rem;
}
.admin-header h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-tabs {
    display: flex;
    gap: 0.3rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}
.admin-tab-link {
    padding: 0.65rem 1.15rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.admin-tab-link:hover {
    color: var(--text-primary);
}
.admin-tab-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 0.7rem 1rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.admin-table a { font-weight: 500; }

/* -- RESPONSIVE --------------------------------------------- */
@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar-left,
    .sidebar-right {
        position: static;
        height: auto;
        border: none;
        border-bottom: 1px solid var(--border-light);
    }
    .sidebar-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .sidebar-right { display: none; }
    .feed { padding: 1.5rem 1rem; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .navbar-inner { padding: 0 1rem; }
    .brand-text { display: none; }
    .layout { grid-template-columns: 1fr; }
    .sidebar-left {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .sidebar-right { display: none; }
    .feed { padding: 1rem; }
    .post-card { padding: 1.1rem 1.15rem; }
    .post-detail { padding: 1.5rem; }
    .post-detail-title { font-size: 1.4rem; }
    .view-layout { padding: 1rem; }
    .modal { padding: 1.5rem; border-radius: var(--radius-lg); }
    .auth-container { padding: 1.75rem 1.5rem; }
    .admin-table { font-size: 0.78rem; }
    .admin-table th, .admin-table td { padding: 0.55rem 0.65rem; }
    .modal-overlay.open .modal { width: 95%; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .feed-header { flex-direction: column; gap: 0.5rem; }
    .post-detail-actions { flex-direction: column; align-items: flex-start; }
    .post-detail-meta { font-size: 0.78rem; }
    .auth-container { padding: 1.5rem 1.15rem; }
}

/* -- SCROLLBAR ---------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ================================================================
   LIVE CHAT SYSTEM
   ================================================================ */

/* -- Chat section container --------------------------------- */
.chat-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.chat-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.4rem;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-gradient);
    border-radius: 100px;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
    animation: pulse 2s ease infinite;
}

.chat-live-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: #22c55e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* -- Chat messages area ------------------------------------- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 520px;
    min-height: 200px;
    background: var(--bg-secondary);
    scroll-behavior: smooth;
}

.chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* -- Chat bubble -------------------------------------------- */
.chat-bubble {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
    animation: slideUp 0.25s ease;
}

.chat-bubble .avatar {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.chat-bubble-inner {
    flex: 1;
    min-width: 0;
}

/* Other person's messages: left-aligned */
.chat-other {
    align-self: flex-start;
}
.chat-other .chat-bubble-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: 0.65rem 0.9rem;
    box-shadow: var(--shadow-xs);
}

/* Own messages: right-aligned */
.chat-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-own .chat-bubble-inner {
    background: var(--accent-light);
    border: 1px solid var(--accent-glow);
    border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
    padding: 0.65rem 0.9rem;
}

.chat-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.chat-author {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.chat-time {
    font-size: 0.66rem;
    color: var(--text-dim);
    margin-left: auto;
}

/* Day divider in chat */
.chat-day-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
    align-self: stretch;
}
.chat-day-divider::before,
.chat-day-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}
.chat-day-divider span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: 0.2rem 0.7rem;
    background: var(--bg-main);
    border-radius: 999px;
    border: 1px solid var(--border-light);
}

.chat-bubble-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.chat-bubble-body p { margin-bottom: 0.2rem; }
.chat-bubble-body p:last-child { margin-bottom: 0; }
.chat-bubble-body strong { color: var(--text-primary); }
.chat-bubble-body blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.3rem 0.6rem;
    margin: 0.3rem 0;
    background: rgba(0,0,0,0.02);
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

/* New message entrance */
.chat-bubble-new {
    animation: chatPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatPop {
    0%   { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* -- Chat input bar ----------------------------------------- */
.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.chat-input-bar .avatar {
    margin-bottom: 0.2rem;
}

.chat-input-wrap {
    flex: 1;
    position: relative;
}

.chat-input-wrap textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-wrap textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.chat-input-wrap textarea::placeholder {
    color: var(--text-dim);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 4px 16px var(--accent-glow);
}
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-auth-prompt {
    text-align: center;
    padding: 1.15rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--bg-primary);
}
.chat-auth-prompt a { font-weight: 600; }

/* -- Chat responsive ---------------------------------------- */
@media (max-width: 768px) {
    .chat-messages { padding: 0.85rem; max-height: 400px; }
    .chat-bubble { max-width: 90%; }
    .chat-input-bar { padding: 0.65rem 0.85rem; }
    .chat-input-bar .avatar { display: none; }
}

/* ================================================================
   NAVBAR LOGO IMAGE
   ================================================================ */
.navbar-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .navbar-logo { height: 30px; }
}

/* ================================================================
   AUTH PAGE LOGO
   ================================================================ */
.auth-logo {
    width: 140px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    object-fit: contain;
}

/* ================================================================
   SEBI TICKER MARQUEE
   ================================================================ */
.ticker-bar {
    background: var(--accent-gradient);
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 90;
}

.ticker-track {
    display: inline-flex;
    animation: tickerScroll 35s linear infinite;
}

.ticker-content {
    display: inline-block;
    padding: 0.35rem 0;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pause on hover */
.ticker-bar:hover .ticker-track {
    animation-play-state: paused;
}

/* ================================================================
   SITE FOOTER
   ================================================================ */
.site-footer {
    margin-top: 3rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-brand {
    display: inline-block;
    text-decoration: none;
}

.footer-logo {
    height: 42px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.footer-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Social icons row */
.footer-social {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.footer-social a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Footer columns */
.footer-heading {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    letter-spacing: 0.02em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.footer-links li {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

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

.footer-links a:hover {
    color: var(--accent);
}

.footer-sebi {
    font-weight: 600;
    color: var(--text-secondary) !important;
    font-size: 0.78rem !important;
}

/* Footer bottom bar */
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}

.footer-disclaimer {
    margin-top: 0.35rem !important;
    font-style: italic;
    font-size: 0.68rem !important;
    opacity: 0.75;
}

/* Footer responsive */
@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem 1rem;
    }
    .footer-logo { height: 36px; }
}
