/* ==========================================================================
   TCR TOOLS — 3D ÖZEL TUTUCU EDİTÖRÜ (Scoped WordPress + Standalone CSS)
   Brand Tokens: #0D1D3B (TCR Navy) · #C2180F (TCR Crimson) · Barlow Condensed / Rubik
   ========================================================================== */

#tcr-holder-editor-app {
  --tcr-navy: #0D1D3B;
  --tcr-navy-dark: #06163A;
  --tcr-red: #C2180F;
  --tcr-red-dark: #9E120B;
  --tcr-ink: #0F172A;
  --tcr-muted: #475569;
  --tcr-border: #D9E2EE;
  --tcr-bg-soft: #F5F7FB;
  --tcr-white: #FFFFFF;
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--tcr-ink);
  line-height: 1.45;
  background: var(--tcr-white);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}

#tcr-holder-editor-app *,
#tcr-holder-editor-app *::before,
#tcr-holder-editor-app *::after {
  box-sizing: border-box;
}

#tcr-holder-editor-app .tcr-shell {
  width: min(1340px, calc(100% - 32px));
  margin: 0 auto;
}

#tcr-holder-editor-app .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* 1. Top Dark Engineering Banner */
#tcr-holder-editor-app .tcr-ed-bar {
  background: linear-gradient(135deg, var(--tcr-navy-dark) 0%, var(--tcr-navy) 65%, #162C59 100%);
  color: #fff;
  padding: 20px 0 18px;
  border-bottom: 3px solid var(--tcr-red);
}

#tcr-holder-editor-app .tcr-ed-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#tcr-holder-editor-app .tcr-ed-title h1 {
  font-family: "Barlow Condensed", "Rubik", sans-serif !important;
  font-size: clamp(1.8rem, 2.8vw, 2.45rem) !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05 !important;
  margin: 0 0 5px !important;
  color: #fff !important;
}

#tcr-holder-editor-app .tcr-ed-title h1 span {
  color: #FF4D42;
}

#tcr-holder-editor-app .tcr-ed-title p {
  font-size: 0.88rem !important;
  color: #CBD5E1 !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

#tcr-holder-editor-app .tcr-ed-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

#tcr-holder-editor-app .tcr-seg {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 3px;
  border-radius: 3px;
}

#tcr-holder-editor-app .tcr-seg button {
  background: transparent;
  border: 0;
  color: #CBD5E1;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.14s, color 0.14s;
}

#tcr-holder-editor-app .tcr-seg button[aria-pressed="true"] {
  background: var(--tcr-red);
  color: #fff;
  border-radius: 2px;
}

/* 2. Symmetrical 2x4 Quick Preset Strip */
#tcr-holder-editor-app .tcr-preset-strip {
  background: var(--tcr-bg-soft);
  border-bottom: 1px solid var(--tcr-border);
  padding: 12px 0;
}

#tcr-holder-editor-app .tcr-preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
}

#tcr-holder-editor-app .tcr-preset-row > .tcr-preset-lbl {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tcr-muted);
  margin-bottom: 2px;
}

#tcr-holder-editor-app .tcr-preset-btn {
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid #CBD5E1;
  color: var(--tcr-navy);
  padding: 8px 10px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  transition: border-color 0.14s, color 0.14s, background 0.14s, box-shadow 0.14s;
}

#tcr-holder-editor-app .tcr-preset-btn:hover {
  border-color: var(--tcr-red);
  color: var(--tcr-red);
  background: #FFF6F5;
}

#tcr-holder-editor-app .tcr-preset-btn.is-active {
  border-color: var(--tcr-red);
  color: var(--tcr-red);
  background: #FFF2F1;
  box-shadow: inset 0 0 0 1px var(--tcr-red);
}

/* 3. Two-Column Engineering Workbench */
#tcr-holder-editor-app .tcr-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  padding: 20px 0 42px;
  align-items: start;
}

#tcr-holder-editor-app .tcr-param-col {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

/* Human-First Direct TCR Engineer Card */
#tcr-holder-editor-app .tcr-human-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, var(--tcr-navy-dark) 0%, #152B54 100%);
  color: #fff;
  border-radius: 3px;
  padding: 13px 15px;
  border: 1px solid var(--tcr-navy);
  border-left: 4px solid var(--tcr-red);
}

#tcr-holder-editor-app .tcr-human-card img {
  width: 168px;
  height: 108px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  padding: 4px;
  display: block;
}

