:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --sidebar-bg: #111827;
    --sidebar-text: #d1d5db;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 0.5rem;
    --sidebar-width: 280px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 2000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.brand .logo {
    height: 32px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

.nav-menu {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-label {
    display: block;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.2s;
    font-size: 0.9375rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

.top-bar-brand {
    display: none;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
}

.top-bar-brand img {
    height: 24px;
}

.search-box {
    flex: 1;
    max-width: 600px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.content-container {
    padding: 2rem;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

/* Cards & Q&A */
.q-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.q-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.q-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.q-title a {
    color: inherit;
    text-decoration: none;
}

.q-title a:hover {
    color: var(--primary);
}

.q-body {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.q-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.q-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.accepted-answer {
    border: 2px solid #10b981 !important;
    background-color: #f0fdf4 !important;
}

/* Forms */
#ask-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: none;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-main);
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
}

.pending-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Mobile */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .top-bar-brand {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .content-container {
        padding: 1rem;
    }

    .top-bar {
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .search-box {
        display: none;
    }

    .top-bar-brand span {
        display: none;
    }
}