﻿.subtitle-maker {
  --ui-panel-bg: #ffffff;
  --ui-panel-border: #e4e8f2;
  --ui-panel-shadow: 0 6px 18px rgba(33, 61, 110, 0.08);
  --ui-text: #14335f;
  --ui-subtext: #5c6b84;
  --ui-accent: #f56a6a;
  --ui-accent-soft: rgba(245, 106, 106, 0.16);

  --telop-accent: #f97316;
  --telop-accent-2: #fb7185;
  --telop-card-bg: rgba(15, 23, 42, 0.92);
  --telop-card-border: rgba(248, 250, 252, 0.12);
  --telop-card-shadow: 0 24px 50px rgba(2, 6, 23, 0.45);
  --telop-sheen: radial-gradient(circle at top left, rgba(251, 146, 60, 0.24), transparent 60%);
  --telop-blur: 0px;
  --telop-title-color: #f8fafc;
  --telop-body-color: #e2e8f0;
  --telop-title-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  --telop-body-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --telop-pill-bg: rgba(15, 23, 42, 0.7);
  --telop-pill-text: #fde68a;
  --telop-pill-border: rgba(249, 115, 22, 0.7);
  --telop-radius: 18px;
  --telop-padding: 16px;
  --telop-title-size: clamp(1rem, 1.6vw, 1.4rem);
  --telop-body-size: clamp(0.85rem, 1.1vw, 1.05rem);
  --telop-pill-size: 0.7rem;
  --telop-accent-width: 4px;
}

.subtitle-maker[data-style="orange"] {
  --telop-accent: #f97316;
  --telop-accent-2: #fb7185;
  --telop-card-bg: rgba(15, 23, 42, 0.92);
  --telop-card-border: rgba(251, 146, 60, 0.5);
  --telop-sheen: radial-gradient(circle at top left, rgba(251, 146, 60, 0.25), transparent 60%);
  --telop-title-color: #f8fafc;
  --telop-body-color: #e2e8f0;
  --telop-pill-bg: rgba(15, 23, 42, 0.72);
  --telop-pill-text: #fde68a;
  --telop-pill-border: rgba(249, 115, 22, 0.7);
}

.subtitle-maker[data-style="red"] {
  --telop-accent: #ef4444;
  --telop-accent-2: #f97316;
  --telop-card-bg: rgba(34, 10, 14, 0.92);
  --telop-card-border: rgba(248, 113, 113, 0.6);
  --telop-sheen: radial-gradient(circle at top left, rgba(248, 113, 113, 0.22), transparent 60%);
  --telop-title-color: #fef2f2;
  --telop-body-color: #fee2e2;
  --telop-pill-bg: rgba(127, 29, 29, 0.6);
  --telop-pill-text: #fecaca;
  --telop-pill-border: rgba(248, 113, 113, 0.7);
}

.subtitle-maker[data-style="blue"] {
  --telop-accent: #38bdf8;
  --telop-accent-2: #818cf8;
  --telop-card-bg: rgba(8, 18, 34, 0.92);
  --telop-card-border: rgba(56, 189, 248, 0.55);
  --telop-sheen: radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 60%);
  --telop-title-color: #f8fafc;
  --telop-body-color: #dbeafe;
  --telop-pill-bg: rgba(30, 41, 59, 0.7);
  --telop-pill-text: #e0f2fe;
  --telop-pill-border: rgba(56, 189, 248, 0.6);
}

.subtitle-maker[data-style="green"] {
  --telop-accent: #22c55e;
  --telop-accent-2: #a3e635;
  --telop-card-bg: rgba(9, 28, 18, 0.92);
  --telop-card-border: rgba(74, 222, 128, 0.55);
  --telop-sheen: radial-gradient(circle at top left, rgba(74, 222, 128, 0.2), transparent 60%);
  --telop-title-color: #f0fdf4;
  --telop-body-color: #dcfce7;
  --telop-pill-bg: rgba(20, 83, 45, 0.6);
  --telop-pill-text: #bbf7d0;
  --telop-pill-border: rgba(74, 222, 128, 0.6);
}

