/**
 * Blackmess - Base CSS Variables & Styles
 */
:root {
    --feed-bg: #020617;
    --feed-card: #0f172a;
    --feed-card-hover: #1e293b;
    --feed-input: #1e293b;
    --feed-border: #334155;
    --feed-text: #f8fafc;
    --feed-text-muted: #94a3b8;
    --feed-text-dim: #64748b;
    --feed-accent: #8b5cf6;
    --feed-accent-soft: rgba(139, 92, 246, 0.15);
    --feed-accent-hover: #7c3aed;
    --feed-radius: 16px;
    --feed-radius-btn: 12px;
    
    --toast-bg: #1e293b;
    --toast-border: #334155;
    --toast-success: #22c55e;
    --toast-error: #ef4444;
    --toast-info: #8b5cf6;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--feed-bg);
    color: var(--feed-text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.feed-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    gap: 28px;
}

.main-feed {
    flex: 1;
    min-width: 0;
}

/* Cards */
.sidebar-card {
    background: var(--feed-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--feed-radius);
    padding: 20px;
    backdrop-filter: blur(20px);
}

.post-card {
    background: var(--feed-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--feed-radius);
    padding: 16px;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.post-card:hover {
    background: var(--feed-card-hover);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--feed-radius-btn);
    border: none;
    background: var(--feed-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--feed-accent-hover);
}

.post-submit-btn {
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: var(--feed-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.post-submit-btn:hover {
    background: var(--feed-accent-hover);
}

.follow-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--feed-accent);
    background: transparent;
    color: var(--feed-accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.follow-btn:hover {
    background: var(--feed-accent-soft);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--feed-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--feed-card-hover);
    color: var(--feed-text);
}

/* Input */
input, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--feed-radius-btn);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--feed-input);
    color: var(--feed-text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: var(--feed-accent);
}

input::placeholder, textarea::placeholder {
    color: var(--feed-text-dim);
}

/* Search */
.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--feed-input);
    border: 1px solid transparent;
}

.search-input-wrapper:focus-within {
    border-color: var(--feed-border);
}

.search-input-wrapper i {
    color: var(--feed-text-dim);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
}

/* Nav */
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--feed-radius-btn);
    color: var(--feed-text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--feed-card-hover);
    color: var(--feed-text);
}

.nav-item.active {
    background: var(--feed-accent-soft);
    color: var(--feed-accent);
}

.nav-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--feed-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Avatar */
.post-avatar, .user-avatar, .create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--feed-accent) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.post-avatar img, .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.create-post-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

/* Post Content */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.post-author-info {
    flex: 1;
    min-width: 0;
}

.post-author-name {
    font-weight: 600;
    font-size: 15px;
}

.post-author-handle {
    color: var(--feed-text-dim);
    font-size: 13px;
}

.post-content {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.post-image {
    margin-top: 12px;
    border-radius: var(--feed-radius);
    overflow: hidden;
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.post-actions {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--feed-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.post-action-btn:hover {
    background: var(--feed-accent-soft);
    color: var(--feed-accent);
}

.post-action-btn.liked {
    color: #f43f5e;
}

.post-action-btn.liked i {
    color: #f43f5e;
}

.post-action-icon {
    padding: 10px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--feed-accent);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.post-action-icon:hover {
    background: var(--feed-accent-soft);
}

/* Create Post */
.create-post-input-wrap {
    display: flex;
    gap: 12px;
}

.create-post-input {
    flex: 1;
}

.create-post-input textarea {
    width: 100%;
    background: transparent;
    border: none;
    resize: none;
    min-height: 60px;
    font-size: 16px;
    padding: 8px 0;
}

.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.post-action-icons {
    display: flex;
    gap: 4px;
}

/* Empty & Loading */
.empty-state, .loading-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--feed-text-dim);
}

.empty-state i, .loading-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--feed-text-muted);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--feed-radius-btn);
    background: var(--toast-bg);
    border: 1px solid var(--toast-border);
    font-size: 14px;
    pointer-events: auto;
    animation: toast-in 0.3s ease-out;
}

.toast.toast-hide {
    animation: toast-out 0.25s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-8px); }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toast-success .toast-icon { color: var(--toast-success); }
.toast-error .toast-icon { color: var(--toast-error); }
.toast-info .toast-icon { color: var(--toast-info); }

.toast-body {
    flex: 1;
}

/* Mobile */
@media (max-width: 768px) {
    .feed-container {
        flex-direction: column;
        gap: 14px;
        padding: 12px 10px 96px;
    }
    
    .sidebar-component {
        display: none;
    }
    
    .sidebar-left {
        width: 100%;
    }
    
    .sidebar-right {
        display: none;
    }

    .main-feed {
        width: 100%;
    }

    .sidebar-card,
    .post-card {
        border-radius: 14px;
        padding: 14px;
    }

    .create-post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .post-action-icons {
        width: 100%;
        justify-content: space-between;
    }

    .post-submit-btn {
        width: 100%;
    }

    .post-actions {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .post-action-btn {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .empty-state,
    .loading-state {
        padding: 30px 14px;
    }
}