/* ============================================
   BrainNotFound - Monochrome Editorial Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Monochrome palette */
    --black: #0a0a0a;
    --white: #fafafa;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-300: #c0c0c0;
    --gray-400: #888888;
    --gray-500: #666666;
    --gray-600: #444444;
    --gray-700: #2a2a2a;
    --gray-800: #1a1a1a;

    /* Semantic colors (subtle) */
    --success: #0a0a0a;
    --error: #0a0a0a;
    --warning: #0a0a0a;
    --info: #0a0a0a;

    /* Accents (for badges only) */
    --accent-success: #2d5a27;
    --accent-error: #8b2020;
    --accent-warning: #8b6914;
    --accent-info: #1e40af;
    --accent-primary: var(--black);

    /* Layout */
    --bg: var(--white);
    --bg-secondary: var(--gray-100);
    --bg-tertiary: var(--gray-100);
    --bg-card: var(--white);
    --text: var(--black);
    --text-primary: var(--black);
    --text-secondary: var(--gray-600);
    --text-light: var(--gray-500);
    --border: var(--black);
    --border-light: var(--gray-200);
    --border-color: var(--gray-300);
    --primary: var(--black);
    --primary-hover: var(--gray-700);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

/* Dark Mode */
[data-theme="dark"] {
    --black: #fafafa;
    --white: #0a0a0a;
    --gray-100: #1a1a1a;
    --gray-200: #2a2a2a;
    --gray-300: #444444;
    --gray-400: #666666;
    --gray-500: #888888;
    --gray-600: #c0c0c0;
    --gray-700: #e0e0e0;
    --gray-800: #f0f0f0;

    /* Accents adjusted for dark mode */
    --accent-success: #4ade80;
    --accent-error: #f87171;
    --accent-warning: #fbbf24;
    --accent-info: #60a5fa;
    --accent-primary: #fafafa;

    /* Layout overrides */
    --bg: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #1f1f1f;
    --bg-card: #151515;
    --text: #fafafa;
    --text-primary: #fafafa;
    --text-secondary: #b0b0b0;
    --text-light: #888888;
    --border: #333333;
    --border-light: #2a2a2a;
    --border-color: #444444;
    --primary: #fafafa;
    --primary-hover: #e0e0e0;
}

[data-theme="dark"] ::selection {
    background: var(--white);
    color: var(--bg);
}

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

::selection {
    background: var(--black);
    color: var(--white);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--black);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

a {
    color: var(--black);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.6;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    background: var(--black);
    color: var(--white);
    padding: 0;
    margin-bottom: 3rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand a {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-brand a::before {
    content: '>';
    margin-right: 0.5rem;
    opacity: 0.5;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.nav-menu a:hover {
    opacity: 1;
    border-bottom-color: var(--white);
}

.nav-user {
    color: var(--gray-400);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.btn-logout {
    color: var(--gray-400) !important;
}

.btn-logout:hover {
    color: var(--white) !important;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--white);
}

.theme-toggle-floating {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: var(--text);
    z-index: 1000;
}

.theme-toggle-floating:hover {
    color: var(--text);
    border-color: var(--border);
}

/* Tenant Selector Dropdown */
.nav-tenant-selector {
    position: relative;
    margin-left: 0.5rem;
}

.tenant-dropdown {
    position: relative;
}

.tenant-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--white);
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tenant-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.tenant-dropdown-btn i:last-child {
    font-size: 0.7rem;
    opacity: 0.7;
}

.tenant-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    padding: 0.5rem 0;
}

.tenant-dropdown:hover .tenant-dropdown-menu,
.tenant-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tenant-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}

a.tenant-option {
    padding: 0.6rem 1rem;
}

.tenant-option:hover {
    background: #2a2a2a;
    color: #fff;
}

.tenant-option.active {
    background: var(--primary);
    color: #fff;
}

