/* NASAQ EDU · Zoom Background Studio — interface (the backgrounds themselves follow the academy's own colors) */
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(fonts/Tajawal-500.woff) format("woff"); }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(fonts/Tajawal-700.woff) format("woff"); }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(fonts/Tajawal-800.woff) format("woff"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(fonts/Montserrat-700.woff) format("woff"); }
:root {
  --green: #0F5132; --green-2: #1B6B45; --cream: #FFF7E0; --yellow: #FFC233; --paper: #FFFFFF; --ink: #22312A; --muted: #5F6B63;
  --line: rgba(15, 81, 50, .13); --line-2: rgba(15, 81, 50, .24); --danger: #B4442E;
  --shadow: 0 1px 2px rgba(15, 81, 50, .06), 0 14px 30px -20px rgba(15, 81, 50, .5);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 500 15px/1.55 Tajawal, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { font-family: Tajawal, Montserrat, "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* header */
.top { background: var(--green); color: var(--cream); }
.top-in { max-width: 1560px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brandmark { flex: none; width: 112px; aspect-ratio: 1254 / 560; overflow: hidden; border-radius: 14px; display: block; background: #01553D; }
.brandmark img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; display: block; }
.titles { min-width: 0; flex: 1; }
.titles h1 { font: 800 22px/1.25 Tajawal, sans-serif; }
.titles p { color: #CFE3D6; font-weight: 600; font-size: 14px; }
.langbtn { flex: none; border: 1.5px solid rgba(255, 247, 224, .5); background: transparent; color: var(--cream); border-radius: 999px; padding: 8px 16px; font-weight: 800; min-height: 42px; }
.langbtn:hover { background: rgba(255, 247, 224, .1); }

/* layout */
.app { max-width: 1560px; margin: 0 auto; padding: 18px 20px 26px; display: grid; grid-template-columns: 330px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.stage { display: grid; gap: 16px; min-width: 0; }
.step { display: flex; align-items: center; gap: 10px; font: 800 17px/1.3 Tajawal, sans-serif; color: var(--green); }
.step span { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--green); display: grid; place-items: center; font: 800 16px/1 Montserrat, Tajawal, sans-serif; flex: none; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.card h3 { font: 800 16px/1.3 Tajawal, sans-serif; color: var(--green); }
.field, .fld { display: grid; gap: 6px; }
.lbl, .fld > span, .rng > span { font-weight: 800; font-size: 14px; color: var(--green); }
.hint { font-size: 13px; color: var(--muted); }
.hint.center { text-align: center; }
.note { font-size: 13px; color: #2F4A22; background: rgba(167, 201, 87, .18); border-radius: 14px; padding: 10px 12px; font-weight: 600; }
.input { width: 100%; min-height: 44px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 8px 12px; background: #FFFDF8; }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(15, 81, 50, .12); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 160px; }
.row.wrap > .btn { flex: 1 1 140px; }
.btn { min-height: 46px; padding: 0 16px; border-radius: 14px; border: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 15px; text-decoration: none; transition: transform .12s, background-color .15s; user-select: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.98); }
.btn.sm { min-height: 40px; font-size: 14px; padding: 0 12px; border-radius: 12px; }
.btn-primary { background: var(--green); color: var(--cream); }
.btn-primary:hover { background: var(--green-2); }
.btn-yellow { background: var(--yellow); color: var(--green); }
.btn-yellow:hover { background: #F5B41F; }
.btn-ghost { background: var(--paper); color: var(--green); border-color: var(--line-2); }
.btn-ghost:hover { background: #FBF4DE; }
.btn.danger { color: var(--danger); border-color: rgba(180, 68, 46, .3); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; }

/* identity */
.logobox { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.logoprev { width: 96px; height: 96px; border-radius: 16px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; background: repeating-conic-gradient(#F3EEDF 0 25%, #FFF 0 50%) 0 0 / 16px 16px; }
.logoprev img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logoacts { display: grid; gap: 4px; justify-items: start; }
.logoacts .btn { width: 100%; }
.logobox.drag { outline: 3px dashed var(--yellow); outline-offset: 4px; border-radius: 18px; }
.colors { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: 44px 1fr 96px; gap: 10px; align-items: center; font-weight: 700; }
input[type=color] { width: 44px; height: 40px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.hex { min-height: 40px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 4px 8px; font: 700 14px/1 Montserrat, monospace; text-transform: uppercase; width: 100%; background: #FFFDF8; }
.hex.bad { border-color: var(--danger); }
.suggest { display: grid; gap: 8px; background: #FFFBEE; border: 1.5px solid rgba(255, 194, 51, .6); border-radius: 14px; padding: 10px; }
.sw { display: flex; gap: 6px; flex-wrap: wrap; }
.sw i { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(0, 0, 0, .1); display: block; }
.sw .role { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); }

/* preview */
.previewcard { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #ddd; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); touch-action: none; }
.preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#over { cursor: default; }
#over.can-drag { cursor: grab; }
#over.dragging { cursor: grabbing; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools .sp { flex: 1; }
.ibtn { min-height: 40px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; color: var(--green); display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 800; font-size: 14px; }
.ibtn svg { width: 18px; height: 18px; }
.ibtn[disabled] { opacity: .45; }
.tgl { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 36px; }
.tgl input { width: 20px; height: 20px; accent-color: var(--green); }
.warn { background: #FFF1D6; color: #6B4A00; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; background: #F4EEDC; border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 36px; padding: 0 12px; font-weight: 800; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--cream); }
.seg.sm button { min-height: 32px; padding: 0 10px; font-size: 13px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tpl { border: 2px solid var(--line); background: var(--paper); border-radius: 18px; padding: 8px; display: grid; gap: 6px; text-align: start; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tpl:hover { transform: translateY(-2px); }
.tpl[aria-checked="true"] { border-color: var(--green); box-shadow: 0 0 0 3px rgba(255, 194, 51, .7), var(--shadow); }
.tpl canvas { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; display: block; }
.tpl b { font: 800 15px/1.3 Tajawal, sans-serif; color: var(--green); }
.tpl small { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl small span { font-size: 11.5px; font-weight: 800; background: #F4EEDC; color: var(--green); border-radius: 999px; padding: 2px 8px; }

/* export */
.progress { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; }
.bar { height: 10px; background: #EEE6CF; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 6px; transition: width .2s; }
.ready { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #E8F4EC; border-radius: 14px; padding: 10px 12px; font-weight: 800; color: var(--green); }
.ready .btn { flex: none; }
.tip { font-size: 13px; color: #6B4A00; background: #FFF6DA; border-radius: 12px; padding: 8px 12px; font-weight: 600; }

/* editor */
.grp { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.grp h4, .grp summary { font: 800 15px/1.3 Tajawal, sans-serif; color: var(--green); }
details.grp > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary::after { content: "+"; font: 800 20px/1 Montserrat, sans-serif; color: var(--muted); }
details.grp[open] > summary::after { content: "−"; }
.rng { display: grid; gap: 4px; }
.rng input { width: 100%; accent-color: var(--green); }
.cpick { display: flex; gap: 8px; align-items: center; }
.chip { border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 13px; color: var(--muted); min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--green); color: var(--cream); border-color: var(--green); }

/* footer, modal, toast */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 16px 26px; }
.foot a { color: var(--green); text-decoration: none; }
.modal { position: fixed; inset: 0; background: rgba(13, 40, 26, .5); display: grid; place-items: center; padding: 16px; z-index: 60; }
.sheet { background: var(--paper); border-radius: 22px; padding: 18px; width: min(520px, 100%); max-height: 86vh; overflow: auto; display: grid; gap: 12px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.sheet h3 { color: var(--green); font: 800 18px/1.3 Tajawal, sans-serif; }
.dlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dlist li { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.dlist canvas { width: 112px; aspect-ratio: 16/9; border-radius: 8px; display: block; }
.dlist b { display: block; color: var(--green); }
.dlist small { color: var(--muted); }
.dlist .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); background: var(--green); color: var(--cream); padding: 11px 18px; border-radius: 14px; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

/* responsive */
@media (max-width: 1240px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage { grid-column: 1 / -1; order: -1; }
  .panel { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .top-in { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brandmark { width: 84px; }
  .titles h1 { font-size: 17px; }
  .titles p { font-size: 12.5px; }
  .langbtn { padding: 6px 12px; min-height: 38px; }
  .app { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 20px; gap: 14px; }
  .stage { display: contents; }
  .previewcard { position: sticky; top: 0; z-index: 20; border-radius: 0 0 18px 18px; margin: -10px -12px 0; padding: 8px 12px 8px; order: -2; }
  .previewcard .hint.center { display: none; }
  #identity { order: -1; }
  #h2s { order: 0; } .gallery { order: 0; } #editor { order: 1; } .exportcard { order: 2; } .projcard { order: 3; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tpl { padding: 5px; border-radius: 14px; }
  .tpl b { font-size: 12.5px; }
  .tpl small { display: none; }
  .tools .tgl span { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
