* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --surface: #141419;
    --surface-2: #1a1a24;
    --border: #2a2a3a;

    --primary: #00d4ff;
    --primary-dark: #00b8e6;
    --secondary: #ff0080;
    --accent: #7c3aed;
    --success: #00ff88;
    --danger: #ff3366;

    --text: #e8e8f0;
    --text-dim: #9090a8;
    --text-faint: #5a5a6e;
}

[data-theme="light"] {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f5f5f5;
    --border: #e0e0e0;

    --primary: #0080ff;
    --primary-dark: #0066cc;
    --secondary: #ff0066;
    --accent: #8b5cf6;
    --success: #00cc66;
    --danger: #ff3366;

    --text: #1a1a1a;
    --text-dim: #666666;
    --text-faint: #999999;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
                    0 0 40px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.5),
                    0 0 80px rgba(0, 212, 255, 0.2);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 128, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
    animation: gradient 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--primary) 20%,
        var(--secondary) 40%,
        var(--accent) 60%,
        var(--primary) 80%,
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.header:hover::before {
    opacity: 0.5;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.logo-icon {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--primary));
    transition: all 0.3s ease;
    object-fit: contain;
}

.logo:hover .logo-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 20px var(--primary));
}

.logo h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 5s ease infinite;
    letter-spacing: -1px;
}

.nav {
    display: flex;
    gap: 8px;
    background: var(--surface);
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dim);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 14px;
    z-index: 0;
}

.nav-btn span {
    position: relative;
    z-index: 1;
}

.nav-btn:hover {
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.nav-btn:hover::before {
    opacity: 0.15;
}

.nav-btn.active {
    color: white;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.nav-btn.active::before {
    opacity: 1;
}

.user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    border-radius: 14px;
    font-size: 22px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 300%;
    animation: gradient 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 14px;
    z-index: -1;
}

.theme-toggle:hover {
    transform: scale(1.05) rotate(10deg);
    border-color: transparent;
}

.theme-toggle:hover::before {
    opacity: 1;
}

.theme-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.5s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

.btn-primary {
    padding: 13px 32px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 35px rgba(0, 212, 255, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 28px;
    padding: 32px 28px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    animation: slideIn 0.6s ease;
}

.sidebar-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-section:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.15);
}

.sidebar-section:hover::before {
    opacity: 1;
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--text-faint);
}

.community-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 8px;
}

.community-item:hover {
    background: var(--surface-2);
    transform: translateX(10px);
}

.community-icon {
    font-size: 26px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.community-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.member-count {
    font-size: 12px;
    color: var(--text-faint);
    font-weight: 600;
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: 10px;
}

.trending-item {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 8px;
}

.trending-item:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    transform: translateX(10px);
}

/* Feed */
.feed {
    max-width: 700px;
    animation: slideIn 0.7s ease;
}

/* Create Post */
.create-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.create-post::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(255, 0, 128, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.create-post:hover {
    border-color: var(--primary);
    box-shadow: 0 16px 50px rgba(0, 212, 255, 0.15);
}

.create-post:hover::before {
    opacity: 1;
}

.post-input {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.post-input:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1),
                0 8px 20px rgba(0, 212, 255, 0.2);
}

.post-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.post-input::placeholder {
    color: var(--text-faint);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.post-options {
    display: flex;
    gap: 10px;
}

.post-submit {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.option-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.option-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.option-btn:nth-child(2) {
    background: linear-gradient(135deg, var(--secondary), #ff3366);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.option-btn:nth-child(2):hover {
    box-shadow: 0 8px 25px rgba(255, 0, 128, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.option-btn:nth-child(3) {
    background: linear-gradient(135deg, var(--accent), #9333ea);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.option-btn:nth-child(3):hover {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, var(--text-faint), var(--text-dim));
    box-shadow: none;
}

.option-btn:disabled:hover {
    transform: none;
}

.btn-post {
    padding: 13px 32px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-post:hover::before {
    left: 100%;
}

.btn-post:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 35px rgba(0, 212, 255, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-post:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.btn-post:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, var(--text-faint), var(--text-dim));
    box-shadow: none;
}

/* Image Preview */
.image-preview {
    position: relative;
    margin-top: 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border);
}

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

.remove-image {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.9);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 700;
    line-height: 1;
}

.remove-image:hover {
    background: var(--danger);
    transform: scale(1.1) rotate(90deg);
}

/* Posts - Twitter/X Style */
.post {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    transition: all 0.2s ease;
    position: relative;
    animation: slideIn 0.3s ease;
    cursor: pointer;
}

.post:hover {
    background: var(--surface-2);
}

.post-container {
    display: flex;
    gap: 12px;
}

.avatar-column {
    flex-shrink: 0;
}

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

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.avatar:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
}

.author-name:hover {
    text-decoration: underline;
}

.badge {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

.badge-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin: 0 2px;
}

.post-time {
    color: var(--text-dim);
    font-size: 14px;
}

.post-content {
    margin: 8px 0;
}

.post-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    margin: 0 0 12px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-top: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.post-image:hover {
    opacity: 0.95;
}

.community-tag {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-menu {
    width: 35px;
    height: 35px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dim);
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 4px;
    max-width: 425px;
}

.vote-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
}

.action-btn.upvote:hover {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
}

.action-btn.downvote:hover {
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger);
}

.action-icon {
    font-size: 18px;
}

.action-count {
    font-size: 13px;
}

/* Right Sidebar */
.right-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    animation: slideIn 0.8s ease;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--secondary), var(--primary));
    opacity: 0;
    transition: opacity 0.3s;
}

.widget:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

.widget:hover::before {
    opacity: 1;
}

.highlight-number {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Empty States */
.empty-feed {
    text-align: center;
    padding: 100px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.empty-feed::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0.05), transparent);
}

.empty-feed-icon {
    font-size: 96px;
    margin-bottom: 24px;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--primary));
}

.empty-feed h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr;
    }
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 20px 16px;
    }
    .sidebar {
        display: none;
    }
    .feed {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .logo h1 {
        font-size: 20px;
    }
    .nav {
        display: none;
    }
}