/* ============================================================================
   AnswerDome - Professional Theme with Dark Mode
   ============================================================================ */

:root {
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Colors - Light Theme */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #0ea5e9;
    --info-bg: #e0f2fe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000000;

    /* Semantic Colors */
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --border-color: var(--gray-200);
    --border-color-light: var(--gray-100);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Radii */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-bg: rgba(59, 130, 246, 0.1);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.1);
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --white: #0f172a;
    --black: #f8fafc;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --border-color-light: #1e293b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 280px 1fr;
    }
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.search-form {
    flex: 1;
    max-width: 500px;
    display: none;
}

@media (min-width: 768px) {
    .search-form {
        display: block;
    }
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--gray-50);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.search-wrapper {
    position: relative;
}

.search-wrapper svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .sidebar {
        display: block;
    }
}

.sidebar-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-nav svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.category-tree {
    list-style: none;
}

.category-tree li {
    margin-bottom: 0.125rem;
}

.category-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.category-tree a:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.category-tree .count {
    font-size: 0.75rem;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.category-tree .subcategories {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--gray-200);
    list-style: none;
}

/* ============================================================================
   CARDS & QUESTIONS
   ============================================================================ */

.content-area {
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--gray-300);
}

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

.question-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.question-card:hover {
    box-shadow: var(--shadow);
}

.question-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.question-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 60px;
    padding-right: 1rem;
    border-right: 1px solid var(--gray-100);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-item.has-best .stat-value {
    color: var(--success);
}

.question-content {
    flex: 1;
    min-width: 0;
}

.question-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.question-title a {
    color: inherit;
}

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

.question-excerpt {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.question-category {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.question-author {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--gray-500);
}

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

/* ============================================================================
   SINGLE QUESTION PAGE
   ============================================================================ */

.question-full {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.question-full-header {
    padding: 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.question-full-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.question-full-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
}

.vote-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.vote-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.vote-btn.active.upvote {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.vote-btn.active.downvote {
    background: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
}

.vote-btn svg {
    width: 20px;
    height: 20px;
}

.vote-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-700);
    padding: 0.5rem 0;
}

.question-body-content {
    flex: 1;
    min-width: 0;
}

.question-body-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.question-body-content pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.question-body-content code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.question-body-content pre code {
    background: none;
    padding: 0;
}

/* ============================================================================
   ANSWERS
   ============================================================================ */

.answers-section {
    margin-top: 2rem;
}

.answers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.answers-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.answer-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.answer-card.best-answer {
    border: 2px solid var(--success);
}

.best-answer-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--success-bg);
    color: var(--success);
    font-weight: 600;
    font-size: 0.875rem;
}

.best-answer-badge svg {
    width: 18px;
    height: 18px;
}

.answer-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.answer-content {
    flex: 1;
    min-width: 0;
}

.answer-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.answer-content code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.answer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.mark-best-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.mark-best-btn:hover {
    border-color: var(--success);
    color: var(--success);
}

/* ============================================================================
   ANSWER FORM
   ============================================================================ */

.answer-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.answer-form h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ============================================================================
   FORMS
   ============================================================================ */

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 0.375rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--gray-500);
}

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

