/*
  Lower Thirds Designer — Premium Studio Theme
  Thunder Motion Toolkit
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

.lt-page {
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #060609;
}

.lt-tool-header {
  padding: 2rem 0 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(10,10,14,0.95), rgba(6,6,9,0.98));
  position: relative;
}

.lt-tool-header::before {
  content: '';
  position: absolute; top: -80%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,200,83,0.04), transparent 70%);
  pointer-events: none;
}

.lt-tool-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; position: relative; z-index: 2;
}

.lt-tool-title h1 {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  margin: 0; line-height: 1.2; font-family: var(--font-display, 'Outfit', sans-serif);
}

.lt-tool-title .tagline {
  font-size: 0.85rem; color: var(--text-muted); margin: 0.3rem 0 0;
}

/* ===== WORKSPACE ===== */
.lt-workspace {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  flex: 1;
}

/* ===== CANVAS ===== */
.lt-canvas-area {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 50% 70%, rgba(0,200,83,0.01) 0%, transparent 50%),
    #060609;
}

.lt-canvas-wrapper {
  width: 100%; max-width: 900px;
  aspect-ratio: 16/9;
  background: #0a0a0e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}

.lt-canvas-wrapper::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

/* Safe Zone Guides */
.lt-safe-action {
  position: absolute;
  border: 1px dashed rgba(255,255,255,0.06);
  pointer-events: none;
  /* Action Safe: 93% of frame (3.5% inset) */
  top: 3.5%; left: 3.5%; right: 3.5%; bottom: 3.5%;
}

.lt-safe-title {
  position: absolute;
  border: 1px dashed rgba(0,200,83,0.15);
  pointer-events: none;
  /* Title Safe: 90% of frame (5% inset) */
  top: 5%; left: 5%; right: 5%; bottom: 5%;
}

.lt-safe-label {
  position: absolute; font-size: 0.5rem; color: rgba(255,255,255,0.15);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

.lt-safe-label.action { top: 3.5%; left: 3.5%; padding: 2px 6px; }
.lt-safe-label.title { top: 5%; right: 5%; padding: 2px 6px; color: rgba(0,200,83,0.25); }

/* Elements on canvas */
.lt-element {
  position: absolute;
  cursor: move;
  user-select: none;
  transition: box-shadow 0.2s ease;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
}

.lt-element.selected {
  outline: 2px solid #00c853;
  outline-offset: 2px;
  box-shadow: 0 0 20px rgba(0,200,83,0.15);
}

.lt-element .lt-el-label {
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.lt-el-namebar { background: rgba(0,200,83,0.2); border: 1px solid rgba(0,200,83,0.4); color: #00c853; }
.lt-el-titlebar { background: rgba(96,165,250,0.2); border: 1px solid rgba(96,165,250,0.4); color: #60a5fa; }
.lt-el-accent { background: rgba(255,203,5,0.2); border: 1px solid rgba(255,203,5,0.4); color: #ffcb05; }
.lt-el-icon { background: rgba(167,139,250,0.2); border: 1px solid rgba(167,139,250,0.4); color: #a78bfa; border-radius: 50%; }
.lt-el-divider { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.8); border-radius: 2px; }
.lt-el-background-shape { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }

/* Animation Preview */
.lt-anim-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* ===== CONTROL PANEL ===== */
.lt-panel {
  background: rgba(12,12,16,0.92);
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}

.lt-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(0,200,83,0.15), transparent 40%);
  z-index: 2;
}

.lt-panel-tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.lt-panel-tab {
  flex: 1; padding: 0.8rem 0.5rem; border: none; background: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; text-align: center;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease; font-family: var(--font-sans);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}

.lt-panel-tab i { font-size: 0.9rem; }
.lt-panel-tab:hover { color: var(--text-secondary); }
.lt-panel-tab.active { color: #00c853; border-bottom-color: #00c853; }

.lt-panel-scroll {
  flex: 1; overflow-y: auto; padding: 1.3rem;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.04) transparent;
}

.lt-tab-pane { display: none; }
.lt-tab-pane.active { display: block; }

.lt-section {
  margin-bottom: 1.5rem;
}

.lt-section-title {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); font-weight: 700; margin-bottom: 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.03);
}

.lt-section-title i { font-size: 0.72rem; opacity: 0.6; }

/* Add Buttons */
.lt-add-buttons {
  display: flex; flex-direction: column; gap: 0.5rem;
}

.lt-add-btn {
  width: 100%; padding: 0.7rem 1rem; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary); cursor: pointer;
  font-size: 0.78rem; font-weight: 600; text-align: left;
  font-family: var(--font-sans);
  display: flex; align-items: center; gap: 0.7rem;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}

.lt-add-btn:hover {
  background: rgba(0,200,83,0.05); border-color: rgba(0,200,83,0.15);
  transform: translateX(3px);
}

.lt-add-btn i { width: 20px; text-align: center; }
.lt-add-btn.namebar i { color: #00c853; }
.lt-add-btn.titlebar i { color: #60a5fa; }
.lt-add-btn.accent i { color: #ffcb05; }
.lt-add-btn.icon i { color: #a78bfa; }
.lt-add-btn.divider i { color: rgba(255,255,255,0.6); }
.lt-add-btn.bg-shape i { color: rgba(255,255,255,0.3); }

/* Element List */
.lt-element-list {
  display: flex; flex-direction: column; gap: 0.4rem;
}

.lt-element-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: 8px;
  cursor: pointer; transition: all 0.2s ease;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
}

.lt-element-item:hover {
  background: rgba(255,255,255,0.03);
}

.lt-element-item.active {
  background: rgba(0,200,83,0.05); border-color: rgba(0,200,83,0.15);
}

.lt-element-item .item-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.lt-element-item .item-name {
  font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); flex: 1;
}

.lt-element-item .item-delete {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.7rem; padding: 2px; opacity: 0;
  transition: opacity 0.2s;
}

.lt-element-item:hover .item-delete { opacity: 1; }

/* Template Cards */
.lt-template-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}

.lt-template-card {
  padding: 0.8rem; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: all 0.25s ease; text-align: center;
}

.lt-template-card:hover {
  background: rgba(0,200,83,0.04); border-color: rgba(0,200,83,0.12);
  transform: translateY(-2px);
}

.lt-template-card .template-preview {
  height: 40px; margin-bottom: 0.5rem;
  background: rgba(0,0,0,0.3); border-radius: 6px;
  position: relative; overflow: hidden;
}

.lt-template-card .template-name {
  font-size: 0.62rem; font-weight: 600; color: var(--text-muted);
}

/* Animation Controls */
.lt-anim-selector {
  display: flex; flex-direction: column; gap: 0.5rem;
}

.lt-anim-btn {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 8px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted); cursor: pointer;
  font-size: 0.72rem; font-weight: 600; text-align: left;
  font-family: var(--font-sans);
  display: flex; align-items: center; gap: 0.6rem;
  transition: all 0.2s ease;
}

.lt-anim-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
.lt-anim-btn.active { background: rgba(0,200,83,0.06); border-color: rgba(0,200,83,0.15); color: #00c853; }
.lt-anim-btn i { width: 16px; text-align: center; }

.lt-preview-btn {
  width: 100%; padding: 0.8rem; margin-top: 1rem;
  border-radius: 10px; background: #00c853; border: none;
  color: #000; cursor: pointer; font-size: 0.82rem; font-weight: 800;
  font-family: var(--font-display, 'Outfit', sans-serif);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: all 0.25s ease; letter-spacing: 0.03em;
}

.lt-preview-btn:hover { background: #00e65c; transform: scale(1.02); box-shadow: 0 8px 20px rgba(0,200,83,0.2); }

/* Export */
.lt-export-btn {
  width: 100%; padding: 0.8rem 1rem; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary); cursor: pointer;
  font-size: 0.78rem; font-weight: 600; text-align: left;
  font-family: var(--font-sans);
  display: flex; align-items: center; gap: 0.8rem;
  transition: all 0.25s ease; margin-bottom: 0.5rem;
}

.lt-export-btn:hover {
  background: rgba(0,200,83,0.04); border-color: rgba(0,200,83,0.12);
}

.lt-export-btn i { color: #00c853; font-size: 1rem; }

.lt-json-preview {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px; padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; line-height: 1.6;
  color: var(--text-muted); max-height: 200px;
  overflow-y: auto; white-space: pre-wrap;
}

/* Toast */
.lt-toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.8rem 1.6rem;
  background: rgba(16,16,22,0.95); backdrop-filter: blur(16px);
  border: 1px solid rgba(0,200,83,0.15); border-radius: 12px;
  color: var(--text-primary); font-size: 0.82rem; font-weight: 500;
  z-index: 9999; box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  display: flex; align-items: center; gap: 0.7rem;
}

.lt-toast.visible { transform: translateX(-50%) translateY(0); }
.lt-toast i { color: #00c853; }

/* Responsive */
@media (max-width: 1024px) {
  .lt-workspace { grid-template-columns: 1fr; }
  .lt-panel { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); max-height: 500px; }
}

@media (max-width: 768px) {
  .lt-canvas-area { padding: 1rem; }
  .lt-tool-header .container { flex-direction: column; text-align: center; }
}