.tenant-option i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.tenant-divider {
    height: 1px;
    background: #333;
    margin: 0.25rem 0;
}

/* Generic Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    padding: 0.25rem 0;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Tenant group sections in forms */
.tenant-groups-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tenant-group-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 1rem;
}

.tenant-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.tenant-group-header i {
    color: var(--text-light);
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 0 0 4rem 0;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid var(--black);
    font-size: 0.9rem;
    position: relative;
    padding-left: 3rem;
}

.alert::before {
    font-family: var(--font-mono);
    position: absolute;
    left: 1rem;
    font-weight: 700;
}

.alert-success {
    background: var(--gray-100);
}

.alert-success::before {
    content: '[OK]';
}

.alert-error {
    background: var(--gray-100);
}

.alert-error::before {
    content: '[!!]';
}

.alert-info {
    background: var(--gray-100);
}

.alert-info::before {
    content: '[i]';
}

.alert-warning {
    background: rgba(139, 105, 20, 0.1);
    border-color: var(--accent-warning);
}

.alert-warning::before {
    content: '[!]';
    color: var(--accent-warning);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--black);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

/* Recent Activity */
.recent-activity {
    padding: 0;
}

.activity-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-hover);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--black);
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    box-shadow: 4px 4px 0 var(--black);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.form-textarea-tall {
    min-height: 500px;
}

.form-checkbox {
    margin-right: 0.5rem;
    accent-color: var(--black);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    vertical-align: middle;
}

.btn:hover {
    background: var(--black);
    color: var(--white);
    opacity: 1;
}

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

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

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

.btn-error {
    background: var(--white);
    color: var(--black);
    border-style: dashed;
}

.btn-error:hover {
    background: var(--black);
    color: var(--white);
    border-style: solid;
}

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

.btn-small {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
}

.btn-icon i {
    font-size: 1rem;
}

.btn i:not(:only-child) {
    margin-right: 0.4rem;
}

/* ============================================
   Tooltips
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    bottom: 100%;
    left: 50%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 100;
}

[data-tooltip]::before {
    content: '';
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--black);
    margin-bottom: -12px;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    transform: translateX(-50%) translateY(-4px);
    background: var(--black);
    color: var(--white);
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
}

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

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(-8px);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
}

.auth-card {
    background: var(--bg-card);
    border: 2px solid var(--black);
    padding: 2.5rem;
}

.auth-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--black);
}

.auth-title::before {
    content: '// ';
    opacity: 0.3;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-link a {
    color: var(--black);
    font-weight: 500;
}

/* ============================================
   Dashboard / Stats
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--black);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--black);
    line-height: 1;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.75rem;
}

/* ============================================
   Quiz List
   ============================================ */
.quiz-grid {
    display: grid;
    gap: 1rem;
}

.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--black);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s;
}

.quiz-card:hover {
    box-shadow: 4px 4px 0 var(--black);
}

.quiz-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.quiz-meta {
    color: var(--text-light);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Quiz status badges */
.quiz-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
    margin-right: 0.5rem;
}

.quiz-status.completed {
    background: var(--black);
    color: var(--white);
}

.quiz-status.pending {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--black);
}

/* Group codes grid */
.group-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.group-code-card {
    background: var(--gray-100);
    border: 1px solid var(--border-light);
    padding: 1rem;
    text-align: center;
}

.group-code-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-code-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.group-code-value .font-mono {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--info);
    letter-spacing: 0.1em;
}

.group-code-meta {
    font-size: 0.75rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-light);
    background: var(--gray-100);
}

.filter-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--black);
    background: var(--white);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

/* User filter bar with multiple filters */
.user-filter-bar {
    flex-wrap: wrap;
}

.user-filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-filter-bar .filter-group label {
    display: flex;
    align-items: center;
}

.user-filter-bar .filter-group label i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .user-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .user-filter-bar .filter-group {
        width: 100%;
    }

    .user-filter-bar .filter-group select {
        flex: 1;
    }

    .user-filter-bar #quiz-count {
        margin-left: 0;
        text-align: center;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
    }
}

