/* =====================================================================
   PDF Düzenleme Stüdyosu — profesyonel editör görünümü
   studio.css temel alınır; bu dosya düzenlemeye özel katmanı tanımlar.
   ===================================================================== */

/* ---------- genel ---------- */
.editor-shell {
  --rail-w: 232px;
  --panel-w: 306px;
  --canvas-bg: #4b4f55;
  --canvas-bg-2: #3f4348;
  --paper-shadow: 0 2px 6px rgba(0, 0, 0, .22), 0 18px 48px -18px rgba(0, 0, 0, .55);
  background: var(--s-bg);
}

.editor-shell .studio-body-grid {
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--panel-w);
}

/* ---------- üst çubuk ---------- */
.editor-shell .studio-topbar {
  background: linear-gradient(180deg, #151c29, #0b1220);
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
  gap: 12px;
}

.editor-shell .studio-brand__mark {
  background: linear-gradient(150deg, #e0403f, #a3161d);
  box-shadow: 0 4px 12px -4px rgba(224, 45, 45, .75);
}

.editor-shell .studio-title__input {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
  font-weight: 600;
}

.editor-shell .studio-title__input:hover { background: rgba(255, 255, 255, .1); }
.editor-shell .studio-title__input:focus {
  background: rgba(255, 255, 255, .14);
  outline: 2px solid rgba(255, 143, 143, .7);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
}

.action-group .sbtn {
  background: transparent;
  border-color: transparent;
  min-height: 30px;
}

.action-group .sbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.action-group .sbtn:disabled { opacity: .32; }

.editor-shell .sbtn--primary {
  background: linear-gradient(180deg, #d8322f, #b3171d);
  box-shadow: 0 6px 16px -8px rgba(224, 45, 45, .95), 0 1px 0 rgba(255, 255, 255, .16) inset;
  font-weight: 700;
  padding-inline: 18px;
}

.editor-shell .sbtn--primary:hover:not(:disabled) { background: linear-gradient(180deg, #e63c38, #c01a20); }

/* ---------- başlangıç ekranı ---------- */
.editor-drop {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(20px, 4vw, 56px) var(--space-5);
  background:
    radial-gradient(820px 420px at 18% -12%, rgba(200, 31, 38, .13), transparent 62%),
    radial-gradient(700px 380px at 92% 4%, rgba(29, 78, 216, .10), transparent 60%),
    linear-gradient(180deg, #f7f9fc, #eef2f7);
}

.editor-drop__inner { width: 100%; max-width: 700px; }

.editor-drop__card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(26px, 3.4vw, 48px);
  text-align: center;
  background: #fff;
  border: 1px solid var(--s-line);
  border-radius: 22px;
  box-shadow: 0 2px 4px rgba(11, 18, 32, .04), 0 40px 90px -60px rgba(11, 18, 32, .55);
}

.drop-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--s-brand);
  background: var(--s-brand-soft);
  border: 1px solid #fecaca;
  border-radius: 999px;
}

.editor-drop__card h1 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.95rem);
  letter-spacing: -.02em;
  color: var(--s-ink);
}

.editor-drop__lead {
  margin: 0;
  max-width: 46ch;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--s-ink-3);
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: clamp(22px, 3vw, 36px) 20px;
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc);
  border: 2px dashed #cfd8e6;
  border-radius: 16px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone.is-dragover {
  border-color: var(--s-brand);
  background: var(--s-brand-soft);
  transform: scale(1.006);
}

.drop-zone__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #fff;
  color: var(--s-brand);
  box-shadow: 0 6px 18px -8px rgba(11, 18, 32, .35);
}

.drop-zone__icon svg { width: 24px; height: 24px; }
.drop-zone__hint { margin: 2px 0 0; font-size: .82rem; color: var(--s-ink-2); }
.drop-zone__meta { margin: 0; font-size: .72rem; color: var(--s-ink-3); }

.editor-drop__progress {
  display: grid;
  gap: 7px;
  width: 100%;
  max-width: 340px;
  margin-top: 4px;
}

