/* =========================================================
   AI MCQ Checker — standalone stylesheet
   Base layout + glassmorphism + MCQ-specific + settings modal
   ========================================================= */

:root {
    --primary-color: #6c5ce7;
    --text-color: #2d2a45;
    --text-color-light: #6f6a85;
    --bg-grad-1: #f6f3ff;
    --bg-grad-2: #ffeef6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Header / Footer ===== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.header-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3); }

.site-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--text-color-light);
    font-size: 0.85rem;
}

/* ===== Page / Hero ===== */
.page { max-width: 1000px; margin: 0 auto; padding: 2rem 1rem; }

.blog-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 2rem 3.5rem;
}
.hero-copy .eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0 0 0.5rem;
}
.hero-copy h1 { font-size: 2.4rem; margin: 0 0 0.8rem; color: var(--text-color); }
.hero-copy p { color: var(--text-color-light); max-width: 560px; margin: 0; }
.hero-badge {
    display: inline-block;
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ===== Config Banner ===== */
.config-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(253, 203, 110, 0.18);
    border: 1px solid rgba(253, 203, 110, 0.5);
    color: #8a6d00;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}
.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    margin-left: auto;
}

/* ===== Glass Panel ===== */
.glass-panel {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.checker-dashboard { margin-top: -1rem; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.dashboard-header h2 { font-size: 1.6rem; color: var(--text-color); margin: 0; }

/* ===== Upload Grid ===== */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.upload-box {
    background: rgba(255, 255, 255, 0.4);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}
.upload-box:hover { border-color: #a29bfe; background: rgba(255, 255, 255, 0.6); }
.upload-icon { font-size: 3rem; color: #a29bfe; margin-bottom: 1rem; }
.upload-box h3 { margin: 0 0 0.5rem; font-size: 1.2rem; color: #333; }
.upload-box p { font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; }

.btn-upload {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.08); transform: translateY(-1px); }
.btn-small { font-size: 0.85rem; padding: 0.45rem 1rem; }

/* Auto download row */
.auto-download-section {
    background: rgba(0,0,0,0.02);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(0,0,0,0.05);
}
.auto-dl-title { font-weight: bold; margin-bottom: 8px; font-size: 0.9rem; color: var(--primary-color); }
.auto-dl-row { display: flex; gap: 5px; flex-wrap: wrap; }
.form-control {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    background: #fff;
}
.auto-dl-row select { flex: 1; min-width: 70px; }
.btn-icon-only { padding: 6px 12px; }

.ms-options { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.ms-options span { font-size: 0.9rem; color: #888; }
.ms-text-input {
    padding: 0.6rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(0,0,0,0.1);
    outline: none;
    font-family: monospace;
    font-size: 1rem;
    width: 200px;
}
.ms-text-input:focus { border-color: #a29bfe; }

.preview-area { margin-top: 1rem; }
.preview-area .thumb { max-width: 60px; max-height: 80px; margin: 2px; border-radius: 4px; }
.preview-area img { max-width: 100%; border-radius: 8px; }
.preview-info { font-size: 0.85rem; color: var(--text-color-light); margin-top: 10px; }
.muted { color: var(--text-color-light); }

/* ===== Action row ===== */
.action-row { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.line-select { width: 100%; max-width: 400px; }
.line-select label { font-weight: 500; margin-bottom: 5px; display: block; }
.line-select select { width: 100%; padding: 10px; border-radius: 8px; }

.btn-generate {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.btn-massive {
    padding: 1.1rem 3rem;
    font-size: 1.15rem;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}
.btn-massive:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(108, 92, 231, 0.4); }
.loading-status { color: #6c5ce7; font-weight: 600; font-size: 1.05rem; }

/* ===== Results ===== */
.results-section { margin-top: 2.5rem; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.results-header h2 { margin: 0; color: #333; }
.score-display {
    background: rgba(255, 117, 140, 0.12);
    color: #e84393;
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 800;
}
.table-container { overflow-x: auto; }
.grading-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.grading-table th {
    text-align: left; padding: 0.8rem 1rem; color: #666;
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase;
}
.grading-table td { background: rgba(255, 255, 255, 0.7); padding: 1rem; color: #333; font-weight: 500; }
.grading-table tr td:first-child { border-radius: 12px 0 0 12px; font-weight: 700; }
.grading-table tr td:last-child { border-radius: 0 12px 12px 0; }
.status-correct { color: #00b894; font-weight: 700; }
.status-wrong { color: #d63031; font-weight: 700; }

/* ===== Settings Modal ===== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-content {
    width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    padding: 2rem;
}
.modal-content h3 { margin: 0 0 0.6rem; color: #333; display: flex; align-items: center; gap: 0.5rem; }
.modal-desc { font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; }
.line-config {
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    background: rgba(255,255,255,0.4);
}
.line-config h4 { margin: 0 0 0.8rem; color: var(--primary-color); font-size: 1rem; }
.modal-content .form-group { margin-bottom: 1rem; }
.modal-content label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.85rem; color: #444; }
.modal-content input {
    width: 100%; box-sizing: border-box;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
    outline: none; font-size: 0.95rem;
}
.modal-content input:focus { border-color: var(--primary-color); }
.field-hint { display: block; margin-top: 0.4rem; color: #888; font-size: 0.78rem; line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }
.btn-primary {
    background: var(--primary-color); color: #fff; border: none;
    padding: 0.7rem 1.5rem; border-radius: 10px; font-weight: 600; cursor: pointer;
}
.btn-secondary {
    background: transparent; color: #666; border: 1px solid rgba(0,0,0,0.12);
    padding: 0.7rem 1.5rem; border-radius: 10px; font-weight: 600; cursor: pointer;
}

/* ===== Mobile ===== */
@media (max-width: 700px) {
    .blog-hero { grid-template-columns: 1fr; text-align: center; }
    .hero-copy h1 { font-size: 1.8rem; }
    .glass-panel { padding: 1.5rem; }
    .site-header { padding: 1rem; }
}
