/* ==================================================
  SMC / Still Motion Cut
  File: styles.css
  Role: レイアウト・配色・レスポンシブ表示
================================================== */

:root {
  --bg: #0f1117;
  --panel: #171a22;
  --panel-2: #1f2330;
  --border: #2c3140;
  --text: #f4f6fb;
  --muted: #aab1c2;
  --accent: #8fb7ff;
  --accent-2: #b59cff;
  --danger: #ff7f8a;
  --success: #80e0b0;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(143, 183, 255, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(181, 156, 255, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
}

/* ------------------------------
   Sidebar
------------------------------ */

.sidebar {
  height: 100vh;
  padding: 14px;
  background: rgba(15, 17, 23, 0.82);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.app-title {
  margin: 0 0 3px;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.app-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.section {
  margin-bottom: 10px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(31, 35, 48, 0.92), rgba(23, 26, 34, 0.92));
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 22px var(--shadow);
}

.section-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control {
  margin-bottom: 8px;
}

.control:last-child {
  margin-bottom: 0;
}

.control label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 7px;
  align-items: center;
}

.control-row.wide {
  grid-template-columns: 1fr;
}

.hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

/* ------------------------------
   Inputs
------------------------------ */

input[type="file"] {
  width: 100%;
  padding: 10px;
  color: var(--muted);
  background: #10131b;
  border: 1px dashed #3a4155;
  border-radius: 10px;
  cursor: pointer;
}

.drop-zone {
  position: relative;
  min-height: 78px;
  padding: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at center, rgba(143, 183, 255, 0.1), transparent 62%),
    #10131b;
  border: 1px dashed #3a4155;
  border-radius: 11px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.drop-zone:hover {
  border-color: var(--accent);
  background:
    radial-gradient(circle at center, rgba(143, 183, 255, 0.15), transparent 62%),
    #10131b;
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background:
    radial-gradient(circle at center, rgba(143, 183, 255, 0.24), transparent 62%),
    rgba(143, 183, 255, 0.1);
  transform: scale(1.01);
}

.drop-zone-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.drop-zone-text {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  color: var(--text);
  background: #10131b;
  border: 1px solid #363c4f;
  border-radius: 9px;
  outline: none;
  font-size: 12px;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 183, 255, 0.14);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.value-box {
  min-width: 58px;
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #10131b;
  border: 1px solid #363c4f;
  border-radius: 7px;
  font-size: 11px;
}

/* ------------------------------
   Buttons
------------------------------ */

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-row.single {
  grid-template-columns: 1fr;
}

button {
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: #252b3a;
  border: 1px solid #3a4155;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    opacity 0.12s ease;
  font-size: 12px;
}

button:hover {
  background: #30374a;
  border-color: #59627a;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  color: #07101f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 700;
}

button.primary:hover {
  filter: brightness(1.06);
}

button.danger {
  color: #1f0709;
  background: var(--danger);
  border-color: transparent;
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------
   Preview Area
------------------------------ */

.preview-area {
  min-width: 0;
  height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.preview-status {
  color: var(--muted);
  font-size: 12px;
}

.canvas-wrap {
  min-height: 0;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    rgba(10, 12, 18, 0.82);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  background: #05070c;
  border-radius: 12px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.45);
  cursor: crosshair;
}

.preview-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.focus-info {
  color: var(--accent);
}

.preview-actions {
  margin-bottom: 0;
  padding: 10px;
}

.preview-actions .section-title {
  margin-bottom: 8px;
}

.preview-button-row {
  display: grid;
  grid-template-columns: 120px 120px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.action-output {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1fr;
  gap: 10px;
  align-items: start;
}

.action-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.action-status-block .hint {
  margin: 0;
}

.action-download-block {
  min-width: 0;
}

.action-download-block .output-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.preview-actions .hint {
  margin-bottom: 0;
}

/* ------------------------------
   Progress / Output
------------------------------ */

.progress {
  width: 100%;
  height: 8px;
  background: #10131b;
  border: 1px solid #30364a;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s linear;
}

.output-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.output-link:hover {
  text-decoration: underline;
}

/* ------------------------------
   Small Utility
------------------------------ */

.hidden {
  display: none !important;
}

.note {
  padding: 10px;
  color: var(--muted);
  background: rgba(143, 183, 255, 0.08);
  border: 1px solid rgba(143, 183, 255, 0.18);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  color: #07101f;
  background: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* ------------------------------
   Responsive
------------------------------ */

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .preview-area {
    height: auto;
    min-height: 70vh;
  }

  .preview-button-row {
    grid-template-columns: 1fr;
  }

  .action-output {
    grid-template-columns: 1fr;
  }
}
