/* 애니메이션텍스트 - Modern UI */
:root {
  --bg: #0f1221;
  --bg2: #1a1f35;
  --card: #222845;
  --accent: #6c5ce7;
  --accent2: #00cec9;
  --accent3: #fd79a8;
  --text: #f5f6fa;
  --muted: #a4b0be;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 10px 40px rgba(0,0,0,0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans",
    "PingFang SC", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #2d1b69 0%, transparent 50%),
              radial-gradient(900px 500px at 100% 0%, #0a3d62 0%, transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.app-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(15,18,33,0.75);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.15rem;
}
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; box-shadow: var(--shadow);
  font-size: 1.1rem;
}
.nav {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  transition: .2s; font-size: .92rem; font-weight: 600;
}
.nav a:hover, .nav a.active {
  background: rgba(108,92,231,.25); color: #fff;
}

.container {
  max-width: 1100px; margin: 0 auto; padding: 28px 18px 60px;
}

.hero {
  padding: 28px; border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, rgba(108,92,231,.35), rgba(0,206,201,.18));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.8rem; }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.menu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
  min-height: 140px;
}
.menu-card:hover {
  transform: translateY(-4px);
  border-color: rgba(108,92,231,.55);
}
.menu-card .icon { font-size: 1.8rem; margin-bottom: 10px; }
.menu-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.menu-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel h2 { margin: 0 0 16px; font-size: 1.25rem; }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; margin-bottom: 8px; color: var(--muted); font-weight: 600; font-size: .9rem;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,92,231,.25);
}

.file-drop {
  border: 2px dashed rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  background: rgba(255,255,255,.02);
  cursor: pointer;
  transition: .2s;
}
.file-drop:hover, .file-drop.drag {
  border-color: var(--accent2);
  background: rgba(0,206,201,.08);
}
.file-drop input { display: none; }
.preview {
  margin-top: 12px; max-width: 100%; max-height: 280px; border-radius: 12px;
  display: none;
}

.btn {
  appearance: none; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: white; font-weight: 700;
  padding: 12px 20px; border-radius: 12px;
  font-size: .95rem; transition: .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.btn.danger { background: linear-gradient(135deg, #e17055, #d63031); }
.btn.teal { background: linear-gradient(135deg, var(--accent2), #81ecec); color: #063; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.anim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 340px; overflow: auto; padding-right: 4px;
}
.anim-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: .15s;
  font-size: .85rem;
}
.anim-item:hover { border-color: rgba(0,206,201,.5); }
.anim-item.selected {
  border-color: var(--accent);
  background: rgba(108,92,231,.22);
  box-shadow: inset 0 0 0 1px rgba(108,92,231,.4);
}
.anim-item .cat {
  display: inline-block; margin-top: 6px;
  font-size: .7rem; color: var(--accent2); text-transform: uppercase; letter-spacing: .04em;
}

.table {
  width: 100%; border-collapse: collapse;
}
.table th, .table td {
  text-align: left; padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.table th { color: var(--muted); font-weight: 700; }
.table tr:hover td { background: rgba(255,255,255,.02); }

.video-thumb {
  width: 140px; height: 80px; object-fit: cover; border-radius: 8px; background: #000;
}

.status {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(0,206,201,.12); border: 1px solid rgba(0,206,201,.3);
  display: none; white-space: pre-wrap;
}
.status.error { background: rgba(214,48,49,.15); border-color: rgba(214,48,49,.4); }
.status.show { display: block; }

.progress {
  height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-top: 10px; display: none;
}
.progress.show { display: block; }
.progress > i {
  display: block; height: 100%; width: 30%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: slide 1.2s infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.lang-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.lang-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; cursor: pointer; text-align: center; font-weight: 700;
}
.lang-btn.active, .lang-btn:hover {
  border-color: var(--accent); background: rgba(108,92,231,.2);
}

.share-box {
  background: var(--bg2); border-radius: 12px; padding: 14px;
  word-break: break-all; font-family: ui-monospace, monospace; font-size: .9rem;
}

.footer {
  text-align: center; color: var(--muted); font-size: .8rem; padding: 24px;
}

/* Effect preview modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 10, 20, 0.72);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-backdrop.show { display: flex; }
.modal-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body {
  padding: 16px;
  background: #0b0e18;
  text-align: center;
}
.modal-body img {
  width: 100%; max-height: 360px; object-fit: contain;
  border-radius: 12px; background: #000;
}
.modal-foot {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.effect-section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 10px; font-weight: 700; font-size: .95rem;
}
.effect-section-title .badge {
  font-size: .72rem; padding: 3px 8px; border-radius: 999px;
  background: rgba(108,92,231,.25); color: #dfe6ff;
}
.effect-section-title.fun .badge {
  background: rgba(0,206,201,.2); color: #b8fffa;
}
.photo-effect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.photo-effect-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  font-size: .82rem;
  transition: .15s;
}
.photo-effect-item:hover { border-color: rgba(0,206,201,.45); }
.photo-effect-item.selected {
  border-color: var(--accent);
  background: rgba(108,92,231,.22);
  box-shadow: inset 0 0 0 1px rgba(108,92,231,.35);
}
.photo-effect-item.fun.selected {
  border-color: var(--accent2);
  background: rgba(0,206,201,.16);
  box-shadow: inset 0 0 0 1px rgba(0,206,201,.35);
}
.photo-effect-item .emoji {
  display: block; font-size: 1.25rem; margin-bottom: 4px;
}
.quick-effect-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.quick-effect-hint {
  color: var(--muted);
  font-size: .92rem;
  margin: 0 0 16px;
  line-height: 1.45;
}
.poster-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.poster-canvas-wrap img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
}
.face-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.face-box {
  position: absolute;
  pointer-events: auto;
  border: 2px solid #50e3c2;
  background: rgba(0, 206, 201, 0.12);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  text-align: left;
}
.face-box.selected {
  border-color: #ffeaa7;
  background: rgba(253, 203, 110, 0.25);
  box-shadow: 0 0 0 2px rgba(253, 203, 110, 0.45);
}
.anim-thumb {
  width: 100%; height: 64px; object-fit: cover; border-radius: 8px;
  margin-bottom: 8px; background: #0b0e18; display: block;
}
.anim-thumb.anim-thumb-none {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--muted);
}
.anim-item .preview-hint {
  display: block; margin-top: 6px; font-size: .72rem; color: var(--muted);
}

@media (max-width: 720px) {
  .app-header { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 1.4rem; }
  .video-thumb { width: 100px; height: 60px; }
}