.breadcrumbs span {
    color: var(--gray-300);
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.pagination a {
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination .disabled {
    color: var(--gray-300);
    cursor: not-allowed;
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */

.auth-container {
    max-width: 420px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: var(--gray-600);
}

/* ============================================================================
   PROFILE
   ============================================================================ */

.profile-header {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
}

.profile-details h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.profile-details p {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.profile-stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
}

.alert-info {
    background: var(--primary-bg);
    color: #1e40af;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-12) 0 var(--space-8);
    margin-top: var(--space-12);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-brand {
    padding-right: var(--space-8);
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: var(--space-3);
}

.footer-logo img {
    border-radius: var(--radius-sm);
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin: 0;
}

.footer-column {
    min-width: 0;
}

.footer-heading {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: var(--space-2);
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.footer-copy {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
}

.social-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .footer-brand {
        grid-column: span 2;
        padding-right: 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

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

    .footer-brand {
        grid-column: span 1;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none; }

@media (max-width: 767px) {
    .hide-mobile { display: none; }
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ============================================================================
   ANIMATIONS & KEYFRAMES
   ============================================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Animate page content */
.content-area {
    animation: fadeInUp var(--transition-slow) ease-out;
}

.question-card {
    animation: fadeInUp var(--transition-slow) ease-out;
    animation-fill-mode: both;
}

.question-card:nth-child(1) { animation-delay: 0ms; }
.question-card:nth-child(2) { animation-delay: 50ms; }
.question-card:nth-child(3) { animation-delay: 100ms; }
.question-card:nth-child(4) { animation-delay: 150ms; }
.question-card:nth-child(5) { animation-delay: 200ms; }

/* ============================================================================
   ENHANCED HOVER EFFECTS
   ============================================================================ */

.question-card {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn {
    transition: all var(--transition-fast);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Link underline animation */
.question-title a {
    position: relative;
}

.question-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.question-title a:hover::after {
    width: 100%;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

/* ============================================================================
   SKELETON LOADERS
   ============================================================================ */

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-title {
    height: 1.5rem;
    width: 80%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastIn var(--transition-slow) ease-out;
    pointer-events: auto;
    max-width: 360px;
    border-left: 4px solid var(--gray-400);
}

.toast.toast-exit {
    animation: toastOut var(--transition-base) ease-in forwards;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

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

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--gray-700);
}

.toast-close {
    flex-shrink: 0;
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Animated badges */
.badge-new {
    background: var(--success-bg);
    color: var(--success);
    animation: pulse 2s infinite;
}

.badge-trending {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-trending::before {
    content: '🔥';
    margin-right: 0.25rem;
}

/* Badge sizes */
.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
}

.badge-lg {
    padding: 0.375rem 0.875rem;
    font-size: var(--text-sm);
}

/* ============================================================================
   TOOLTIPS (CSS-only)
   ============================================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 100;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.5rem 0.75rem;
    background: var(--gray-900);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

[data-tooltip]::after {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* Tooltip positions */
[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 0.5rem;
    transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--gray-900);
}

[data-tooltip-pos="bottom"]:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* ============================================================================
   MODAL / DIALOG
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active .modal,
.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ============================================================================
   MOBILE MENU
   ============================================================================ */

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Hamburger icon animation */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 20px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile sidebar overlay */
.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--white);
    z-index: 151;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--transition-slow), visibility var(--transition-slow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-sidebar-close {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.mobile-sidebar-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.mobile-sidebar-content {
    flex: 1;
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.mobile-sidebar .sidebar-section {
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.mobile-search {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-search .search-input {
    width: 100%;
}

/* ============================================================================
   DARK MODE TOGGLE
   ============================================================================ */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* ============================================================================
   ACCESSIBILITY - FOCUS STATES
   ============================================================================ */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Remove default outline and add custom focus */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: fixed;
    top: 0;
    left: 0;
    padding: 1rem;
    background: var(--primary);
    color: white;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ============================================================================
   VOTE ANIMATION
   ============================================================================ */

.vote-btn.voted {
    animation: pulse 0.3s ease-out;
}

.vote-score.changed {
    animation: pulse 0.3s ease-out;
}

/* ============================================================================
   UTILITY CLASSES - EXTENDED
   ============================================================================ */

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Spacing utilities */
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.pt-6 { padding-top: var(--space-6); }
.pb-6 { padding-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* Text utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Form utility classes for replacing inline styles */
.form-card { padding: var(--space-8); }
.form-actions {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    margin-top: var(--space-6);
}
.textarea-tall { min-height: 200px; }
.error-list {
    margin: 0;
    padding-left: var(--space-5);
}
.breadcrumb-current { color: var(--gray-700); }
.bio-text {
    margin-top: var(--space-2);
    color: var(--gray-600);
}
.best-answer-label {
    color: var(--success);
    font-weight: 500;
}
.section-spaced { margin-bottom: var(--space-6); }
.alert-spaced { margin-top: var(--space-6); }

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.page-header {
    margin-bottom: var(--space-8);
    animation: fadeInUp var(--transition-slow) ease-out;
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

/* ============================================================================
   ABOUT PAGE
   ============================================================================ */

.about-hero {
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-8);
}

.lead-text {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.about-section {
    margin-bottom: var(--space-10);
}

.about-section h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-4);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.feature-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
}

.feature-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.guidelines-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guidelines-list li {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-secondary);
}

.guidelines-list li:last-child {
    border-bottom: none;
}

.guidelines-list strong {
    color: var(--text-primary);
}

.about-cta {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

/* ============================================================================
   FAQ PAGE
   ============================================================================ */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    transition: all var(--transition-base);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: var(--space-5) var(--space-6);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    transition: background var(--transition-fast);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform var(--transition-base);
    flex-shrink: 0;
    margin-left: var(--space-4);
}

.faq-item[open] .faq-question::after {
    transform: rotate(-135deg);
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-answer {
    padding: 0 var(--space-6) var(--space-5);
    color: var(--text-secondary);
    line-height: 1.7;
    animation: fadeInUp var(--transition-base) ease-out;
}

.faq-answer p:first-child {
    margin-top: 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    margin: var(--space-3) 0;
    padding-left: var(--space-6);
}

.faq-answer li {
    margin-bottom: var(--space-2);
}

/* ============================================================================
   CONTACT PAGE
   ============================================================================ */

.contact-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-8);
    align-items: start;
}

.contact-form-card {
    animation: fadeInUp var(--transition-slow) ease-out;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.contact-form .btn {
    margin-top: var(--space-4);
}

.contact-info-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.contact-info-card {
    text-align: center;
    padding: var(--space-6);
    animation: fadeInUp var(--transition-slow) ease-out;
}

.contact-info-card:nth-child(2) {
    animation-delay: 0.1s;
}

.contact-info-card:nth-child(3) {
    animation-delay: 0.2s;
}

.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.contact-icon svg {
    width: 28px;
    height: 28px;
}

.contact-info-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
}

.contact-info-card p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-1);
}

.contact-info-card a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.contact-info-card a:hover {
    text-decoration: underline;
}

/* ============================================================================
   LEGAL PAGES (Terms, Privacy)
   ============================================================================ */

.legal-content {
    max-width: 800px;
    line-height: 1.8;
}

.legal-section {
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border-color-light);
}

.legal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-section h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-4);
}

.legal-section h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--space-6) 0 var(--space-3);
}

.legal-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.legal-section ul {
    color: var(--text-secondary);
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.legal-section li {
    margin-bottom: var(--space-2);
}

.legal-section a {
    color: var(--primary);
}

.legal-section a:hover {
    text-decoration: underline;
}

/* ============================================================================
   404 ERROR PAGE
   ============================================================================ */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-8);
}

.error-content {
    text-align: center;
    max-width: 500px;
    animation: fadeInUp var(--transition-slow) ease-out;
}

.error-icon {
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.error-icon svg {
    width: 80px;
    height: 80px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin: 0 0 var(--space-4);
}

.error-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-4);
}

.error-message {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    line-height: 1.6;
    margin: 0 0 var(--space-8);
}

.error-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-8);
}

.error-search {
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.error-search > p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-4);
}

.error-search-form {
    display: flex;
    gap: var(--space-3);
    max-width: 400px;
    margin: 0 auto;
}

.error-search-form .search-wrapper {
    flex: 1;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS FOR NEW PAGES
   ============================================================================ */

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

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
    }

    .contact-info-cards {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .contact-info-card {
        flex: 1;
        min-width: 200px;
    }

    .error-code {
        font-size: 4rem;
    }

    .error-search-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: var(--text-2xl);
    }

    .lead-text {
        font-size: var(--text-lg);
    }

    .about-cta {
        flex-direction: column;
    }

    .about-cta .btn {
        width: 100%;
    }

    .contact-info-cards {
        flex-direction: column;
    }

    .contact-info-card {
        min-width: auto;
    }
}
