:root {
    --accent: #e05a7a;
    --accent-2: #c0392b;
    --accent-glow: rgba(224, 90, 122, 0.12);

    --bg-primary: #0d0d0f;
    --bg-secondary: #171419;
    --bg-tertiary: #1b161e;
    --bg-input: #1d161f;
    --bg-hover: #2a2a3a;
    --bg-active: #2f2f42;

    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.12);

    --text-primary: #f0f0f5;
    --text-secondary: rgba(240,240,245,0.6);
    --text-muted: rgba(240,240,245,0.35);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-accent: 0 4px 20px rgba(224,90,122,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat Alternates', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Left sidebar ── */
.sidebar-left {
    width: 260px;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--border);
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    padding: 8px 12px;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}
.nav-item:hover  { background: var(--bg-hover); }
.nav-item.active { color: var(--accent); background: var(--accent-glow); }
.nav-icon { font-size: 20px; width: 24px; text-align: center; }

.btn-post {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s ease;
    font-family: 'Montserrat Alternates', sans-serif;
}
.btn-post:hover { background: #e86a85; box-shadow: var(--shadow-accent); }

/* ── User block ── */
.user-block {
    margin-top: auto;
    padding: 12px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-block:hover { background: var(--bg-hover); }

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--bg-hover));
    object-fit: cover;
}

.user-info { min-width: 0; flex: 1; }
.user-login {
    font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-coins { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.coin-val { color: var(--accent); font-weight: 600; }

/* ── Main feed ── */
.main-feed {
    flex: 1;
    max-width: 600px;
    border-right: 1px solid var(--border);
    min-height: 100vh;
}

.feed-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    backdrop-filter: blur(10px);
}
.feed-title { font-size: 20px; font-weight: 700; }

/* ── Compose ── */
.compose-box {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.compose-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--bg-hover));
    object-fit: cover;
}

.compose-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    resize: none;
    outline: none;
    font-family: 'Montserrat Alternates', sans-serif;
    padding: 8px 0;
}

.compose-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}
.compose-icons { display: flex; gap: 16px; color: var(--accent); }

.btn-send {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Montserrat Alternates', sans-serif;
}
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-send:hover:not(:disabled) { background: #e86a85; }

/* ── Tabs ── */
.feed-tabs { display: flex; border-bottom: 1px solid var(--border); }
.feed-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
}
.feed-tab:hover  { background: var(--bg-hover); color: var(--text-primary); }
.feed-tab.active { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); }

/* ── Posts ── */
.post {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
    display: flex;
    gap: 12px;
}
.post:hover { background: var(--bg-secondary); }
.post-content { flex: 1; }

.avatar-small {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--bg-hover));
    flex-shrink: 0;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.post-author { font-weight: 600; font-size: 15px; }
.post-id     { font-size: 12px; color: var(--text-muted); }
.post-time   { font-size: 13px; color: var(--text-muted); margin-left: auto; }

.post-text { font-size: 14px; margin-bottom: 12px; line-height: 1.5; }

.post-image {
    width: 100%;
    max-height: 300px;
    background: linear-gradient(135deg, #2a1f3d, #1a1622);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 1px solid var(--border);
}

.post-actions { display: flex; gap: 20px; align-items: center; }

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: 'Montserrat Alternates', sans-serif;
}
.action-btn:hover { color: var(--accent); }
.action-btn.active { color: var(--accent); animation: bounce 0.35s ease-out; }

@keyframes bounce {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Right sidebar ── */
.sidebar-right {
    width: 320px;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.search-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.widget-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

.widget-item {
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}
.widget-item:hover { background: var(--bg-hover); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.show { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-strong);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

/* ── Skeleton ── */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Responsive ── */
@media (max-width: 1200px) { .sidebar-right { display: none; } }

@media (max-width: 768px) {
    .sidebar-left { width: 70px; padding: 12px 8px; }
    .nav-item span:not(.nav-icon) { display: none; }
    .logo { font-size: 20px; text-align: center; }
    .btn-post { width: 50px; height: 50px; border-radius: 50%; padding: 0; font-size: 24px; display: flex; align-items: center; justify-content: center; }
    .user-info { display: none; }
}

@media (max-width: 480px) {
    .sidebar-left { display: none; }
    .main-feed { max-width: 100%; border-right: none; }
    .post { padding: 12px 16px; }
    .post-image { max-height: 200px; font-size: 36px; }
}

/* ── Post delete btn ── */
.post-delete-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
    display: none;
}
.post:hover .post-delete-btn { display: inline; }
.post-delete-btn:hover { color: #ef4444; }

/* ── New post animation ── */
@keyframes postIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
.post-new { animation: postIn 0.3s ease; }

/* ── Feed list ── */
#feed-list { display: block; }