#tcr-holder-editor-app .tcr-human-card strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 5px;
  color: #fff;
}

#tcr-holder-editor-app .tcr-human-card p {
  margin: 0 0 9px;
  font-size: 0.78rem;
  line-height: 1.42;
  color: #CBD5E1;
}

#tcr-holder-editor-app .tcr-human-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#tcr-holder-editor-app .tcr-human-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none !important;
  line-height: 1.2;
}

#tcr-holder-editor-app .tcr-human-links a.tcr-call {
  background: var(--tcr-red);
  color: #fff !important;
}

#tcr-holder-editor-app .tcr-human-links a.tcr-call:hover {
  background: var(--tcr-red-dark);
}

#tcr-holder-editor-app .tcr-human-links a.tcr-mail {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

#tcr-holder-editor-app .tcr-human-links a.tcr-mail:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Accordion Parameter Groups */
#tcr-holder-editor-app details.tcr-param-group {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-left: 4px solid var(--tcr-navy);
  border-radius: 2px;
  min-width: 0;
}

#tcr-holder-editor-app details.tcr-param-group[open] {
  border-left-color: var(--tcr-red);
  box-shadow: 0 8px 22px rgba(13, 29, 59, 0.05);
}

#tcr-holder-editor-app details.tcr-param-group summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: "Barlow Condensed", "Rubik", sans-serif;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tcr-navy);
  user-select: none;
}

#tcr-holder-editor-app details.tcr-param-group summary::-webkit-details-marker {
  display: none;
}

#tcr-holder-editor-app details.tcr-param-group summary > span:first-child {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

#tcr-holder-editor-app .tcr-grp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--tcr-navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 2px;
}

#tcr-holder-editor-app details.tcr-param-group[open] .tcr-grp-num {
  background: var(--tcr-red);
}

#tcr-holder-editor-app .tcr-opt-tag {
  font-family: "Rubik", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: #EEF2F7;
  color: #475569;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#tcr-holder-editor-app .tcr-param-body {
  padding: 13px 15px 15px;
  border-top: 1px solid #E9EFF7;
  display: grid;
  gap: 11px;
}

#tcr-holder-editor-app .tcr-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

#tcr-holder-editor-app .tcr-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

#tcr-holder-editor-app .tcr-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#tcr-holder-editor-app .tcr-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--tcr-navy);
  margin: 0;
  line-height: 1.25;
}

#tcr-holder-editor-app .tcr-field label small {
  color: var(--tcr-muted);
  font-weight: 600;
  font-size: 0.7rem;
  white-space: nowrap;
}

#tcr-holder-editor-app .tcr-field input,
#tcr-holder-editor-app .tcr-field select,
#tcr-holder-editor-app .tcr-field textarea {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #CBD5E1;
  border-radius: 3px;
  background: #fff;
  color: var(--tcr-ink);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 36px;
  margin: 0;
  box-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tcr-holder-editor-app .tcr-field textarea {
  height: auto;
  min-height: 68px;
  padding: 8px 10px;
  resize: vertical;
}

#tcr-holder-editor-app .tcr-field input:focus,
#tcr-holder-editor-app .tcr-field select:focus,
#tcr-holder-editor-app .tcr-field textarea:focus {
  outline: none;
  border-color: var(--tcr-red);
  box-shadow: 0 0 0 2px rgba(194, 24, 15, 0.14);
}

#tcr-holder-editor-app .tcr-sanity-warn {
  display: none;
  padding: 8px 10px;
  border-radius: 3px;
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-left: 3px solid #EA580C;
  color: #9A3412;
  font-size: 0.76rem;
  font-weight: 600;
}

/* 4. Right Column: Live 3D Studio Viewport + Spec Box */
#tcr-holder-editor-app .tcr-canvas-col {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

#tcr-holder-editor-app .tcr-bp-card {
  background: #fff;
  border: 1px solid var(--tcr-navy);
  border-radius: 2px;
  box-shadow: 0 14px 34px rgba(13, 29, 59, 0.08);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

#tcr-holder-editor-app .tcr-bp-top {
  background: var(--tcr-navy);
  color: #fff;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

#tcr-holder-editor-app .tcr-bp-top strong {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E2E8F0;
}

#tcr-holder-editor-app .tcr-bp-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

#tcr-holder-editor-app .tcr-bp-tools button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 4px 8px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