.subtitle-maker[data-style="purple"] {
  --telop-accent: #a855f7;
  --telop-accent-2: #ec4899;
  --telop-card-bg: rgba(28, 14, 44, 0.92);
  --telop-card-border: rgba(216, 180, 254, 0.55);
  --telop-sheen: radial-gradient(circle at top left, rgba(216, 180, 254, 0.2), transparent 60%);
  --telop-title-color: #f5f3ff;
  --telop-body-color: #e9d5ff;
  --telop-pill-bg: rgba(88, 28, 135, 0.6);
  --telop-pill-text: #e9d5ff;
  --telop-pill-border: rgba(216, 180, 254, 0.6);
}

.subtitle-maker[data-style="mono"] {
  --telop-accent: #e2e8f0;
  --telop-accent-2: #94a3b8;
  --telop-card-bg: rgba(15, 23, 42, 0.92);
  --telop-card-border: rgba(148, 163, 184, 0.5);
  --telop-sheen: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), transparent 60%);
  --telop-title-color: #f8fafc;
  --telop-body-color: #e2e8f0;
  --telop-pill-bg: rgba(148, 163, 184, 0.2);
  --telop-pill-text: #f8fafc;
  --telop-pill-border: rgba(226, 232, 240, 0.6);
}

.subtitle-maker[data-style="glass"] {
  --telop-accent: #38bdf8;
  --telop-accent-2: #22d3ee;
  --telop-card-bg: rgba(15, 23, 42, 0.42);
  --telop-card-border: rgba(226, 232, 240, 0.4);
  --telop-card-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
  --telop-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%);
  --telop-blur: 10px;
  --telop-title-color: #f8fafc;
  --telop-body-color: #e2e8f0;
  --telop-pill-bg: rgba(15, 23, 42, 0.55);
  --telop-pill-text: #bae6fd;
  --telop-pill-border: rgba(56, 189, 248, 0.6);
}

.subtitle-maker[data-style="solid"] {
  --telop-accent: #0ea5e9;
  --telop-accent-2: #06b6d4;
  --telop-card-bg: #f8fafc;
  --telop-card-border: #e2e8f0;
  --telop-card-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  --telop-sheen: radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 60%);
  --telop-title-color: #0f172a;
  --telop-body-color: #1f2937;
  --telop-title-shadow: none;
  --telop-body-shadow: none;
  --telop-pill-bg: #0f172a;
  --telop-pill-text: #f8fafc;
  --telop-pill-border: rgba(15, 23, 42, 0.6);
}

.subtitle-maker[data-style="outline"] {
  --telop-accent: #38bdf8;
  --telop-accent-2: #60a5fa;
  --telop-card-bg: rgba(15, 23, 42, 0.18);
  --telop-card-border: rgba(56, 189, 248, 0.9);
  --telop-card-shadow: 0 18px 35px rgba(2, 6, 23, 0.4);
  --telop-sheen: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 60%);
  --telop-title-color: #f8fafc;
  --telop-body-color: #e0f2fe;
  --telop-pill-bg: rgba(56, 189, 248, 0.2);
  --telop-pill-text: #e0f2fe;
  --telop-pill-border: rgba(56, 189, 248, 0.8);
}

.subtitle-maker[data-style="vivid"] {
  --telop-accent: #f43f5e;
  --telop-accent-2: #fbbf24;
  --telop-card-bg: linear-gradient(120deg, rgba(244, 63, 94, 0.92), rgba(251, 191, 36, 0.92));
  --telop-card-border: rgba(251, 191, 36, 0.7);
  --telop-card-shadow: 0 24px 55px rgba(120, 0, 50, 0.35);
  --telop-sheen: radial-gradient(circle at top left, rgba(255, 255, 255, 0.35), transparent 60%);
  --telop-title-color: #0f172a;
  --telop-body-color: #1f2937;
  --telop-title-shadow: none;
  --telop-body-shadow: none;
  --telop-pill-bg: rgba(15, 23, 42, 0.75);
  --telop-pill-text: #fef3c7;
  --telop-pill-border: rgba(251, 191, 36, 0.6);
}

.subtitle-maker__wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.subtitle-maker__title {
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  margin: 0;
  color: var(--ui-text);
}

.subtitle-maker__lead {
  margin: 4px 0 0;
  color: var(--ui-subtext);
  line-height: 1.7;
}