.progress-track {
  height: 7px;
  background: #e8eef6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e0403f, #b3171d);
  border-radius: 999px;
  transition: width 260ms ease;
}

.progress-text { font-size: .74rem; color: var(--s-ink-3); }

.editor-drop__progress[hidden] { display: none; }
.editor-drop[hidden] { display: none; }

.drop-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.drop-features li {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 12px;
  background: #f8fafd;
  border: 1px solid var(--s-line);
  border-radius: 11px;
}

.drop-features svg {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  color: var(--s-brand);
  margin-top: 2px;
}

.drop-features strong { font-size: .78rem; color: var(--s-ink); }
.drop-features span { font-size: .72rem; color: var(--s-ink-3); line-height: 1.45; }

/* ---------- sol ray ---------- */
.editor-shell .studio-rail {
  background: #fff;
  border-right: 1px solid var(--s-line);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.rail-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--s-line);
}

.rail-tabs__title {
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--s-ink-3);
}

.tool-groups {
  display: grid;
  gap: 8px;
  padding: 9px 9px 10px;
  border-bottom: 1px solid var(--s-line);
  overflow-y: auto;
  scrollbar-width: thin;
  min-height: 0;
}

.tool-group { display: grid; gap: 4px; }

.tool-group__label {
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9aa8bc;
  padding-left: 3px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.editor-shell .tool-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 5px 2px;
  font: inherit;
  font-size: .56rem;
  font-weight: 650;
  color: var(--s-ink-2);
  background: #fbfcfe;
  border: 1px solid var(--s-line);
  border-radius: 7px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.editor-shell .tool-btn:hover {
  background: #f2f6fb;
  border-color: var(--s-line-2);
  transform: translateY(-1px);
}

.editor-shell .tool-btn.is-active {
  color: var(--s-brand);
  background: var(--s-brand-soft);
  border-color: #f8b4b4;
  box-shadow: 0 0 0 2px rgba(200, 31, 38, .10);
}

.tool-btn__icon { display: grid; place-items: center; }
.tool-btn__icon svg { width: 15px; height: 15px; }
.tool-btn__label { line-height: 1; }

/* ---------- sayfa listesi ---------- */
.editor-shell .studio-pages {
  min-height: 0;
  background: #f7f9fc;
}

.editor-shell .studio-pages__head {
  padding: 9px 10px;
  background: #fff;
  border-bottom: 1px solid var(--s-line);
}

.pages-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--s-ink-3);
}

.pages-title em {
  font-style: normal;
  padding: 1px 6px;
  font-size: .62rem;
  color: var(--s-ink-2);
  background: #eef2f7;
  border-radius: 999px;
}

.editor-shell .page-list {
  gap: 10px;
  padding: 10px;
}

.editor-shell .page-item {
  padding: 7px;
  background: #fff;
  border: 1.5px solid var(--s-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .05);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.editor-shell .page-item:hover {
  border-color: var(--s-line-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -12px rgba(11, 18, 32, .5);
}

.editor-shell .page-item.is-active {
  border-color: var(--s-brand);
  box-shadow: 0 0 0 3px rgba(200, 31, 38, .13);
}

.editor-shell .page-item img {
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(11, 18, 32, .14);
}

.editor-shell .page-item__label {
  padding: 3px 2px 0;
  font-size: .62rem;
  color: var(--s-ink-3);
}

.editor-shell .page-item__label strong { color: var(--s-ink); }

/* ---------- tuval ---------- */
.editor-shell .studio-stage {
  grid-template-rows: 40px minmax(0, 1fr);
  background: var(--canvas-bg);
  position: relative;
}

.editor-shell .studio-stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  background: #232a36;
  border-bottom: 1px solid #000;
  color: #c3ccda;
}

.stage-left, .stage-right { display: flex; align-items: center; gap: 6px; }

.stage-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, .14);
  margin: 0 2px;
}

.editor-shell .stage-hint {
  font-size: .7rem;
  color: #97a3b6;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-shell .studio-stage__bar .icon-btn {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
  color: #d5dce8;
  font-size: .8rem;
}

