:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --accent-purple: #6366f1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Noto Sans Myanmar', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-size: 14px;
}

/* Top Nav */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 10px; }
.logo-box {
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
}
.brand-name { font-weight: 700; font-size: 15px; margin-left: 4px; }
.breadcrumb { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; }
.mode-badge { font-size: 11px; color: var(--text-muted); }
.user-avatar {
  width: 26px; height: 26px; background: #e0e7ff; color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

/* Sidebar Drawer */
.drawer {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
  background: #fff; z-index: 100; transition: left 0.3s ease;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}
.drawer.open { left: 0; }
.drawer-header { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-sub { color: var(--text-muted); font-size: 11px; }
.drawer-menu { display: flex; flex-direction: column; padding: 12px; gap: 4px; }
.menu-item {
  display: flex; flex-direction: column; padding: 10px 12px;
  text-decoration: none; color: var(--text-dark); border-radius: 8px; font-weight: 500;
}
.menu-item.active, .menu-item:hover { background: #eef2ff; color: var(--primary); }
.menu-item small { font-size: 11px; color: var(--text-muted); }
.drawer-footer { padding: 16px; border-top: 1px solid var(--border); }
.credit-box { background: #f8fafc; padding: 12px; border-radius: 8px; margin-bottom: 12px; }
.upgrade-btn {
  width: 100%; margin-top: 8px; background: #eef2ff; color: var(--primary);
  border: none; padding: 6px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.user-card { display: flex; align-items: center; gap: 8px; }
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 90; display: none;
}
.backdrop.open { display: block; }

/* Main Workspace */
.main-container { max-width: 600px; margin: 0 auto; padding: 16px; }
.view-panel { display: none; }
.view-panel.active { display: block; }

/* Upload Dropzone */
.upload-dropzone {
  background: #fff; border: 1.5px dashed #cbd5e1; border-radius: 12px;
  padding: 24px 16px; text-align: center; margin-bottom: 16px;
}
.file-input-hidden { display: none; }
.dropzone-label { cursor: pointer; display: block; }
.upload-icon {
  width: 36px; height: 36px; background: #eef2ff; color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px; font-size: 18px;
}
.upload-title { font-weight: 600; font-size: 14px; }
.upload-sub { font-size: 11px; color: var(--text-muted); }
.link-divider { margin: 16px 0 10px; font-size: 11px; color: var(--text-muted); position: relative; }
.url-input-group { display: flex; gap: 6px; margin-bottom: 8px; }
.url-input-group input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.supported-tags { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 11px; }
.badge { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

/* Tabs Header */
.tabs-header {
  display: flex; background: #f1f5f9; padding: 4px; border-radius: 8px; margin-bottom: 16px;
}
.tab-btn {
  flex: 1; padding: 8px 0; border: none; background: transparent;
  font-size: 12px; font-weight: 500; border-radius: 6px; cursor: pointer; color: var(--text-muted);
}
.tab-btn.active { background: #fff; color: var(--text-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* Tab Panes & Form Controls */
.tab-pane { display: none; background: #fff; padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.tab-pane.active { display: block; }
.form-group { margin-bottom: 16px; }
.section-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.radio-card {
  display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; cursor: pointer;
}
.radio-card.selected { border-color: var(--primary); background: #f5f3ff; }
.badge-pro { background: #0f172a; color: #fff; font-size: 9px; padding: 2px 4px; border-radius: 4px; }
.btn-group { display: flex; gap: 6px; }
.btn-choice {
  flex: 1; padding: 8px 0; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-choice.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.split-group .btn-choice { padding: 10px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.accent-text { color: var(--primary); font-weight: 600; font-size: 12px; }
.range-slider { width: 100%; accent-color: var(--primary); margin-top: 6px; }

/* Caption Preview */
.caption-preview-stage {
  background: #334155; padding: 16px; border-radius: 8px; text-align: center; margin-top: 8px;
}
.preview-text {
  color: #facc15; font-size: 18px; font-weight: 600;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.color-palette { display: flex; gap: 8px; margin-top: 6px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #e2e8f0; cursor: pointer;
}
.color-swatch.active { border-color: var(--primary); transform: scale(1.1); }

/* Gemini Box */
.gemini-card { background: #f8fafc; padding: 16px; border-radius: 8px; border: 1px solid var(--border); }
.gemini-desc { font-size: 12px; color: var(--text-muted); margin: 6px 0 12px; line-height: 1.5; }
.gemini-badge { background: #dcfce7; color: #166534; padding: 8px; border-radius: 6px; font-size: 11px; }

/* Render Dock */
.render-dock { margin-top: 16px; }
.btn-render {
  width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-download {
  display: inline-block; padding: 10px 20px; background: #10b981; color: #fff;
  text-decoration: none; border-radius: 8px; font-weight: 600;
}
.progress-card { background: #fff; padding: 12px; border-radius: 8px; border: 1px solid var(--border); margin-top: 10px; }
.progress-track { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.3s; }

/* Settings View */
.card { background: #fff; padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.sub-text { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.api-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.badge-req { background: #ffedd5; color: #c2410c; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.badge-active { color: #16a34a; font-size: 11px; font-weight: 600; }
.step-guide { background: #f8fafc; padding: 8px; border-radius: 6px; margin: 8px 0; font-size: 11px; color: var(--text-muted); }
.api-input-row { display: flex; gap: 6px; }
.form-control { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.btn { padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; }
.btn-outline { background: #fff; border: 1px solid var(--border); }
.btn-purple { background: var(--primary); color: #fff; }
.btn-dark { background: #0f172a; color: #fff; }
