﻿.split-hero {
  padding-top: 40px;
}

.split-hero-content {
  max-width: 1280px;
}

.split-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.split-layout.panel-locked {
  grid-template-columns: minmax(0, 1fr);
}

.split-layout.panel-locked .split-preview-pane {
  min-height: 0;
  padding-bottom: 16px;
}

.split-layout.panel-locked #splitPreviewEmpty,
.split-layout.panel-locked #splitPreviewWrap {
  display: none !important;
}

.split-layout.panel-locked .split-upload-top {
  margin-bottom: 0;
}

.split-layout.panel-locked .split-upload-top ~ * {
  display: none !important;
}

.split-preview-pane,
.split-control-pane {
  background: #ffffff;
  border: 1px solid #dbe3f3;
  border-radius: 22px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.split-preview-pane {
  padding: 16px;
  min-height: 640px;
}

.split-upload-top {
  margin-bottom: 12px;
}

.split-upload-box {
  min-height: 126px;
  border-radius: 16px;
}

.split-upload-progress {
  margin-top: 8px;
  border: 1px solid #dbe3f3;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
}

.split-upload-progress.hidden {
  display: none !important;
}

.split-upload-progress .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: #0b5fff;
  border-radius: 999px;
  animation: splitSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes splitSpin {
  to {
    transform: rotate(360deg);
  }
}

.selected-file {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #dbe3f3;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selected-file.hidden {
  display: none;
}

.selected-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 14px;
}

.selected-file-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.selected-file-remove svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.split-preview-empty {
  min-height: 420px;
  border: 1px dashed #c9d5ea;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #64748b;
  background: #f8fbff;
  font-size: 15px;
}

.split-preview-empty.hidden,
.split-preview-wrap.hidden {
  display: none !important;
}

.split-preview-wrap {
  display: grid;
  gap: 10px;
}

.split-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.split-preview-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.split-preview-head p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.split-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.thumb-card {
  border: 1px solid #dbe3f3;
  border-radius: 12px;
  padding: 8px;
  background: #fbfdff;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.thumb-card canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.thumb-card span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
  text-align: center;
}

.thumb-card.selectable {
  cursor: pointer;
}

.thumb-card.selectable:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}

.thumb-card.selected {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
  background: #f0fdf9;
}

.thumb-card .thumb-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #065f46;
  color: #ffffff;
  font-size: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-top: 0;
  line-height: 1;
  text-align: center;
  font-family: Arial, sans-serif;
}

.split-control-pane {
  position: sticky;
  top: 86px;
  padding: 0;
  overflow: hidden;
  background: #f8fafd;
  border: 1px solid #d4deee;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.split-drawer-toggle,
.split-drawer-backdrop,
.split-drawer-close {
  display: none;
}

.split-control-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafd;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.split-control-head h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
}

.split-top-tabs {
  display: flex;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #e2e8f0;
  background: #eef3f9;
  gap: 0;
}