.editor-shell .studio-stage__bar .icon-btn:hover {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .2);
}

.editor-shell .studio-stage__bar .switch { color: #c3ccda; font-size: .7rem; }
.editor-shell .studio-stage__bar .switch input { accent-color: #e0403f; }

.editor-shell .canvas-wrap {
  background:
    radial-gradient(900px 520px at 50% 0%, rgba(255, 255, 255, .06), transparent 70%),
    var(--canvas-bg);
  padding: 26px;
  place-items: start center;
}

.editor-shell .canvas-holder {
  background: #fff;
  box-shadow: var(--paper-shadow);
  border-radius: 2px;
  line-height: 0;
}

.editor-shell #studio-canvas {
  display: block;
  border-radius: 2px;
  cursor: default;
}

.editor-shell .canvas-wrap[data-tool="text"] #studio-canvas { cursor: text; }
.editor-shell .canvas-wrap[data-tool="highlight"] #studio-canvas,
.editor-shell .canvas-wrap[data-tool="underline"] #studio-canvas,
.editor-shell .canvas-wrap[data-tool="strike"] #studio-canvas,
.editor-shell .canvas-wrap[data-tool="rect"] #studio-canvas { cursor: crosshair; }
.editor-shell .canvas-wrap[data-tool="freehand"] #studio-canvas { cursor: crosshair; }
.editor-shell .canvas-wrap[data-tool="note"] #studio-canvas { cursor: copy; }

/* yüzen çubuklar */
.float-bar, .page-nav {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(20, 26, 36, .93);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .9);
  backdrop-filter: blur(8px);
}

.float-bar { left: 16px; bottom: 16px; }
.page-nav { left: 50%; bottom: 16px; transform: translateX(-50%); }

.float-btn {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  color: #d5dce8;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.float-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.float-btn--text { font-size: .68rem; }

.float-label {
  min-width: 44px;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: #e6ecf7;
  font-variant-numeric: tabular-nums;
}

.float-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, .16); margin: 0 3px; }

.page-nav__text {
  padding: 0 6px;
  font-size: .7rem;
  color: #97a3b6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page-nav__text strong { color: #fff; }

.stage-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(340px, 44%);
  padding: 5px 11px;
  font-size: .66rem;
  color: #c3ccda;
  background: rgba(20, 26, 36, .9);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-badge__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, .8);
}

/* ---------- yetenek şeridi ---------- */
.cap-bar {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(720px, calc(100% - 32px));
  padding: 8px 12px;
  font-size: .74rem;
  line-height: 1.5;
  color: #dbe6f5;
  background: rgba(20, 26, 36, .95);
  border: 1px solid rgba(96, 165, 250, .3);
  border-radius: 11px;
  box-shadow: 0 16px 40px -22px rgba(0, 0, 0, .95);
  backdrop-filter: blur(8px);
}

.cap-bar strong { color: #fff; }

.cap-bar__icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 800;
  font-style: italic;
  color: #93c5fd;
  border: 1.5px solid #93c5fd;
  border-radius: 50%;
}

