/* ═══════════════════════════════════════════════════════════════
   Questions Page Styles — /questions/
   Uses main site design system variables from style.css
   ═══════════════════════════════════════════════════════════════ */

/* Hero — clean, light, matches main site hero vibe */
.questions-hero {
    padding: 130px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, #f0f7ff 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
.questions-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.6;
}
.hero-subtitle strong {
    color: var(--primary);
    font-weight: 700;
}
.hero-badge {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(37, 99, 235, 0.15);
}
.hero-badge a {
    color: var(--primary-dark);
    text-decoration: underline;
    font-weight: 600;
}

/* Section */
.questions-section {
    padding: 32px 0 80px;
    background: var(--bg);
    min-height: 60vh;
}

/* Filters */
.q-filters {
    margin-bottom: 20px;
}
.q-search-wrap {
    margin-bottom: 10px;
}
.q-search {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.q-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.q-search::placeholder { color: #94a3b8; }

.q-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.q-select {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.84rem;
    outline: none;
    cursor: pointer;
    min-width: 130px;
    transition: border-color 0.2s;
}
.q-select:focus {
    border-color: var(--primary);
}
.q-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.q-btn:hover {
    background: var(--primary-dark);
}
.q-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.q-btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Results bar */
.q-results-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.q-active-filter {
    background: var(--primary-glow);
    color: var(--primary);
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ── Question Cards ─────────────────────────────────────── */
.q-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.q-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.q-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}
.q-card-link {
    display: block;
    padding: 18px 22px;
    text-decoration: none;
    color: inherit;
}
.q-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.q-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.5;
    flex: 1;
}
.q-has-answer {
    font-size: 0.78rem;
    flex-shrink: 0;
}
.q-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.q-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.q-tag {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary);
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.q-tag:hover {
    background: rgba(37, 99, 235, 0.18);
}
.q-diff, .q-type, .q-level, .q-seen, .q-date {
    font-size: 0.76rem;
    color: var(--text-muted);
}
.q-diff { font-weight: 600; }
.diff-easy { color: #16a34a; }
.diff-medium { color: #d97706; }
.diff-hard { color: #dc2626; }
.q-seen { color: var(--primary); font-weight: 600; }

/* Empty State */
.q-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.q-empty a {
    color: var(--primary);
    text-decoration: underline;
}

/* Pagination */
.q-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 28px;
}
.q-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.84rem;
    text-decoration: none;
    transition: all 0.2s;
}
.q-page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.q-page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* CTA Banner */
.q-cta {
    text-align: center;
    margin-top: 40px;
    padding: 36px 28px;
    background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(14,165,233,0.06) 100%);
    border: 1px solid rgba(37,99,235,0.12);
    border-radius: var(--radius);
}
.q-cta h3 {
    font-size: 1.2rem;
    color: var(--text-heading);
    margin-bottom: 8px;
    font-weight: 700;
}
.q-cta p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   Individual Question Page (view.php / static .html)
   ═══════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.q-breadcrumb {
    padding: 95px 0 0;
    background: var(--bg);
    font-size: 0.83rem;
    color: var(--text-muted);
}
.q-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.q-breadcrumb a:hover {
    color: var(--primary);
}

/* Detail Layout */
.q-detail {
    padding: 24px 0 80px;
    background: var(--bg);
}
.q-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 36px;
    align-items: start;
}

/* Main */
.q-detail-main {
    min-width: 0;
}
.q-detail-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.5;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}
.q-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.q-detail-stats {
    display: flex;
    gap: 28px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.q-stat strong {
    display: block;
    font-size: 1.05rem;
    color: var(--text-heading);
    font-weight: 700;
}
.q-stat span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Answer Section */
.q-answer {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin-bottom: 28px;
}
.q-answer h2 {
    font-size: 1.1rem;
    color: var(--text-heading);
    margin-bottom: 14px;
    font-weight: 700;
}
.q-answer-text {
    color: var(--text);
    font-size: 0.93rem;
    line-height: 1.85;
}
.q-answer-text p {
    margin: 0 0 12px;
}
.q-answer-text p:last-child {
    margin-bottom: 0;
}
.q-answer-text strong {
    font-weight: 700;
    color: var(--text-heading);
}
.q-answer-text em {
    font-style: italic;
}
.q-answer-text pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
}
.q-answer-text pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    border-radius: 0;
}
.q-answer-text code {
    background: rgba(37,99,235,0.08);
    color: #2563eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.86em;
    font-family: 'Fira Code', 'Consolas', monospace;
}
/* Code block container with copy button */
.code-block {
    position: relative;
    margin: 14px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e2e;
}
.code-block pre {
    margin: 0;
    border-radius: 0;
}
.code-lang {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #89b4fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Fira Code', 'Consolas', monospace;
}
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #cdd6f4;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
    font-family: inherit;
}
.code-copy-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.code-copy-btn.copied {
    background: rgba(74,222,128,0.2);
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
}
.q-answer-text ol,
.q-answer-text ul {
    margin: 10px 0 12px 20px;
    padding: 0;
}
.q-answer-text li {
    margin-bottom: 6px;
}
.q-answer-text ol {
    list-style-type: decimal;
}
.q-answer-text ul {
    list-style-type: disc;
}
.q-answer-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}
.q-answer-locked {
    text-align: center;
    color: var(--text-muted);
    padding: 36px;
    background: var(--bg-card-solid);
}

/* Inline CTA */
.q-inline-cta {
    background: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(14,165,233,0.05) 100%);
    border: 1px solid rgba(37,99,235,0.12);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
}
.q-inline-cta h3 {
    font-size: 1.05rem;
    color: var(--text-heading);
    margin-bottom: 6px;
    font-weight: 700;
}
.q-inline-cta p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 14px;
    line-height: 1.6;
}

/* Sidebar */
.q-detail-sidebar {
    position: sticky;
    top: 90px;
}
.q-sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 14px;
}
.q-sidebar-section h3 {
    font-size: 0.9rem;
    color: var(--text-heading);
    margin-bottom: 10px;
    font-weight: 700;
}
.q-sidebar-cta {
    background: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(14,165,233,0.05) 100%);
    border-color: rgba(37,99,235,0.12);
    text-align: center;
}
.q-sidebar-cta p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Related Questions */
.q-related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.q-related-item {
    display: block;
    padding: 10px 12px;
    background: var(--bg-card-solid);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.q-related-item:hover {
    background: var(--primary-glow);
    border-color: rgba(37, 99, 235, 0.1);
}
.q-related-text {
    display: block;
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.q-related-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Topic Cloud */
.q-topic-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.q-topic-pill {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--primary);
    font-size: 0.73rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}
.q-topic-pill:hover {
    background: var(--primary-glow);
    border-color: var(--primary-light);
}
.q-topic-pill small {
    color: var(--text-muted);
    margin-left: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .questions-hero {
        padding: 120px 0 32px;
    }
    .questions-hero h1 {
        font-size: 1.7rem;
    }
    .q-filter-row {
        flex-direction: column;
    }
    .q-select {
        width: 100%;
    }
    .q-detail-grid {
        grid-template-columns: 1fr;
    }
    .q-detail-sidebar {
        position: static;
    }
    .q-detail-title {
        font-size: 1.25rem;
    }
    .q-detail-stats {
        gap: 16px;
        flex-wrap: wrap;
    }
    .q-card-link {
        padding: 14px 16px;
    }
    .q-card-meta {
        gap: 8px;
    }
    .q-cta {
        padding: 28px 20px;
    }
}
