/* ── Story page — extends reading.css ───────────────────────────────────── */

/* ── Loading / error ─────────────────────────────────────────────────────── */
.story-loading {
    text-align: center;
    padding: 100px 20px;
    color: #6b7280;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.story-error {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 60px 20px;
}

.story-error-inner {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    color: #6b7280;
}

.story-error-inner h2 {
    font-size: 1.4rem;
    color: #374151;
    margin: 12px 0 8px;
}

.story-back-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #ff006e;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.story-back-btn:hover { background: #d4005d; }

/* ── Page layout ─────────────────────────────────────────────────────────── */
.story-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 20px 80px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.story-breadcrumb {
    display: inline-block;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.15s;
}

.story-breadcrumb:hover { color: #ff006e; }

/* ── Story header ────────────────────────────────────────────────────────── */
.story-header {
    margin-bottom: 32px;
}

.story-header-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.story-language-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
}

.story-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 16px;
}

/* ── Audio player ────────────────────────────────────────────────────────── */
.story-audio-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 8px;
}

.story-audio-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.story-audio-section audio {
    width: 100%;
    display: block;
}

/* ── Story body ──────────────────────────────────────────────────────────── */
.story-body-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.story-body p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #1f2937;
    margin: 0 0 18px;
}

.story-body p:last-child {
    margin-bottom: 0;
}

/* ── Vocabulary widget ───────────────────────────────────────────────────── */
.story-vocab-widget {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 28px;
}

.story-vocab-title {
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 4px;
}

.story-vocab-subtitle {
    font-size: 13px;
    color: #059669;
    margin: 0 0 14px;
}

.story-vocab-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-vocab-input,
.story-vocab-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #111827;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.15s;
}

.story-vocab-input:focus,
.story-vocab-textarea:focus {
    outline: none;
    border-color: #059669;
}

.story-vocab-save-btn {
    align-self: flex-start;
    padding: 9px 20px;
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.story-vocab-save-btn:hover { background: #047857; }
.story-vocab-save-btn:disabled { background: #9ca3af; cursor: not-allowed; }

.story-vocab-feedback {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0;
}

.story-vocab-feedback.success {
    background: #d1fae5;
    color: #065f46;
}

.story-vocab-feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Questions section ───────────────────────────────────────────────────── */
.story-questions-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.story-questions-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.story-questions-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.story-questions-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ── Individual question ─────────────────────────────────────────────────── */
.question-block {
    margin-bottom: 28px;
}

.question-block:last-of-type {
    margin-bottom: 0;
}

.question-number {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ff006e;
    margin-bottom: 6px;
}

.question-text {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 10px;
    line-height: 1.5;
}

.question-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: #f9fafb;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}

.question-textarea:focus {
    outline: none;
    border-color: #ff006e;
    background: #ffffff;
}

.question-textarea.error {
    border-color: #ef4444;
    background: #fff5f5;
}

.question-error-msg {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

/* ── Submit bar ──────────────────────────────────────────────────────────── */
.story-submit-bar {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.story-submit-btn {
    padding: 13px 32px;
    background: #ff006e;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.story-submit-btn:hover {
    background: #d4005d;
    transform: translateY(-1px);
}

.story-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.story-submit-note {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .story-container { padding: 20px 16px 60px; }
    .story-body-section { padding: 20px 18px; }
    .story-questions-section { padding: 20px 18px; }
    .story-title { font-size: 1.5rem; }
}

/* ── Grading modal ───────────────────────────────────────────────────────── */
.grading-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.grading-modal-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.grading-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
}

.grading-modal-body {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.6;
}

.grading-modal-share {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.grading-modal-link-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    min-width: 0;
}

.grading-modal-copy-btn {
    padding: 9px 16px;
    background: #374151;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.grading-modal-copy-btn:hover { background: #1f2937; }

.grading-modal-divider {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 0 0 20px;
}

.grading-modal-upsell-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.grading-modal-upsell-body {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 20px;
}

.grading-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.grading-modal-primary-btn {
    padding: 11px 24px;
    background: #ff006e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.grading-modal-primary-btn:hover { background: #d4005d; }
.grading-modal-primary-btn:disabled { background: #9ca3af; cursor: not-allowed; }

.grading-modal-secondary-btn {
    padding: 11px 24px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.grading-modal-secondary-btn:hover { background: #e5e7eb; }

.grading-modal-credit-note {
    font-size: 12px;
    color: #6b7280;
    margin: 12px 0 0;
}

/* ── Instructions ────────────────────────────────────────────────────────── */
.story-instructions {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 14px;
    color: #1e40af;
    font-weight: 500;
    line-height: 1.6;
}