/* Knowledge Hub - Main Styles */
:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-light: #222;
    --border: #333;
    --border-light: #2a2a2a;
    --text: #e5e5e5;
    --text-muted: #888;
    --text-dim: #666;
    --accent: #10b981;
    --accent-hover: #059669;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #fff;
    font-size: 36px;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Categories Grid */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
    text-align: center;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: var(--bg-light);
    text-decoration: none;
}

.cat-icon { font-size: 40px; margin-bottom: 15px; }
.cat-name { color: #fff; font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.cat-count { color: var(--text-muted); font-size: 14px; }

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stats-bar span {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d2818 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-content h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 15px;
}

.hero-content p {
    color: #aaa;
    font-size: 16px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-block;
    background: var(--accent);
    color: #000;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.hero-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

.hero-btn:hover { background: var(--accent-hover); text-decoration: none; }

/* Sections */
.section { margin-bottom: 40px; }

.section-title {
    color: #fff;
    font-size: 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Two Columns Layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .two-columns { grid-template-columns: 1fr; }
}

/* Question List */
.q-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.q-item:hover {
    border-color: var(--accent);
    transform: translateX(5px);
    text-decoration: none;
}

.q-item .q-badge {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
}

.q-item.trending .q-badge { color: #f59e0b; }

.q-item .q-text {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
}

/* Authors Grid */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.author-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s;
}

.author-card:hover { border-color: var(--accent); }

.author-card .avatar {
    margin: 0 auto 12px;
}

.author-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-stats {
    color: var(--text-muted);
    font-size: 12px;
}

/* SEO Section */
.seo-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
}

.seo-section h2 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
}

.seo-section p {
    color: #aaa;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.seo-section a { color: var(--accent); }

/* Breadcrumbs */
.breadcrumb {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a { color: var(--text-muted); }

/* Page Title */
.page-title {
    color: #fff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 28px;
}

/* SEO Content Block */
.seo-block {
    background: #151515;
    border-radius: var(--radius);
    padding: 20px;
    border-left: 4px solid var(--accent);
    margin-bottom: 30px;
    font-size: 15px;
    color: #aaa;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 30px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.data-table .q-title a { color: var(--accent); }
.data-table .q-date { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.data-table .q-count { font-weight: 600; text-align: center; }

.gpt-btn {
    background: var(--accent);
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
    display: inline-block;
}

.gpt-btn:hover { text-decoration: none; background: var(--accent-hover); }

/* Avatars */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 16px;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 11px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s;
}

.page-btn:hover { background: var(--bg-light); text-decoration: none; }
.page-btn.disabled { opacity: 0.3; pointer-events: none; }
.page-info { color: var(--text-muted); }

/* Question Card */
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.question-card h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.author-name { font-weight: 600; color: var(--accent); }
.author-date { font-size: 12px; color: var(--text-dim); }

/* Tags */
.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.tag {
    background: var(--bg-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid var(--border);
}

/* CTA Button */
.cta-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.cta-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.cta-btn:hover { text-decoration: none; background: var(--accent-hover); }

/* Stats */
.stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.like-btn.active { color: var(--danger); }

/* AI Best Answer Block */
.ai-block {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 30px 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
}

.ai-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.ai-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-desc {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ai-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #000;
    padding: 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.ai-cta::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

.ai-cta:hover { background: var(--accent-hover); transform: scale(1.02); text-decoration: none; }

/* Section Title */
.section-title {
    color: #fff;
    margin: 20px 0;
    font-size: 20px;
}

/* Answers */
.answer {
    background: #151515;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 15px;
}

.answer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.answer-user { color: var(--accent); font-weight: 500; font-size: 13px; }
.answer-date { color: var(--text-dim); font-size: 12px; }
.answer-text { color: var(--text); font-size: 15px; line-height: 1.6; }

/* Similar Questions */
.similar-section { margin: 30px 0; }

.similar-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 15px 0;
}

.similar-item {
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: var(--radius);
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    transition: border-color 0.2s;
}

.similar-item:hover { border-color: var(--accent); text-decoration: none; }

/* Next Question Nav */
.next-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
}

.next-btn {
    display: block;
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.next-btn:hover { background: var(--bg-card); text-decoration: none; }

/* Footer */
footer {
    margin-top: 60px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--bg-light);
    color: #555;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 20px 15px; }
    header h1 { font-size: 28px; }
    .categories { grid-template-columns: 1fr; }
    .data-table th, .data-table td { padding: 10px 8px; font-size: 13px; }
    .question-card { padding: 18px; }
    .question-card h1 { font-size: 20px; }
}