.quiz-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Questions
   ============================================ */
.question {
    background: var(--bg-card);
    border: 1px solid var(--black);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.question-type {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--black);
    background: var(--black);
    color: var(--white);
}

.question-points {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-light);
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    white-space: pre-wrap;
    line-height: 1.7;
}

/* Quiz images */
.quiz-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-light);
    margin: 0.75rem 0;
    display: block;
}

.option .quiz-image {
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
    margin: 0.25rem 0.5rem 0.25rem 0;
}

/* Inline code in questions/options */
.question-text code,
.option code,
.expected-answer code,
.answer-box code {
    background: var(--gray-100);
    border: 1px solid var(--border-light);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent-error);
}

/* Code blocks in questions */
.question-text pre,
.expected-answer pre {
    background: var(--gray-800);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.question-text pre code,
.expected-answer pre code {
    background: none;
    border: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.options {
    list-style: none;
}

.option {
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.option:hover {
    border-color: var(--black);
    background: var(--gray-100);
}

.option input {
    margin-right: 0.875rem;
    accent-color: var(--black);
}

.option input:checked + span,
.option:has(input:checked) {
    font-weight: 500;
}

/* ============================================
   Results
   ============================================ */
.score-banner {
    background: var(--black);
    color: var(--white);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 2px solid var(--black);
}

.score-value {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.answer-correct {
    border-left: 4px solid var(--black);
    background: var(--gray-100);
}

.answer-incorrect {
    border-left: 4px solid var(--black);
    border-left-style: dashed;
}

.answer-partial {
    border-left: 4px solid var(--gray-400);
}

.feedback {
    background: var(--gray-100);
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    border-left: 2px solid var(--gray-300);
    font-style: italic;
}

/* ============================================
   Tables
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    font-size: 0.9rem;
}

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

.table th {
    background: var(--gray-100);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover td {
    background: var(--gray-100);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Selectable table */
.table-selectable .th-checkbox,
.table-selectable .td-checkbox {
    width: 40px;
    text-align: center;
    padding: 0.5rem;
}

.table-selectable .th-checkbox input,
.table-selectable .td-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.table-selectable tr.row-selected td {
    background: var(--info-bg);
}

/* Sortable table headers */
.th-sortable a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
}

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

.th-sortable i {
    font-size: 0.875rem;
    opacity: 0.5;
}

.th-sortable.sorted-asc i,
.th-sortable.sorted-desc i {
    opacity: 1;
    color: var(--primary);
}

/* Bulk actions bar */
.bulk-actions-bar {
    background: var(--gray-100);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.bulk-actions-bar .bulk-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--black);
    color: var(--gray-400);
    padding: 1.5rem 0;
    margin-top: 4rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.footer-links {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-separator {
    margin: 0 0.75rem;
    color: var(--gray-600);
}

/* ============================================
   Utility Classes
   ============================================ */

/* Text */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.text-success { color: var(--accent-success); }
.text-error { color: var(--accent-error); }
.text-warning { color: var(--accent-warning); }
.text-mono { font-family: var(--font-mono); }
.font-mono { font-family: var(--font-mono); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 600; }
.whitespace-pre { white-space: pre-wrap; }

/* Margins */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.ml-1 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.5rem; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.flex-1 { flex: 1; }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.min-w-150 { min-width: 150px; }
.min-w-200 { min-width: 200px; }
.min-w-300 { min-width: 300px; }

/* Display */
.hidden { display: none; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.block { display: block; }

/* Position */
.relative { position: relative; }
.sticky { position: sticky; top: 0; z-index: 100; }

/* Borders */
.border { border: 1px solid var(--border); }
.border-light { border: 1px solid var(--border-light); }
.border-b { border-bottom: 1px solid var(--border-light); }
.rounded { border-radius: 0.5rem; }
.rounded-sm { border-radius: 0.25rem; }

/* Backgrounds */
.bg-gray { background: var(--gray-100); }
.bg-success-light { background: rgba(45, 90, 39, 0.1); }
.bg-error-light { background: rgba(139, 32, 32, 0.1); }
.bg-warning-light { background: rgba(139, 105, 20, 0.1); }
.bg-primary-light { background: var(--gray-100); border-color: var(--black); }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Form-specific */
.input-inline {
    width: auto;
    display: inline-block;
}

.input-sm {
    width: 120px;
}

.input-md {
    width: 220px;
}

.input-lg {
    width: 250px;
}

/* Checkbox/Radio group item */
.check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.check-item:hover {
    border-color: var(--black);
}

.check-item.selected,
.check-item:has(input:checked) {
    background: var(--gray-100);
    border-color: var(--black);
}

/* Info box styles */
.info-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.info-box.success {
    background: rgba(45, 90, 39, 0.1);
    border: 1px solid var(--accent-success);
}

.info-box.warning {
    background: rgba(139, 105, 20, 0.1);
    border: 1px solid var(--accent-warning);
}

.info-box.error {
    background: rgba(139, 32, 32, 0.1);
    border: 1px solid var(--accent-error);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
}

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

.badge-error {
    background: var(--accent-error);
    color: white;
}

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

.badge-default {
    background: var(--gray-400);
    color: white;
}

.badge-info {
    background: #3b82f6;
    color: white;
}

.badge-primary {
    background: #8b5cf6;
    color: white;
}

/* Code block */
.code-block {
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Helper text under form fields */
.help-text {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Section divider */
.divider {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Action row (buttons) */
.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    padding: 1rem 3rem 1rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: var(--black);
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: var(--accent-success);
}

.toast-error {
    background: var(--accent-error);
}

.toast-warning {
    background: var(--accent-warning);
}

.toast-info {
    background: var(--gray-700);
}

@media (max-width: 480px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        max-width: 100%;
    }
}

/* Preview banner */
.preview-banner {
    background: linear-gradient(135deg, var(--gray-700), var(--black));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.preview-banner h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.preview-banner p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 0;
}

/* Share link box */
.share-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-link {
    flex: 1;
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Info grid (for metadata display) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Answer display boxes */
.answer-box {
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.answer-box.correct {
    background: rgba(45, 90, 39, 0.1);
    border: 1px solid var(--accent-success);
}

.answer-box.expected {
    background: rgba(45, 90, 39, 0.1);
}

/* Option in preview mode */
.option.correct-answer {
    background: rgba(45, 90, 39, 0.15);
    border-color: var(--accent-success);
}

/* ============================================
   Badges / Tags
   ============================================ */
[style*="background: var(--primary)"],
[style*="background: var(--success)"] {
    background: var(--black) !important;
}

[style*="background: var(--error)"] {
    background: var(--black) !important;
    border: 1px dashed var(--white) !important;
}

[style*="background: var(--text-light)"] {
    background: var(--gray-400) !important;
}

/* ============================================
   Modal System
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 2px solid var(--black);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    font-family: var(--font-mono);
}

.modal-close:hover {
    color: var(--black);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

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

/* Modal types */
.modal-info .modal-header,
.modal-warning .modal-header,
.modal-danger .modal-header,
.modal-success .modal-header {
    border-left: 4px solid var(--black);
}

.modal-danger .modal-header {
    border-left-style: dashed;
}

/* ============================================
   Grading Progress
   ============================================ */
.grading-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-circle-container {
    position: relative;
    display: inline-block;
}

.progress-bar {
    stroke: var(--black);
}

.progress-bg {
    stroke: var(--gray-200);
}

.score-badge {
    font-family: var(--font-mono);
    font-weight: 700;
}

.score-badge.good {
    background: var(--black);
    color: var(--white);
}

.score-badge.medium {
    background: var(--gray-400);
    color: var(--white);
}

.score-badge.low {
    background: var(--white);
    color: var(--black);
    border: 1px dashed var(--black);
}

/* ============================================
   Searchable Select
   ============================================ */
.searchable-select {
    position: relative;
    min-width: 180px;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--black);
    cursor: pointer;
    font-size: 0.875rem;
    min-height: 38px;
    transition: all 0.2s;
}

.searchable-select-trigger:hover {
    background: var(--gray-100);
}

.searchable-select.open .searchable-select-trigger {
    box-shadow: 3px 3px 0 var(--black);
}

.searchable-select-trigger i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.searchable-select.open .searchable-select-trigger i {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--black);
    box-shadow: 4px 4px 0 var(--black);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow: hidden;
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.searchable-select-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    font-size: 0.875rem;
    outline: none;
}

.searchable-select-search input:focus {
    border-color: var(--black);
}

.searchable-select-options {
    max-height: 220px;
    overflow-y: auto;
}

.searchable-select-option {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.searchable-select-option:last-child {
    border-bottom: none;
}

.searchable-select-option:hover {
    background: var(--gray-100);
}

.searchable-select-option.selected {
    background: var(--black);
    color: var(--white);
}

.searchable-select-option.hidden {
    display: none;
}

.searchable-select-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .quiz-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .quiz-actions {
        width: 100%;
    }

    .quiz-actions .btn {
        flex: 1;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* ============================================
   Preview & Quiz Display Classes
   ============================================ */

/* Correct option in preview */
.option-correct {
    background: rgba(45, 90, 39, 0.15);
    border-color: var(--accent-success);
}

/* Incorrect option selected */
.option-incorrect {
    background: rgba(139, 32, 32, 0.15);
    border-color: var(--accent-error);
}

/* Expected answer box */
.expected-answer {
    padding: 1rem;
    background: rgba(45, 90, 39, 0.1);
    border: 1px solid var(--accent-success);
    border-radius: 0.5rem;
}

/* Warning box */
.warning-box {
    padding: 0.75rem;
    background: rgba(139, 105, 20, 0.1);
    border: 1px solid var(--accent-warning);
    border-radius: 0.5rem;
}

/* Info list (simple list style) */
.info-list {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

/* Inverse secondary button (for dark backgrounds) */
.btn-secondary-inverse {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
}

.btn-secondary-inverse:hover {
    background: var(--black);
}

/* Ghost button (transparent on dark bg) */
.btn-ghost {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Border top utility */
.border-t {
    border-top: 1px solid var(--border-light);
}

/* Padding top */
.pt-2 {
    padding-top: 1rem;
}

/* Text info color */
.text-info {
    color: var(--gray-600);
}

/* Small tag (for groups, etc) */
.tag {
    background: var(--gray-100);
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

/* Search results info */
.search-results-info {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-light);
}

/* Inline display */
.inline {
    display: inline;
}

/* Search input */
.input-search {
    width: 180px;
    padding: 0.4rem 0.75rem;
}

/* Pagination */
.pagination {
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-ellipsis {
    padding: 0.5rem;
}

/* Margin zero */
.mt-0 {
    margin-top: 0.25rem;
}

/* Link primary color */
.link-primary {
    color: var(--black);
    text-decoration: none;
}

.link-primary:hover {
    text-decoration: underline;
}

/* Instructions list (numbered) */
.instructions-list {
    margin-left: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Form textarea short */
.form-textarea-short {
    min-height: 100px;
}

/* Grid 2 columns */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.gap-lg {
    gap: 1.5rem;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.loading-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.loading-text {
    color: #aaa;
    margin-bottom: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Score colors */
.score-good { color: var(--accent-success); font-weight: 600; }
.score-medium { color: var(--accent-warning); font-weight: 600; }
.score-bad { color: var(--accent-error); font-weight: 600; }

/* Mini badge */
.badge-mini {
    background: var(--accent-warning);
    color: white;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
    font-size: 0.625rem;
}

/* Answer section for edit_response */
.answer-section {
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 0;
}

.answer-section.first {
    padding-top: 0;
}

.answer-section.last {
    border-bottom: none;
    padding-bottom: 0;
}

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

.score-input {
    min-width: 150px;
}

.input-score {
    width: 80px;
}

/* Question badge */
.question-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

/* Option tag for answers */
.option-tag {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    color: white;
}

.option-tag.correct {
    background: var(--accent-success);
}

.option-tag.incorrect {
    background: var(--accent-error);
}

/* Margin bottom minimal */
.mb-0 {
    margin-bottom: 0.25rem;
}

/* Text size */
.text-xl {
    font-size: 1.25rem;
}

/* Margin left auto */
.ml-auto {
    margin-left: auto;
}

/* Grid with medium gap */
.gap-md {
    gap: 1rem;
}

/* Radio/checkbox groups for forms */
.radio-group,
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 0.25rem;
}

/* Disabled state */
.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Landing Page Styles
   ============================================ */

.landing-body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Landing Navbar */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #000;
    border-bottom: 1px solid #222;
    z-index: 100;
}

.landing-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.landing-logo .logo-prefix {
    color: #888;
    font-family: var(--font-mono);
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.landing-nav-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}

.landing-nav-link:hover {
    color: #fff;
}

.landing-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.landing-mobile-menu {
    display: none;
    flex-direction: column;
    padding: 1rem 2rem;
    background: #111;
    border-top: 1px solid #222;
}

.landing-mobile-menu.active {
    display: flex;
}

.landing-mobile-menu a {
    padding: 0.75rem 0;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #222;
}

/* Button white (for dark navbar) */
.btn-white {
    background: #fff;
    color: #000;
    border: 1px solid #fff;
}

.btn-white:hover {
    background: #eee;
}

/* Hero Section */
.landing-hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.landing-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.landing-hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.landing-hero-note {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-hero-note i {
    color: var(--accent-success);
}

/* Code Preview - fixed dark colors (no theme variables) */
.landing-hero-visual {
    display: flex;
    justify-content: center;
}

.landing-code-preview {
    background: #1a1a2e;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 500px;
}

.code-header {
    background: #16162a;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-title {
    margin-left: 0.5rem;
    color: #888;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.code-content {
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
    background: #1a1a2e;
}

.code-content code {
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.6;
    font-family: var(--font-mono);
    white-space: pre;
    background: transparent;
}

/* Features Section */
.landing-features {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.landing-section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.landing-section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.landing-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.landing-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
}

.landing-feature-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    color: var(--text);
}

.landing-feature-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.landing-feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Pricing Section */
.landing-pricing {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
}

.landing-pricing .landing-section-header {
    max-width: 1200px;
    margin: 0 auto 4rem;
}

.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.landing-pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 2.5rem;
    position: relative;
}

.landing-pricing-card.featured {
    border-color: var(--black);
    border-width: 2px;
}

.landing-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--black);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.landing-pricing-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.landing-pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.landing-pricing-price .price {
    font-size: 2rem;
    font-weight: 700;
}

.landing-pricing-price .period {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.landing-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.landing-pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

.landing-pricing-features li:last-child {
    border-bottom: none;
}

.landing-pricing-features li i {
    font-size: 1.1rem;
}

.landing-pricing-features li .iconoir-check {
    color: var(--accent-success);
}

.landing-pricing-features li .iconoir-xmark {
    color: var(--text-light);
}

.landing-pricing-features li.muted {
    color: var(--text-light);
}

.landing-pricing-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* Pricing Calculator */
.landing-calculator {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.landing-calculator h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.landing-calculator > p {
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calculator-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calculator-input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: var(--text-primary);
}

.calculator-label-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculator-value {
    font-family: var(--font-mono);
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    min-width: 3rem;
    text-align: center;
    flex-shrink: 0;
}

.calculator-input-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-600);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.calculator-input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.calculator-input-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.calculator-input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.calculator-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
}

.calculator-result {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1.5rem;
}

.calculator-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breakdown-line span:last-child {
    font-family: var(--font-mono);
}

.breakdown-note {
    color: var(--text-light);
}

.breakdown-separator {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.calculator-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.total-price {
    font-size: 1.75rem;
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

.calculator-per-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.calculator-per-user span:last-child {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-weight: 500;
}

.calculator-tiers {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.calculator-disclaimer {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.calculator-disclaimer i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.calculator-period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.period-btn:hover {
    border-color: var(--accent-primary);
}

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

.period-btn .discount-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-success);
}

.period-btn.active .discount-badge {
    color: rgba(255, 255, 255, 0.9);
}

.calculator-discount,
.calculator-period-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.discount-amount {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-weight: 500;
}

.period-total {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

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

    .calculator-period-selector {
        flex-direction: column;
    }

    .period-btn {
        flex-direction: row;
        justify-content: center;
    }

    .landing-calculator {
        margin: 2rem 1rem 0;
        padding: 1.5rem;
    }
}

/* Plans Grid */
.landing-plans {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan-card.popular {
    border-color: var(--accent-primary);
    border-width: 2px;
}

.plan-card.enterprise {
    background: var(--bg-tertiary);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.plan-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.plan-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-monthly {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-monthly small {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.7;
}

.price-yearly {
    font-size: 0.85rem;
    color: var(--text-light);
}

.discount-tag {
    color: var(--accent-success);
    font-weight: 600;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    flex: 1;
}

.plan-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li strong {
    font-weight: 600;
}

.plan-card .btn {
    margin-top: auto;
}

@media (max-width: 1024px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .landing-plans {
        margin: 2rem 1rem 0;
        padding: 1.5rem 1rem;
    }
}

/* CTA Section */
.landing-cta {
    padding: 6rem 2rem;
    background: var(--black);
    color: var(--white);
    text-align: center;
}

.landing-cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.landing-cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.landing-cta p {
    color: var(--gray-400);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.landing-cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

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

.landing-cta .btn-primary:hover {
    background: var(--gray-200);
}

.landing-cta .btn-secondary {
    background: transparent;
    border-color: var(--gray-600);
    color: var(--white);
}

.landing-cta .btn-secondary:hover {
    background: var(--gray-800);
}

/* Landing page footer override */
.landing-body .footer {
    margin-top: 0;
}

/* Button block */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Button large */
.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .landing-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 8rem;
    }

    .landing-hero-title {
        font-size: 2.5rem;
    }

    .landing-hero-actions {
        justify-content: center;
    }

    .landing-hero-note {
        justify-content: center;
    }

    .landing-hero-visual {
        order: -1;
    }

    .landing-code-preview {
        max-width: 400px;
    }

    .landing-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .landing-nav-links {
        display: none;
    }

    .landing-mobile-toggle {
        display: block;
    }

    .landing-hero-title {
        font-size: 2rem;
    }

    .landing-hero-subtitle {
        font-size: 1rem;
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
    }

    .landing-pricing-grid {
        grid-template-columns: 1fr;
    }

    .landing-cta h2 {
        font-size: 1.75rem;
    }

    .landing-cta-actions {
        flex-direction: column;
    }

    .calculator-label-text {
        font-size: 0.9rem;
    }

    .calculator-tiers small {
        display: block;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .landing-hero {
        padding: 6rem 1rem 3rem;
    }

    .landing-hero-title {
        font-size: 1.75rem;
    }

    .landing-hero-actions {
        flex-direction: column;
    }

    .code-content {
        font-size: 0.75rem;
    }

    .landing-section-header h2 {
        font-size: 1.75rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .question {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}