.subtitle-maker__grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.subtitle-maker__panel {
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
  border-radius: 16px;
  box-shadow: var(--ui-panel-shadow);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.subtitle-maker__panel--form {
  width: 100%;
  max-width: 420px;
}

.subtitle-maker__panel--preview {
  min-width: 0;
  position: sticky;
  top: 90px;
  align-self: start;
}

.sm-field {
  display: grid;
  gap: 6px;
}

.subtitle-maker label {
  font-weight: 600;
  color: var(--ui-text);
}

.subtitle-maker input[type="text"],
.subtitle-maker textarea,
.subtitle-maker select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.subtitle-maker input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
}

.subtitle-maker input[type="text"]:focus,
.subtitle-maker textarea:focus,
.subtitle-maker select:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.subtitle-maker textarea {
  resize: vertical;
  min-height: 110px;
}

.subtitle-maker input::placeholder,
.subtitle-maker textarea::placeholder {
  color: rgba(100, 116, 139, 0.6);
}

.sm-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.sm-group {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.sm-group--style {
  padding: 10px;
  gap: 6px;
}

.sm-group--style .sm-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sm-group--style .sm-field {
  gap: 4px;
}

.sm-group--style label {
  font-size: 0.85rem;
}

.sm-group--style input[type="color"] {
  height: 34px;
  padding: 2px;
}

.sm-group--style input[type="range"] {
  height: 24px;
}

.sm-group--style .sm-slider__label {
  font-size: 0.85rem;
}

.sm-group__title {
  margin: 0;
  font-weight: 600;
  color: var(--ui-text);
  font-size: 0.95rem;
}

.sm-slider {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 12px;
}

.sm-slider__label {
  color: var(--ui-subtext);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subtitle-maker input[type="range"] {
  width: 100%;
  accent-color: var(--ui-accent);
}

.sm-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: center;
}

.subtitle-maker .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--ui-accent) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.subtitle-maker .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(245, 106, 106, 0.2);
}

.subtitle-maker .btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.subtitle-maker .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.subtitle-maker .btn.ghost {
  background: #ffffff !important;
  color: var(--ui-accent) !important;
  border-color: var(--ui-accent) !important;
}

.sm-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top left, #111827 0%, #020617 60%, #000000 100%);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.4);
}

.sm-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
}

.telop-card {
  position: absolute;
  width: 60%;
  left: 6%;
  bottom: 8%;
  min-height: 24%;
  padding: var(--telop-padding);
  border-radius: var(--telop-radius);
  background: var(--telop-card-bg);
  border: 1px solid var(--telop-card-border);
  box-shadow: var(--telop-card-shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow: hidden;
  backdrop-filter: blur(var(--telop-blur));
  -webkit-backdrop-filter: blur(var(--telop-blur));
  transition: width 0.2s ease, left 0.2s ease, bottom 0.2s ease, min-height 0.2s ease, border-radius 0.2s ease, padding 0.2s ease;
}

.telop-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--telop-sheen);
  opacity: 0.6;
  pointer-events: none;
}

.telop-card > * {
  position: relative;
  z-index: 1;
}

.telop-accent {
  width: var(--telop-accent-width);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--telop-accent), var(--telop-accent-2));
  flex-shrink: 0;
}

.telop-text-wrap {
  flex: 1;
  min-width: 0;
}

.telop-title {
  font-size: var(--telop-title-size);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  color: var(--telop-title-color);
  text-shadow: var(--telop-title-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-pill {
  padding: 3px 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--telop-pill-border);
  font-size: var(--telop-pill-size);
  color: var(--telop-pill-text);
  background: var(--telop-pill-bg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  transform: translateY(-1px);
}

.telop-body {
  font-size: var(--telop-body-size);
  line-height: 1.6;
  color: var(--telop-body-color);
  word-break: break-word;
  overflow-wrap: break-word;
  text-shadow: var(--telop-body-shadow);
  white-space: pre-wrap;
}

.sm-note {
  margin: 6px 0 0;
  color: var(--ui-subtext);
  font-size: 0.9rem;
}

@media screen and (max-width: 980px) {
  .subtitle-maker__grid {
    grid-template-columns: 1fr;
  }

  .sm-slider {
    grid-template-columns: 1fr;
  }

  .sm-slider__label {
    justify-content: flex-start;
    gap: 8px;
  }

  .sm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .subtitle-maker__panel--preview {
    position: static;
    top: auto;
  }
}
