:root{
  --bg:#F1F2FB;
  --text:#26274B;
  --btn:#3236FD;
  --border:#dcdff4;
  --danger:#ffdedf;
  --accent:#E2D2FF;
  --accent-2:#474BFF;
  --radius:10px;
}

*{box-sizing:border-box;font-family:Nunito,system-ui,Arial}
body{margin:0;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
.wrap{max-width:1200px;margin:24px auto;padding:18px}
h1{font-size:30px;text-align:center;margin:6px 0 2px;font-weight:800;color:var(--text)}
.subtitle{display:block;text-align:center;color:var(--accent-2);font-weight:700;margin-bottom:8px}
.top-line{height:6px;background:linear-gradient(90deg,var(--accent) 0%, var(--accent-2) 100%);border-radius:6px;margin:8px auto 18px;max-width:420px}

.card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:16px;margin-bottom:14px;box-shadow:0 6px 18px rgba(30,35,90,0.04)}
.section-title{font-size:20px;text-align:center;margin:4px 0 12px;font-weight:700}
.muted{color:#6a6e91}
.center{text-align:center}

/* School & Student Info grid */
.school-grid{display:grid;grid-template-columns:160px 1fr;gap:12px;align-items:start}
.logo-block{display:flex;flex-direction:column;gap:8px}
.logo-preview{width:140px;height:100px;border-radius:8px;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#fff,#f7f7ff);color:#666;font-weight:700}
.file-btn{background:var(--btn);color:#fff;padding:8px 10px;border-radius:8px;border:none;cursor:pointer;font-weight:700}
.kv{font-weight:700;color:var(--text);font-size:13px;display:block;margin-bottom:6px}
.input{padding:10px 12px;border-radius:10px;border:1px solid var(--border);height:44px;width:100%}
.input:focus{outline:2px solid rgba(51,54,253,0.12);border-color:var(--btn)}
.info-block{width:100%}
.row-3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;align-items:center;margin-bottom:10px}
.row-4{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;align-items:center}
.mt-8{margin-top:10px}
.logo-actions{display:flex;gap:8px;align-items:center}

/* Marks table */
.marks-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:10px}
table.marks{width:100%;border-collapse:collapse;font-size:13px}
table.marks th, table.marks td{border:1px solid #cfcfe6;padding:6px;text-align:center;vertical-align:middle}
table.marks th{background:#f8f9ff;font-weight:800;color:var(--text)}
.term-header{background:#e9f6f6}
.sub-input{width:100%;padding:6px;border:none;background:transparent;text-align:left;font-weight:600}
.num-input{width:76px;padding:6px;border-radius:8px;border:1px solid var(--border);text-align:center}
.num-input.error{border-color:#ff4747;background:#ffefef}
.add-sub{background:transparent;border:2px dashed var(--border);padding:8px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;gap:8px;font-weight:700}
.marks-actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px;gap:10px}
.controls{display:flex;gap:10px;flex-wrap:wrap}
.left-actions{display:flex;gap:8px;align-items:center}

/* divider */
.divider{height:12px}

/* sub-cards (Extra & Personality) */
.sub-card{background:#fcfeff;border:1px solid #eef5f5;padding:12px;border-radius:10px;margin-top:8px}
.sub-title{font-weight:700;color:#2c6f6f;margin-bottom:8px}

/* simple manual grade table */
.simple-table{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:8px}
.simple-table th, .simple-table td{border:1px solid #e6eef0;padding:8px;text-align:left}
.simple-table th{background:#f6fbfb;text-align:center}
.manual-grade{width:100%;padding:6px;border-radius:6px;border:1px solid var(--border);height:36px}

/* Grade legend */
/* ============ Grade Section ============ */
.grade-card {
  background: #f9faff;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  padding: 22px 26px;
  margin-top: 30px;
  font-family: "Nunito", sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.grade-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a2b48;
  margin-bottom: 12px;
}

.grade-row {
  margin-bottom: 18px;
}

.grade-row h4 {
  color: #115982;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  border-left: 4px solid #38b6ff;
  padding-left: 10px;
}

.grade-set {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid #e3ebf3;
}

.grade-set span {
  font-size: 14px;
  color: #2d3e50;
  display: inline-block;
  white-space: nowrap;
}

.grade-set b {
  color: #1a2b48;
  font-weight: 700;
}

/* Responsive tweak */
@media (max-width: 768px) {
  .grade-set {
    flex-direction: column;
    gap: 6px;
  }
}

/* Grades */
.grades-area{padding:8px}
.grades-table{width:100%;border-collapse:collapse}
.grades-table td, .grades-table th{border:1px solid var(--border);padding:10px;text-align:center}
.grades-table td[contenteditable]{background:#fff;border-radius:6px}
.grades-controls{display:flex;gap:10px;justify-content:center;margin-top:12px}
.del-grade{background:#fff;border:1px solid var(--border);padding:6px;border-radius:6px;cursor:pointer}

/* preview */
#preview{padding:16px;border:1px dashed var(--border);border-radius:12px;background:#fff}
.preview-section-title{font-weight:700;margin:8px 0}

/* signs */
.signs{display:flex;gap:20px;justify-content:space-between;margin-top:18px}
.sign-box{flex:1;text-align:center}
.sign-line{height:2px;background:#222;margin:40px auto 8px;width:220px}

/* responsiveness */
@media(max-width:1000px){
  .school-grid{grid-template-columns:1fr;gap:12px}
  .row-3{grid-template-columns:1fr; }
  .row-4{grid-template-columns:1fr 1fr; }
  .logo-preview{width:100%;height:120px}
}
@media(max-width:600px){
  .row-4{grid-template-columns:1fr}
  .num-input{width:60px}
  .legend-grid{grid-template-columns:repeat(2,1fr)}
}
/* top action buttons layout */
.top-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 30px;
  flex-wrap: wrap;
}

/* general button style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
}

/* primary blue buttons */
.btn.primary {
  background: #3236FD;
  color: #fff;
  border: none;
  padding: 10px 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn.primary:hover {
  background: #1e22d0;
}

/* delete button (danger style) */
.btn.danger {
  background: #FFE6E6;
  color: #B30000;
  border: 1px solid #ffcccc;
  padding: 10px 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn.danger:hover {
  background: #ffcccc;
}

/* icons alignment if used */
.btn svg {
  margin-right: 6px;
}
/* bottom action buttons layout */
.bottom-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 35px 0;
  flex-wrap: wrap;
}

.bottom-actions .btn {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  padding: 10px 22px;
  transition: all 0.25s ease;
}

/* same color logic as top buttons */
.bottom-actions .btn.primary {
  background: #3236FD;
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bottom-actions .btn.primary:hover {
  background: #1e22d0;
}

.bottom-actions .btn.danger {
  background: #FFE6E6;
  color: #B30000;
  border: 1px solid #ffcccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.bottom-actions .btn.danger:hover {
  background: #ffcccc;
}
/* === Arabic Section Unified Styling === */
#arabicBody td {
  padding: 6px;
  border: 1px solid #cfcfe6;
  text-align: center;
  vertical-align: middle;
}

/* Match subject name cell look */
#arabicBody .sub-input[readonly] {
  background: transparent;
  border: none;
  text-align: left;
  font-weight: 600;
  color: #222;
  width: 100%;
  padding: 6px;
}

/* Match marks input */
#arabicBody .num-input {
  width: 76px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #dcdff4;
  text-align: center;
  background: #fff;
  font-weight: 600;
  box-sizing: border-box;
  color: #333;
  transition: all 0.2s ease;
}

/* Match grade fields look */
#arabicBody .grade {
  width: 76px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #dcdff4;
  text-align: center;
  background: #f8f9ff;
  font-weight: 700;
  color: #1a1b40;
  box-sizing: border-box;
}

/* Arabic Section separator */
.arabic-sep td {
  background: #f1edff;
  color: #1a1b40;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  padding: 10px;
  border-top: 2px solid #dcdff4;
  border-bottom: 2px solid #dcdff4;
}

/* Hover and focus feel same as academic */
#arabicBody .num-input:focus {
  outline: 2px solid rgba(71, 75, 255, 0.2);
  border-color: var(--btn);
}

#arabicBody tr:hover td {
  background: #fafaff;
}

/* === Academic Section Buttons === */
.academic-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: flex-end;
}

.btn {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.add-btn {
  background: #eaf7ff;
  color: #0066cc;
  border-color: #b5ddff;
}

.add-btn:hover {
  background: #d7efff;
}

.clear-btn {
  background: #ffeaea;
  color: #d60000;
  border-color: #ffcaca;
}

.clear-btn:hover {
  background: #ffdede;
}

/* === Delete Subject Button === */
.subject-cell {
  position: relative;
  width: 200px !important; /* Increased width for full subject name visibility */
  min-width: 180px;
  max-width: 220px;
  white-space: normal;      /* Allow wrapping for longer names */
  word-wrap: break-word;
}

.sub-input {
  width: 100%;
  max-width: 200px;
  font-size: 14px;
  padding: 4px 6px;
  text-align: left;
  border-radius: 6px;
}

/* Delete button */
.del-row-btn {
  position: absolute;
  right: 6px;
  top: 4px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.del-row-btn:hover {
  color: #ff3b3b;
  transform: scale(1.1);
}

.btn.add-btn {
  margin-right: 10px;
}


.del-row-btn {
  position: absolute;
  right: 6px;
  top: 4px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.del-row-btn:hover {
  color: #ff3b3b;
  transform: scale(1.1);
}
.btn.add-btn {
  margin-right: 10px;
}
/* ========== CCE Info Section Styling ========== */
.cce-info-section {
  background: #f9fbff;
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-top: 50px;
  font-family: 'Nunito', sans-serif;
  color: #1A2B48;
}

.cce-container {
  max-width: 900px;
  margin: 0 auto;
}

.cce-info-section h2 {
  font-size: 26px;
  color: #115982;
  margin-bottom: 10px;
  text-align: center;
}

.cce-info-section h3 {
  font-size: 20px;
  color: #1A2B48;
  margin-top: 30px;
  border-left: 4px solid #38B6FF;
  padding-left: 10px;
}

.cce-info-section p {
  font-size: 15px;
  margin-bottom: 10px;
}

.cce-step {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 15px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.cce-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cce-step .icon {
  font-size: 20px;
  color: #38B6FF;
  margin-right: 10px;
}

.cce-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cce-list li {
  margin: 8px 0;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.cce-list li strong {
  color: #115982;
}

.faq {
  margin-top: 20px;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
  padding: 14px 18px;
  background: #fff;
}

.faq h4 {
  font-size: 16px;
  color: #115982;
  margin-bottom: 5px;
}

@media (max-width: 768px) {
  .cce-info-section {
    padding: 25px 15px;
  }
  .cce-info-section h2 {
    font-size: 22px;
  }
  .cce-info-section h3 {
    font-size: 18px;
  }
  .cce-step {
    font-size: 14px;
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ====================== FOOTER ====================== */
.footer {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #4c4e70;
  padding: 24px 10px 35px;
  background: #f9faff;
  border-top: 1px solid #e4e8f7;
  margin-top: 60px;
  letter-spacing: 0.2px;
}

.footer .heart {
  color: #ff4d6d;
  font-size: 16px;
  display: inline-block;
  transform: scale(1);
  animation: pulse 1.5s infinite ease-in-out;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.footer-name {
  font-weight: 700;
  color: #115982;
  transition: all 0.3s ease;
}

.footer-name:hover {
  color: #38B6FF;
  text-shadow: 0 0 6px rgba(56, 182, 255, 0.5);
  cursor: pointer;
}
