/* Öğrenci Kart — Dijital Araçlar bileşenleri.
   Sayfa iskeleti (üst/alt bölüm, yazı tipi, renk değişkenleri) Portal'ın assets/css/styles.css dosyasından gelir;
   bu dosya yalnız araç içeriğini (paneller, düğmeler, listeler) biçimler ve Portal'ın değişkenlerini KULLANIR, değiştirmez. */
.ak-main { --red-700: #a8341f; --red-50: #fdecea; padding: 32px 0 56px; }
.ak-main [hidden] { display: none !important; }
.ak-main .breadcrumb { margin: 0 0 20px; }
.ak-main .portal-intro { margin: 0 0 22px; }
.ak-main .portal-intro-title { font-size: clamp(28px, 6.4vw, 34px); }
.ak-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ak-trust { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.ak-trust li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; color: var(--green-700); background: var(--green-50); border-radius: 999px; font-size: 13px; font-weight: 600; }
.ak-trust li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Paneller */
.ak-panel { margin: 0 0 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.ak-panel h2 { margin: 0 0 10px; color: var(--navy); font-size: 16px; }
.ak-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ak-panel__head h2 { margin: 0; }

/* Yükleme alanı */
.ak-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; text-align: center; background: var(--canvas); border: 2px dashed var(--line-strong); border-radius: var(--r-md); transition: border-color .15s, background .15s; }
.ak-drop.is-over { border-color: var(--green); background: var(--green-50); }
.ak-drop__icon { width: 40px; height: 40px; color: var(--navy-600); }
.ak-drop strong { color: var(--navy); font-size: 16px; }
.ak-drop__hint { margin: 0; color: var(--muted); font-size: 13px; }
.ak-drop__desk { display: none; }
@media (hover: hover) and (pointer: fine) { .ak-drop__desk { display: inline; } }

/* Düğmeler */
.ak-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; color: var(--navy); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.ak-btn:hover { background: var(--surface-2); }
.ak-btn--primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.ak-btn--primary:hover { background: var(--navy-900); }
.ak-btn--download { color: #fff; background: var(--green-700); border-color: var(--green-700); min-height: 54px; font-size: 17px; width: 100%; }
.ak-btn--download:hover { background: #1b6214; }
.ak-btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.ak-btn:disabled, .ak-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.ak-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ak-actions .ak-btn--primary { flex: 1 1 220px; }

/* Mesajlar */
.ak-error { margin: 12px 0 0; padding: 11px 14px; color: var(--red-700); background: var(--red-50); border: 1px solid #f3c4bc; border-radius: var(--r-sm); font-size: 14px; white-space: pre-line; }
.ak-note { margin: 10px 0 0; padding: 11px 14px; color: var(--amber-700); background: var(--amber-50); border: 1px solid #f1deae; border-radius: var(--r-sm); font-size: 14px; }
.ak-info { margin: 10px 0 0; padding: 11px 14px; color: var(--navy-600); background: var(--surface-2); border-radius: var(--r-sm); font-size: 14px; }
.ak-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* Dosya listesi */
.ak-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ak-row { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.ak-row.is-drag { opacity: .45; }
.ak-row.is-target { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-50); }
.ak-row__num { flex: none; width: 22px; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.ak-row__thumb { flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.ak-row__thumb canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.ak-row__text { flex: 1 1 auto; min-width: 0; }
.ak-row__name { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ak-row__meta { display: block; color: var(--muted); font-size: 12px; }
.ak-row__actions { flex: none; display: flex; gap: 4px; }
.ak-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--navy); background: var(--surface-2); border: 0; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ak-icon-btn:hover { background: var(--line); }
.ak-icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.ak-icon-btn--danger { color: var(--red-700); }
.ak-icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 480px) {
  .ak-row { flex-wrap: wrap; }
  .ak-row__actions { width: 100%; justify-content: flex-end; }
  .ak-row__num { display: none; }
}

/* Seçenekler */
.ak-fields { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ak-fields { grid-template-columns: repeat(2, 1fr); } }
.ak-field label, .ak-field > span.ak-label { display: block; margin-bottom: 5px; color: var(--ink); font-size: 14px; font-weight: 600; }
.ak-field select, .ak-field input[type="number"], .ak-field input[type="text"] { width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.ak-field input[type="range"] { width: 100%; accent-color: var(--navy); height: 32px; }
.ak-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.ak-seg label { position: relative; flex: 1 1 94px; margin: 0; }
.ak-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.ak-seg span { display: block; padding: 10px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm); text-align: center; font-size: 14px; font-weight: 600; cursor: pointer; }
.ak-seg small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.ak-seg input:checked + span { color: var(--navy); background: #eaf0fb; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.ak-seg input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }
.ak-seg input:disabled + span { opacity: .45; cursor: not-allowed; }
.ak-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ak-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.ak-details summary { cursor: pointer; color: var(--navy-600); font-weight: 600; font-size: 14px; padding: 6px 0; }

/* İlerleme */
.ak-progress { margin-top: 14px; }
.ak-progress__track { height: 10px; overflow: hidden; background: var(--surface-2); border-radius: 999px; }
.ak-progress__bar { height: 100%; width: 0; background: var(--green); transition: width .15s; }
.ak-progress__text { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Sonuç */
.ak-result { border-color: #bfe3b7; background: #fbfef9; }
.ak-result__grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .ak-result__grid { grid-template-columns: 200px 1fr; } }
.ak-result__preview { display: grid; place-items: center; min-height: 140px; padding: 8px; background: var(--surface-2); border-radius: var(--r-md); }
.ak-result__preview canvas { max-width: 100%; height: auto; box-shadow: var(--sh-2); background: #fff; }
.ak-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0 0 12px; }
.ak-stat { padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ak-stat dt { margin: 0; color: var(--muted); font-size: 12px; }
.ak-stat dd { margin: 0; color: var(--navy); font-size: 18px; font-weight: 800; }
.ak-stat--good dd { color: var(--green-700); }

/* Fotoğraf düzenleyici */
.ak-editor { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .ak-editor { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); align-items: start; } }
.ak-stage { position: relative; display: grid; place-items: center; min-height: 240px; padding: 10px; background: #e9edf3; border-radius: var(--r-md); overflow: hidden; touch-action: pan-y; }
.ak-stage__box { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; }
.ak-stage canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; background: repeating-conic-gradient(#fff 0 25%, #eef1f6 0 50%) 0 / 16px 16px; }
.ak-crop { position: absolute; inset: 0; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(7, 29, 66, .55), 0 0 0 1px rgba(0, 0, 0, .35); cursor: move; touch-action: none; }
.ak-crop::before, .ak-crop::after { content: ""; position: absolute; pointer-events: none; background: rgba(255, 255, 255, .45); }
.ak-crop::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-inline: 1px solid rgba(255, 255, 255, .45); background: none; }
.ak-crop::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-block: 1px solid rgba(255, 255, 255, .45); background: none; }
.ak-handle { position: absolute; width: 30px; height: 30px; margin: -15px; touch-action: none; z-index: 2; }
.ak-handle::after { content: ""; position: absolute; inset: 6px; background: #fff; border: 2px solid var(--navy); border-radius: 50%; }
.ak-handle--nw { left: 0; top: 0; cursor: nwse-resize; } .ak-handle--ne { left: 100%; top: 0; cursor: nesw-resize; }
.ak-handle--sw { left: 0; top: 100%; cursor: nesw-resize; } .ak-handle--se { left: 100%; top: 100%; cursor: nwse-resize; }
.ak-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.ak-tools > .ak-panel { margin-bottom: 12px; }
.ak-dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.ak-dims__x { padding-bottom: 12px; color: var(--muted); }

/* Yardımcılar */
.ak-mt8 { margin-top: 8px; } .ak-mt10 { margin-top: 10px; } .ak-mt12 { margin-top: 12px; }
.ak-label-h { margin: 14px 0 8px !important; font-size: 14px !important; color: var(--ink) !important; }
input.ak-sr:focus-visible + .ak-btn { outline: 3px solid var(--navy); outline-offset: 2px; }
.is-busy { opacity: .6; pointer-events: none; }
.ak-details { margin-top: 12px; }
.ak-details .ak-check { margin-top: 6px; }

/* Telefonda önizleme, ayarlar değiştirilirken ekranda sabit kalsın */
@media (max-width: 899px) {
  .ak-editor { display: block; }
  .ak-editor > div:first-child { position: sticky; top: var(--header-height); z-index: 6; margin-bottom: 12px; }
  .ak-editor > div:first-child .ak-panel { margin-bottom: 0; padding: 10px; box-shadow: var(--sh-2); }
  .ak-stage { min-height: 140px; padding: 6px; }
  .ak-stage canvas { max-height: 34vh; }
  .ak-editor .ak-help, .ak-editor .ak-note { margin-top: 6px; }
}
@media (max-width: 899px) { html:has(#editor:not([hidden])) { scroll-padding-top: calc(var(--header-height) + 34vh + 48px); } }
@media (min-width: 900px) { .ak-editor > div:first-child { position: sticky; top: calc(var(--header-height) + 12px); } }
