/* Studies.ng — Front-end styles */
.sng-widget {
    --sng-primary: #0b5fff;
    --sng-primary-dark: #0946c4;
    --sng-bg: #f7f9fc;
    --sng-border: #e1e6ef;
    --sng-text: #1c2430;
    --sng-muted: #6b7686;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--sng-text);
    max-width: 900px;
    margin: 1.5em 0;
    background: #fff;
    border: 1px solid var(--sng-border);
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
}
.sng-widget * { box-sizing: border-box; }
.sng-widget h3 { margin-top: 0; font-size: 1.4em; }
.sng-muted { color: var(--sng-muted); font-size: 0.92em; }

.sng-widget input[type=text],
.sng-widget input[type=email],
.sng-widget input[type=number],
.sng-widget input[type=file],
.sng-widget select,
.sng-widget textarea {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0 14px;
    border: 1px solid var(--sng-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--sng-text);
}
.sng-widget input[type=color] { width: 60px; height: 38px; margin-bottom: 14px; padding: 2px; }
.sng-widget label { font-weight: 600; font-size: 0.9em; display: block; }

.sng-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--sng-border);
    background: #fff;
    color: var(--sng-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 4px 6px 4px 0;
    transition: all .15s ease;
}
.sng-btn:hover { background: var(--sng-bg); }
.sng-btn-primary { background: var(--sng-primary); border-color: var(--sng-primary); color: #fff; }
.sng-btn-primary:hover { background: var(--sng-primary-dark); }

.sng-notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.92em; }
.sng-notice-warning { background: #fff8e6; border: 1px solid #f0d58c; color: #6b5300; }
.sng-notice-error { background: #fdeaea; border: 1px solid #f0a8a8; color: #7a1212; }
.sng-notice-success { background: #e9f8ee; border: 1px solid #a6e0bb; color: #14602f; }

/* ---------- CBT ---------- */
.sng-cbt-header { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.sng-cbt-timer { color: var(--sng-primary); }
.sng-cbt-question-block { background: var(--sng-bg); padding: 18px; border-radius: 10px; margin-bottom: 16px; }
.sng-cbt-question-text { font-weight: 700; margin-bottom: 12px; }
.sng-cbt-option { display: block; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--sng-border); border-radius: 8px; cursor: pointer; background: #fff; }
.sng-cbt-option:hover { border-color: var(--sng-primary); }
.sng-cbt-option.selected { border-color: var(--sng-primary); background: #eef4ff; }
.sng-cbt-option input { margin-right: 8px; }
.sng-cbt-nav { display: flex; justify-content: space-between; gap: 8px; }
.sng-cbt-result-score { font-size: 2.2em; font-weight: 800; color: var(--sng-primary); }
.sng-cbt-result-pass { color: #14602f; }
.sng-cbt-result-fail { color: #a12222; }
.sng-cbt-review-item { border: 1px solid var(--sng-border); border-radius: 8px; padding: 12px; margin-top: 10px; }
.sng-cbt-review-item.correct { border-left: 4px solid #22a35a; }
.sng-cbt-review-item.incorrect { border-left: 4px solid #d33; }

/* ---------- CGPA ---------- */
.sng-cgpa-scale-toggle { margin-bottom: 16px; display: flex; gap: 20px; }
.sng-cgpa-scale-toggle label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.sng-cgpa-semester { border: 1px solid var(--sng-border); border-radius: 10px; padding: 16px; margin-bottom: 16px; background: var(--sng-bg); }
.sng-cgpa-semester-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sng-cgpa-course-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.sng-cgpa-course-row input, .sng-cgpa-course-row select { margin: 0; }
.sng-cgpa-remove { color: #c0392b; background: none; border: none; cursor: pointer; font-weight: 700; font-size: 1.1em; }
.sng-cgpa-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.sng-cgpa-summary-box { background: var(--sng-bg); border-radius: 10px; padding: 14px; text-align: center; }
.sng-cgpa-summary-highlight { background: var(--sng-primary); color: #fff; }
.sng-cgpa-label { display: block; font-size: 0.78em; opacity: 0.85; margin-bottom: 4px; }
.sng-cgpa-value, .sng-cgpa-total-units, .sng-cgpa-total-points, .sng-cgpa-class { font-size: 1.4em; font-weight: 800; }

/* ---------- PDF Converter ---------- */
.sng-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--sng-border); }
.sng-tab-btn { background: none; border: none; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--sng-muted); border-bottom: 2px solid transparent; }
.sng-tab-btn.active { color: var(--sng-primary); border-color: var(--sng-primary); }
.sng-pdf-image-preview { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.sng-pdf-image-preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--sng-border); }
.sng-pdf-status { margin-top: 10px; }

/* ---------- Course Material ---------- */
.sng-course-material-content { background: var(--sng-bg); padding: 18px; border-radius: 10px; white-space: pre-wrap; line-height: 1.6; max-height: 500px; overflow-y: auto; }
.sng-course-material-actions { margin-top: 12px; }

/* ---------- ID Card ---------- */
.sng-idcard-layout { display: flex; gap: 24px; flex-wrap: wrap; }
.sng-idcard-form { flex: 1; min-width: 280px; }
.sng-idcard-form fieldset { border: 1px solid var(--sng-border); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.sng-idcard-form legend { font-weight: 700; padding: 0 6px; }
.sng-idcard-preview-wrap { flex: 1; min-width: 300px; text-align: center; }
#sng-idcard-canvas { max-width: 100%; border: 1px solid var(--sng-border); border-radius: 10px; background: #fff; }
.sng-idcard-actions { margin-top: 14px; }

/* ---------- Resume Builder ---------- */
.sng-resume-layout { display: flex; gap: 24px; flex-wrap: wrap; }
.sng-resume-form { flex: 1; min-width: 300px; }
.sng-resume-form fieldset { border: 1px solid var(--sng-border); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.sng-resume-form legend { font-weight: 700; padding: 0 6px; }
.sng-resume-entry { border: 1px dashed var(--sng-border); border-radius: 8px; padding: 10px; margin-bottom: 10px; position: relative; }
.sng-resume-entry .sng-resume-remove { position: absolute; top: 6px; right: 8px; background: none; border: none; color: #c0392b; cursor: pointer; font-weight: 700; }
.sng-resume-preview-wrap { flex: 1; min-width: 320px; }
.sng-resume-preview { background: #fff; border: 1px solid var(--sng-border); border-radius: 4px; padding: 30px; min-height: 500px; font-size: 13px; line-height: 1.5; color: #222; }
.sng-resume-preview h1 { font-size: 1.6em; margin: 0 0 2px; }
.sng-resume-preview h2 { font-size: 1em; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--sng-primary); padding-bottom: 4px; margin: 18px 0 8px; }
.sng-resume-preview .sng-r-contact { color: #555; font-size: 0.9em; margin-bottom: 14px; }
.sng-resume-preview .sng-r-entry { margin-bottom: 10px; }
.sng-resume-preview .sng-r-entry-title { font-weight: 700; }
.sng-resume-preview .sng-r-entry-meta { font-size: 0.85em; color: #666; }
.sng-resume-template-modern h1 { color: var(--sng-primary); }
.sng-resume-template-minimal h2 { border-bottom: 1px solid #ccc; color: #444; }

@media (max-width: 700px) {
    .sng-cgpa-summary { grid-template-columns: repeat(2, 1fr); }
    .sng-cgpa-course-row { grid-template-columns: 1fr; }
}