#tcr-holder-editor-app .tcr-bp-tools button:hover,
#tcr-holder-editor-app .tcr-bp-tools button[aria-pressed="true"] {
  background: var(--tcr-red);
  border-color: var(--tcr-red);
}

#tcr-holder-editor-app .tcr-bp-stage {
  position: relative;
  height: 448px;
  background: #1B1E23;
  cursor: grab;
  overflow: hidden;
}

#tcr-holder-editor-app .tcr-bp-stage:active {
  cursor: grabbing;
}

#tcr-holder-editor-app .tcr-bp-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#tcr-holder-editor-app .tcr-bp-titleblock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--tcr-border);
  background: var(--tcr-bg-soft);
}

#tcr-holder-editor-app .tcr-bp-titleblock > div {
  padding: 8px 10px;
  border-right: 1px solid var(--tcr-border);
  min-width: 0;
}

#tcr-holder-editor-app .tcr-bp-titleblock > div:last-child {
  border-right: 0;
}

#tcr-holder-editor-app .tcr-bp-titleblock small {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tcr-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tcr-holder-editor-app .tcr-bp-titleblock strong {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--tcr-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Spec & Export Box */
#tcr-holder-editor-app .tcr-spec-box {
  background: var(--tcr-navy);
  color: #fff;
  padding: 18px;
  border-radius: 2px;
  min-width: 0;
}

#tcr-holder-editor-app .tcr-spec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#tcr-holder-editor-app .tcr-spec-head h2 {
  font-family: "Barlow Condensed", "Rubik", sans-serif !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 !important;
  color: #fff !important;
}

#tcr-holder-editor-app .tcr-code-badge {
  background: var(--tcr-red);
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

#tcr-holder-editor-app .tcr-spec-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  font-size: 0.78rem;
  margin: 0 0 15px;
}

#tcr-holder-editor-app .tcr-spec-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 0;
  min-width: 0;
}

#tcr-holder-editor-app .tcr-spec-kv dt {
  color: #9DB2D2;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

#tcr-holder-editor-app .tcr-spec-kv dd {
  color: #fff;
  font-weight: 700;
  margin: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tcr-holder-editor-app .tcr-export-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#tcr-holder-editor-app .tcr-export-row button {
  padding: 10px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.14s, border-color 0.14s;
}

#tcr-holder-editor-app .tcr-export-row button:hover {
  background: var(--tcr-red-dark);
  border-color: var(--tcr-red-dark);
}

#tcr-holder-editor-app .tcr-export-row button.tcr-btn-primary {
  grid-column: 1 / -1;
  background: var(--tcr-red);
  border-color: var(--tcr-red);
  font-size: 0.84rem;
  padding: 11px 14px;
}

#tcr-holder-editor-app .tcr-export-row button.tcr-btn-step {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.36);
}

#tcr-holder-editor-app #tcr-ed-status {
  font-size: 0.78rem;
  color: #FFD0CC;
  margin-top: 9px;
  min-height: 1.2em;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  #tcr-holder-editor-app .tcr-workbench {
    grid-template-columns: 1fr;
  }
  #tcr-holder-editor-app .tcr-canvas-col {
    position: static;
  }
  #tcr-holder-editor-app .tcr-preset-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #tcr-holder-editor-app .tcr-bp-titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #tcr-holder-editor-app .tcr-human-card {
    grid-template-columns: 1fr;
  }
  #tcr-holder-editor-app .tcr-human-card img {
    width: 100%;
    height: 148px;
  }
  #tcr-holder-editor-app .tcr-grid-2,
  #tcr-holder-editor-app .tcr-grid-3,
  #tcr-holder-editor-app .tcr-spec-kv {
    grid-template-columns: 1fr;
  }
  #tcr-holder-editor-app .tcr-bp-stage {
    height: 330px;
  }
  #tcr-holder-editor-app .tcr-export-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  #tcr-holder-editor-app .tcr-preset-strip,
  #tcr-holder-editor-app .tcr-param-col,
  #tcr-holder-editor-app .tcr-export-row,
  #tcr-holder-editor-app .tcr-bp-tools {
    display: none !important;
  }
  #tcr-holder-editor-app .tcr-workbench {
    display: block;
  }
  #tcr-holder-editor-app .tcr-spec-box {
    background: #fff;
    color: #000;
    border: 2px solid #000;
  }
  #tcr-holder-editor-app .tcr-spec-kv dt,
  #tcr-holder-editor-app .tcr-spec-kv dd {
    color: #000;
  }
}