.split-top-tab {
  flex: 1 1 50%;
  border: 0;
  border-right: 1px solid #e2e8f0;
  background: transparent;
  padding: 11px 10px;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.split-top-tab:last-child {
  border-right: 0;
}

.split-top-tab.active {
  background: #f8fafd;
  color: #0f172a;
  box-shadow: inset 0 -2px 0 #ef4444;
}

.split-tab-panel {
  display: none;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafd;
}

.split-tab-panel.active {
  display: block;
}

.panel-label {
  margin: 0 0 10px;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  text-align: center;
}

.mode-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-chip-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-chip {
  border: 1px solid #dbe3f3;
  border-radius: 12px;
  padding: 9px 10px;
  background: #f1f5fb;
  color: #64748b;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  cursor: pointer;
}

.mode-chip.active {
  border-color: #ef4444;
  color: #ef4444;
  background: #fff5f5;
}

.range-mode-block {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.panel-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.tiny-btn {
  border: 1px solid #ef4444;
  color: #ef4444;
  background: #ffffff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tiny-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.range-rows {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.range-row input,
#fixedChunkInput,
#pagesInput {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 11px;
  font-size: 14px;
  background: #ffffff;
}

.range-row input:focus,
#pagesInput:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.range-row span {
  color: #64748b;
  font-size: 13px;
}

.range-del {
  width: 28px;
  height: 28px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  border-radius: 999px;
  cursor: pointer;
}

.field-label {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.field-note {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #334155;
  margin-top: 2px;
}

.check-line.hidden {
  display: none !important;
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: #ef4444;
}

.range-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.range-compose {
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 10px;
}

.range-actions .tiny-btn {
  min-width: 120px;
}

.range-merge-line {
  justify-content: center;
  margin-top: 0;
  font-size: 14px;
}

.split-stats {
  padding: 14px 18px 0;
  margin-top: 0;
}

.split-stats .stat-card {
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}

.split-stats .stat-card strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.split-stats-inline {
  padding: 12px 18px 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #334155;
}

.split-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.split-metric strong {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.split-metric:not(:last-child)::after {
  content: "।";
  color: #94a3b8;
  margin-left: 4px;
}

#splitStatus {
  padding: 0 18px;
  min-height: 24px;
  font-size: 15px;
}

#splitProgressWrap {
  margin: 10px 18px 0;
}

.split-result-box {
  padding: 14px 18px;
}

.split-result-box h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.split-action-row {
  padding: 10px 18px 18px;
  display: grid;
  gap: 10px;
}

.split-action-row .secondary-btn {
  margin-top: 0;
}

.split-action-row .primary-btn,
.split-action-row .secondary-btn {
  background: linear-gradient(135deg, #f43f3f, #ef2e2e);
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(239, 46, 46, 0.2);
  font-size: 17px;
  padding-top: 13px;
  padding-bottom: 13px;
}

.split-action-row .secondary-btn {
  background: #8f96a3;
  box-shadow: none;
  color: #ffffff;
}

@media (max-width: 1160px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-control-pane {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 110;
    width: min(420px, 92vw);
    height: 100dvh;
    border-radius: 18px 0 0 18px;
    transform: translateX(105%);
    transition: transform 0.26s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -14px 0 30px rgba(15, 23, 42, 0.2);
  }

  .split-control-pane.drawer-open {
    transform: translateX(0);
  }

  .split-drawer-close {
    display: inline-grid;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    border-radius: 999px;
    place-items: center;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }

  .split-drawer-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 105;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #ef2e2e, #f45050);
    box-shadow: 0 12px 24px rgba(239, 46, 46, 0.3);
    cursor: pointer;
  }

  .split-drawer-toggle.hidden {
    display: none !important;
  }

  .split-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    border: 0;
    background: rgba(15, 23, 42, 0.44);
    cursor: pointer;
    display: block;
  }

  .split-drawer-backdrop.hidden {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .split-hero {
    padding-top: 24px;
  }

  .split-preview-pane,
  .split-control-pane {
    border-radius: 16px;
  }

  .split-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .split-control-head h2 {
    font-size: 32px;
    text-align: center;
  }

  .range-row {
    grid-template-columns: 1fr auto 1fr auto;
    gap: 6px;
    align-items: center;
  }

  .range-row span {
    display: inline;
  }

  .range-del {
    justify-self: end;
  }

  .split-tab-panel {
    padding: 14px 14px 12px;
  }

  .split-stats {
    padding: 12px 14px 0;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .split-stats .stat-card strong {
    font-size: 22px;
  }

  .split-stats-inline {
    padding: 10px 14px 2px;
    font-size: 12px;
    gap: 6px;
  }

  .split-metric strong {
    font-size: 12px;
  }

  #splitStatus {
    padding: 0 14px;
    text-align: center;
  }

  .split-action-row {
    padding: 10px 14px 16px;
  }

  .split-action-row .primary-btn,
  .split-action-row .secondary-btn {
    font-size: 16px;
  }
}