.cap-bar__close {
  margin-left: 4px;
  padding: 0 3px;
  font-size: .8rem;
  color: #94a3b8;
  background: transparent;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.cap-bar__close:hover { color: #fff; }
.cap-bar[hidden] { display: none !important; }

/* ---------- sağ panel ---------- */
.editor-shell .studio-panel { background: #fff; }

.editor-shell .panel-tabs {
  background: #f7f9fc;
  border-bottom: 1px solid var(--s-line);
}

.editor-shell .panel-tab {
  font-size: .72rem;
  letter-spacing: .02em;
}

.editor-shell .panel-tab.is-active {
  background: #fff;
  border-bottom-color: var(--s-brand);
  color: var(--s-ink);
}

.editor-shell .panel-body { padding: 12px; background: #fff; }

.editor-shell .panel-title {
  font-size: .62rem;
  letter-spacing: .09em;
  color: #9aa8bc;
  margin-bottom: 9px;
}

.editor-shell .panel-section {
  padding-bottom: 13px;
  margin-bottom: 13px;
  border-bottom: 1px dashed var(--s-line);
}

.editor-shell .panel-field > span { font-size: .64rem; color: #8b99ad; }
.editor-shell .panel-field .input,
.editor-shell .panel-field .select,
.editor-shell .panel-field textarea { min-height: 31px; font-size: .78rem; }

.editor-shell .panel-empty {
  padding: 26px 10px;
  font-size: .76rem;
  line-height: 1.7;
  color: var(--s-ink-3);
}

.editor-shell .layer-item {
  padding: 6px 7px;
  font-size: .76rem;
}

.editor-shell .layer-item.is-active {
  border-color: var(--s-brand);
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(200, 31, 38, .08);
}

/* ---------- durum çubuğu ---------- */
.editor-shell .studio-statusbar {
  background: #171e2a;
  border-top: 1px solid #000;
  color: #8b99ad;
  font-size: .66rem;
}

/* ---------- modallar ---------- */
.editor-shell ~ .smodal,
.smodal {
  border-radius: 16px;
}

.smodal__note {
  margin: 0 0 4px;
  padding: 9px 11px;
  font-size: .74rem;
  line-height: 1.55;
  color: #4b5b73;
  background: #f5f8fc;
  border: 1px solid var(--s-line);
  border-radius: 9px;
}

.smodal__note--warn {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.smodal__tabs {
  margin: -4px -16px 16px;
  padding: 0 16px;
}

.color-input {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--s-line-2);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.sig-tabs { display: flex; gap: 6px; margin-bottom: 12px; }

.sig-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 220;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, #f1f5f9 0 1px, transparent 1px 26px);
  border: 1.5px dashed var(--s-line-2);
  border-radius: 10px;
  touch-action: none;
  cursor: crosshair;
}

.sig-canvas:focus-visible { outline: 3px solid var(--s-accent); outline-offset: 2px; }

.export-ready {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
}

.export-ready strong { color: #047857; font-size: .95rem; }
.export-ready p { margin: 0; font-size: .8rem; color: #065f46; }
.export-error { padding: 13px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 11px; color: #b91c1c; font-size: .82rem; }
.export-warn { margin-top: 8px; padding: 9px 11px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; color: #b45309; font-size: .74rem; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .editor-shell { --rail-w: 208px; --panel-w: 274px; }
}

@media (max-width: 900px) {
  .editor-shell .studio-body-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .editor-shell .studio-rail {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--s-line);
  }

  .rail-tabs { display: none; }

  .tool-groups {
    display: flex;
    gap: 8px;
    border-bottom: 0;
    border-right: 1px solid var(--s-line);
    max-height: none;
    overflow: visible;
    padding: 8px;
    flex-shrink: 0;
  }

  .tool-group { min-width: 108px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .editor-shell .studio-pages { min-width: 0; flex: 1; }
  .editor-shell .studio-pages__head { display: none; }
  .editor-shell .page-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
  }
  .editor-shell .page-item { width: 82px; flex-shrink: 0; }
  .editor-shell .page-item__label { display: none; }

  .float-bar { left: 10px; bottom: 10px; }
  .page-nav { bottom: 10px; }
  .stage-badge { display: none; }
  .editor-shell .stage-hint { display: none; }
  .editor-drop__card { padding: 24px 18px; border-radius: 18px; }
}

@media (max-width: 700px) {
  .editor-shell { grid-template-rows: auto minmax(0, 1fr) var(--s-status); }

  .editor-shell .studio-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 6px 8px;
    padding: 7px 8px;
  }

  .editor-shell .studio-brand { grid-column: 1; grid-row: 1; }
  .editor-shell .studio-title { grid-column: 2; grid-row: 1; min-width: 0; }
  .editor-shell .studio-title__input { width: 100%; }
  .editor-shell .studio-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 5px;
    scrollbar-width: none;
  }
  .editor-shell .studio-actions > * { flex-shrink: 0; }
  .editor-shell .studio-save { display: none; }

  .drop-features { grid-template-columns: 1fr; }
  .editor-shell .canvas-wrap { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
