*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

/* Font Library */
@font-face {
  font-family: 'Bangers';
  src: url('fonts/Bangers-Regular.ttf') format('truetype');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'Bebas Neue';
  src: url('fonts/BebasNeue-Regular.ttf') format('truetype');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: bold; font-style: normal;
}
@font-face {
  font-family: 'Indie Flower';
  src: url('fonts/IndieFlower-Regular.ttf') format('truetype');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'Lobster';
  src: url('fonts/Lobster-Regular.ttf') format('truetype');
  font-weight: normal; font-style: normal;
}
:root {
  --bg-base:#06060f; --bg-card:#0e0e1a; --bg-elevated:#14142a; --bg-hover:#1a1a35;
  --border:rgba(108,99,255,.15); --border-hover:rgba(108,99,255,.35);
  --text-primary:#e8e6f0; --text-secondary:#8a86a0; --text-muted:#5a5672;
  --accent:#6c63ff; --accent-glow:rgba(108,99,255,.25); --accent-2:#a855f7;
  --gradient:linear-gradient(135deg,#6c63ff 0%,#a855f7 50%,#ec4899 100%);
  --gradient-subtle:linear-gradient(135deg,rgba(108,99,255,.12) 0%,rgba(168,85,247,.08) 100%);
  --success:#22c55e; --error:#ef4444;
  --webcam-color:#6c63ff; --screen-color:#ec4899;
  --radius:12px; --radius-lg:16px; --radius-sm:8px;
  --transition:.2s cubic-bezier(.4,0,.2,1); --transition-slow:.4s cubic-bezier(.4,0,.2,1);
}
body.light-mode {
  --bg-base: #f4f4f9; --bg-card: #ffffff; --bg-elevated: #fcfcff; --bg-hover: #f0f0f7;
  --border: rgba(108, 99, 255, 0.08); --border-hover: rgba(108, 99, 255, 0.2);
  --text-primary: #1e1e2f; --text-secondary: #5a5a75; --text-muted: #8888a0;
  --accent-glow: rgba(108, 99, 255, 0.1);
  --gradient-subtle: linear-gradient(135deg, rgba(108, 99, 255, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
}
body.light-mode .main-header {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}
body.light-mode .logo-text, body.light-mode .hero h1 { color: #1a1a2e; }
body.light-mode .hero h1 { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body.light-mode .mode-card { border-color: rgba(108, 99, 255, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); }
body.light-mode .mode-card:hover { border-color: var(--accent); box-shadow: 0 20px 40px rgba(108, 99, 255, 0.1); }
body.light-mode .mode-card h3 { color: #1a1a2e; }
body.light-mode .panel-card { background: #fff; border-color: rgba(108, 99, 255, 0.08); }
body.light-mode .modal-content { background: #fff; border-color: rgba(0, 0, 0, 0.05); color: #1a1a2e; }
body.light-mode .modal-header { border-bottom-color: rgba(0, 0, 0, 0.05); }
body.light-mode .modal-footer { background: #fcfcff; border-top-color: rgba(0, 0, 0, 0.05); }
body.light-mode .faq-item { background: #fff; border-color: rgba(108, 99, 255, 0.1); }
body.light-mode .faq-item:hover { background: #f8f8fb; border-color: var(--accent); }
body.light-mode .faq-question { color: #1a1a2e; }
body.light-mode .faq-content p { color: #5a5a75; }
body.light-mode .section-title { color: #1a1a2e; }
body.light-mode .btn-close-modal { color: #1a1a2e; }
body.light-mode .auth-view { color: #1a1a2e; }
body.light-mode .text-input { background: #f8f8fb; border-color: #e2e2ec; color: #1a1a2e; }
body.light-mode .text-input::placeholder { color: #a0a0b8; }
body.light-mode .btn-lang, body.light-mode .btn-theme-toggle { background: #fff; border-color: #e2e2ec; color: #5a5a75; }
body.light-mode .btn-lang:hover, body.light-mode .btn-theme-toggle:hover { background: #f4f4f9; border-color: var(--accent); color: var(--accent); }
body.light-mode .profile-menu { background: #fff; border-color: rgba(108, 99, 255, 0.1); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
body.light-mode .profile-name { color: #1a1a2e; }
body.light-mode .profile-item { color: #5a5a75; }
body.light-mode .profile-item:hover { background: #f4f4f9; color: var(--accent); }
body.light-mode .item-danger { color: #ef4444; }
body.light-mode .item-danger:hover { background: #fef2f2; color: #ef4444; }

/* Beige Mode */
body.beige-mode {
  --bg-base: #fdfaf5; --bg-card: #ffffff; --bg-elevated: #f7f2ea; --bg-hover: #efe7d9;
  --border: #e8dfd0; --border-hover: #d4a373;
  --text-primary: #433422; --text-secondary: #6b5a46; --text-muted: #9c8b77;
  --accent: #d4a373; --accent-glow: rgba(212, 163, 115, 0.15);
  --gradient: linear-gradient(135deg, #d4a373 0%, #bc8a5f 100%);
  --gradient-subtle: linear-gradient(135deg, #f7f2ea 0%, #efe7d9 100%);
}
body.beige-mode .logo-text, body.beige-mode .hero h1 { color: #433422; }
body.beige-mode .mode-card { border-color: #e8dfd0; }
body.beige-mode .panel-card { background: #fff; border-color: #e8dfd0; }

/* Blue Mode */
body.blue-mode {
  --bg-base: #0f172a; --bg-card: #1e293b; --bg-elevated: #334155; --bg-hover: #475569;
  --border: #334155; --border-hover: #38bdf8;
  --text-primary: #f8fafc; --text-secondary: #cbd5e1; --text-muted: #94a3b8;
  --accent: #38bdf8; --accent-glow: rgba(56, 189, 248, 0.25);
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #2dd4bf 100%);
}
body.blue-mode #ai-title, body.blue-mode #ai-caption { color: #ffffff !important; font-weight: 600; }
body.blue-mode .copy-field { background: rgba(0, 0, 0, 0.2); }


body { font-family:'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; background:var(--bg-base); color:var(--text-primary); min-height:100vh; -webkit-font-smoothing:antialiased; transition: background-color 0.4s ease, color 0.4s ease; }
/* Main Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-left .logo, .footer-left .logo { display: flex; align-items: center; gap: 0.4rem; }
.logo-img { height: 3.9rem; width: auto; object-fit: contain; transition: transform var(--transition); }
.logo-text { font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: -0.5px; }

.btn-theme-toggle, .btn-lang {
  width: 40px; height: 40px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: rgba(108, 99, 255, 0.1); }

.profile-btn { position: relative; cursor: pointer; }
.avatar {
  width: 40px; height: 40px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.profile-btn:hover .avatar { border-color: var(--accent); color: var(--accent); background: rgba(108, 99, 255, 0.1); }

/* Hero Section */
.hero { 
  text-align: center; 
  margin-bottom: 1rem; 
  max-width: 800px; 
  margin-left: auto; 
  margin-right: auto; 
  padding: 4rem 1rem 1rem; 
}
.hero h1 { 
    font-size: clamp(3rem, 8vw, 5.5rem); 
    font-weight: 900; 
    margin-bottom: 0.5rem; 
    letter-spacing: -2px; 
    color: #fff; 
    background: var(--gradient); 
    background-size: 200% auto;
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent; 
    filter: drop-shadow(0 15px 35px var(--accent-glow));
    animation: gradientShift 6s ease-in-out infinite;
    line-height: 1.1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero .tagline { 
    font-size: 1.5rem; 
    color: var(--text-secondary); 
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.6; 
}

.hero-import-container {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.6rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  max-width: 600px;
  margin: 0 auto 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.hero-import-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 10px 50px rgba(108, 99, 255, 0.25);
  background: var(--bg-hover);
}

.import-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.5rem 1.5rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.import-input::placeholder {
  color: var(--text-muted);
}

/* Removed problematic zoom: 1.2 */
#homepage-layout:not(.hidden) {
  width: 100%;
}

#editor-section:not(.hidden) {
  width: 100%;
}

#import-loading-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#import-loading-overlay:not(.hidden) .import-overlay-content {
  zoom: 1.8;
  background: rgba(28, 28, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.import-progress-fill {
  background: var(--gradient) !important;
  box-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent-glow);
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.import-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

.upload-page-container { flex: 1; display: flex; flex-direction: column; align-items: center; }
.upload-section-bottom { 
  width: 100%; 
  max-width: 600px; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  z-index: 20; 
  margin-top: 2rem;
}
.section { max-width:1200px; margin:0 auto; padding:1.5rem 2rem; }
.hidden { display:none !important; }

/* Mode Selection Grid */
.modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
  margin: 0.5rem auto 3rem;
  padding: 0 1rem;
}

@media(max-width: 1024px) {
  .hero-actions-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .modes-grid { 
    grid-template-columns: 1fr; 
    gap: 1.5rem; 
  }
}

@media(max-width: 768px) {
  .main-header {
    padding: 1rem;
  }
  .logo-text { font-size: 1.1rem; }
  .logo-img { height: 2.5rem; }
  .hero { padding: 2rem 1rem 1rem; }
  .hero .tagline { font-size: 1.1rem; }
  .feature-item { flex-direction: column !important; text-align: center; }
  .feature-visual { width: 100% !important; order: 2; }
  .feature-text { width: 100% !important; order: 1; margin-bottom: 2rem; }
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
}

.mode-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: 0;
}

.mode-card:hover::before {
  opacity: 0.03;
}

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

.mode-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.mode-icon {
  font-size: 4rem;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 15px var(--accent-glow));
}

.mode-card h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.mode-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 320px;
}

.mode-features {
  list-style: none;
  text-align: left;
  margin-bottom: 3rem;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.mode-features li {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mode-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 800;
}

/* Sections with Back Button */
.section-header-back {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}

.btn-back:hover { color: var(--accent); }

/* AI Specific Zones */
.ai-zone {
  border-style: solid;
  background: rgba(108, 99, 255, 0.05);
  border-color: rgba(108, 99, 255, 0.3);
}

.ai-zone:hover {
  background: rgba(108, 99, 255, 0.1);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease-out;
}
.modal.hidden {
  display: none !important;
}
.drop-zone {
  width:100%; max-width:600px;
  background:var(--bg-card); border:2px dashed var(--border); border-radius:16px;
  padding:4rem 2rem; text-align:center; cursor:pointer; transition:var(--transition);
}
.drop-zone:hover,.drop-zone.drag-over { border-color:var(--accent); background:rgba(108,99,255,.08); box-shadow:0 0 40px var(--accent-glow); transform:translateY(-2px); }
.upload-icon { color:var(--accent); margin-bottom:1.25rem; animation:float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.drop-zone h2 { font-size:1.4rem; font-weight:600; margin-bottom:.35rem; }
.drop-zone p { color:var(--text-secondary); font-size:.9rem; }
.file-hint { margin-top:.75rem; color:var(--text-muted) !important; font-size:.8rem !important; }
.upload-progress { margin-top:1.5rem; background:var(--bg-card); border-radius:var(--radius); padding:1.25rem; border:1px solid var(--border); }
.progress-info { display:flex; justify-content:space-between; margin-bottom:.75rem; font-size:.85rem; }
.progress-info span:first-child { color:var(--text-secondary); font-weight:500; }
.progress-info span:last-child { color:var(--accent); font-weight:600; }
.progress-bar { height:6px; background:var(--bg-elevated); border-radius:100px; overflow:hidden; }
.progress-fill { height:100%; background:var(--gradient); border-radius:100px; transition:width .3s ease; width:0%; }
.progress-fill-animated { position:relative; overflow:hidden; }
.progress-fill-animated::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent); animation:shimmer 1.5s infinite; }
@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.editor-layout { display:grid; grid-template-columns:1fr 340px; gap:1.5rem; align-items:start; }
@media(max-width:900px) { .editor-layout{grid-template-columns:1fr} }
.preview-panel { display:flex; flex-direction:column; gap:1rem; }
.panel-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:.25rem; }
.panel-header h3 { font-size:1rem; font-weight:600; }
.badge { font-size:.72rem; padding:.25rem .6rem; background:var(--bg-elevated); border:1px solid var(--border); border-radius:100px; color:var(--text-secondary); font-weight:500; }
.badge-accent { background:rgba(108,99,255,.12); border-color:rgba(108,99,255,.25); color:var(--accent); }
.video-container { position:relative; background:#000; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); aspect-ratio:16/9; }
#video-preview { width:100%; height:100%; display:block; object-fit:contain; }
#crop-canvas { position:absolute; top:0; left:0; width:100%; height:100%; cursor:crosshair; }
.crop-legend { position:absolute; bottom:8px; left:8px; right:8px; display:flex; gap:1rem; font-size:.7rem; font-weight:600; }
.legend-item { padding:.2rem .5rem; border-radius:4px; background:rgba(0,0,0,.7); backdrop-filter:blur(4px); }
.legend-webcam { color:var(--webcam-color); }
.legend-screen { color:var(--screen-color); }
.crop-hint { margin-left:auto; color:var(--text-muted); padding:.2rem .5rem; border-radius:4px; background:rgba(0,0,0,.7); font-weight:400; }

.central-controls {
  justify-content: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  align-items: flex-end;
}
.control-group { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.control-label { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.5px; }

.range-playback-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.video-scrubber-container { display:flex; align-items:center; gap:1rem; margin-top:0.75rem; margin-bottom:0.75rem; background:var(--bg-card); padding:0.5rem 1rem; border-radius:var(--radius); border:1px solid var(--border); }
.video-scrubber-container input[type="range"] { flex:1; }
.scrubber-time { font-size:0.75rem; color:var(--text-secondary); width:80px; text-align:right; font-variant-numeric:tabular-nums; }
.timeline-panel { background:var(--bg-card); border-radius:var(--radius); padding:1rem 1.25rem; border:1px solid var(--border); }
.timeline-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.75rem; }
.timeline-header h4 { font-size:.9rem; font-weight:600; }
.timeline-controls { display:flex; align-items:center; gap:1rem; margin-bottom:.75rem; }
.time-control-group { display:flex; flex-direction:column; gap:.4rem; min-width:110px; }
.time-control-group label { font-size:.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.8px; font-weight:700; text-align: center; }
.modern-time-adjuster { 
  display: flex; align-items: center; background: var(--bg-elevated); 
  border: 1px solid var(--border); border-radius: 10px; height: 38px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modern-time-adjuster:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.time-btn { 
  width: 32px; height: 100%; border: none; background: transparent; 
  color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; 
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.time-btn:hover { background: var(--bg-hover); color: var(--accent); }
.time-btn:active { background: var(--accent-glow); }
.time-display { 
  flex: 1; min-width: 0; width: 45px; border: none; background: transparent; 
  color: var(--text-primary); font-size: 0.9rem; font-weight: 700; text-align: center; 
  font-family: 'Inter', sans-serif; appearance: textfield; -moz-appearance: textfield;
}
.time-display::-webkit-inner-spin-button, .time-display::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.time-display:focus { outline: none; }
.range-slider-wrapper { flex: 1; display: flex; flex-direction: column; gap: 4px; position: relative; padding-top: 25px; }
.timeline-labels-container { position: absolute; top: 0; left: 0; right: 0; height: 20px; pointer-events: none; }
.floating-time-label { 
  position: absolute; transform: translateX(-50%); 
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; 
  padding: 2px 6px; border-radius: 6px; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(108,99,255,0.3);
  transition: opacity 0.2s;
}
.floating-time-label::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--accent);
}

.range-slider-container { position:relative; height:12px; background:var(--bg-elevated); border-radius:100px; overflow:visible; border:1px solid var(--border); margin: 0; cursor: pointer; }
.timeline-ticks { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 0 9px; pointer-events: none; }
.tick { width: 1px; background: var(--border); height: 4px; position: absolute; bottom: 0; }
.tick-major { height: 8px; background: var(--text-muted); width: 1.5px; }

.timeline-limits { display: flex; justify-content: space-between; margin-top: 4px; }
.limit-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }

.range-slider-container input[type="range"] { position:absolute; width:100%; top:50%; transform:translateY(-50%); -webkit-appearance:none; appearance:none; background:transparent; pointer-events:none; height:100%; margin:0; z-index: 5; }
.range-slider-container input[type="range"]::-webkit-slider-thumb { 
  -webkit-appearance:none; width:16px; height:16px; background:#fff; 
  border-radius:4px; cursor:pointer; pointer-events:auto; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.5); border: 1.5px solid var(--accent);
  transition: transform 0.1s;
}
.range-slider-container input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1) translateY(-1px); }
.range-slider-container input[type="range"]::-webkit-slider-runnable-track { height:100%; background:transparent; }
.playback-controls { display:flex; gap:.5rem; align-items:center; }
.settings-panel { display:flex; flex-direction:column; gap:1rem; }
.panel-card { background:var(--bg-card); border-radius:var(--radius); padding:1rem 1.25rem; border:1px solid var(--border); }
.panel-card .panel-header { margin-bottom:.75rem; }
.output-preview-container { display:flex; flex-direction:column; align-items:center; gap:.5rem; }
.output-preview { position:relative; width:140px; height:249px; border-radius:10px; overflow:hidden; border:2px solid var(--border); display:flex; flex-direction:column; background:#000; }
#output-canvas { position:absolute; inset:0; width:100%; height:100%; z-index:10; pointer-events:none; object-fit:contain; }
.preview-section { display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:700; text-transform:uppercase; letter-spacing:1px; text-align:center; padding:0 4px; }
.preview-webcam { flex:42; background:var(--bg-card); color:var(--webcam-color); }
.preview-divider { 
  position: absolute;
  top: 42%; /* Matches flex:42 of webcam */
  left: 0;
  right: 0;
  height: 4px; /* Slightly thicker and absolute */
  background: var(--accent); 
  z-index: 20; 
  pointer-events: none;
  box-shadow: 0 0 15px var(--accent-glow);
}
.preview-screen { flex:58; background:var(--bg-card); color:var(--screen-color); }
.output-size { font-size:.72rem; color:var(--text-muted); font-weight:500; }
.setting-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.5rem 0; }
.setting-col { display:flex; flex-direction:column; gap:.5rem; padding:.5rem 0; }
.setting-col label { font-size:.85rem; font-weight:500; }
.setting-row+.setting-row, .setting-row+.setting-col { border-top:1px solid rgba(255,255,255,.04); }
.setting-row label { font-size:.85rem; font-weight:500; }
.setting-row label small { display:block; color:var(--text-muted); font-size:.7rem; font-weight:400; margin-top:.15rem; }
.slider-with-value { display:flex; align-items:center; gap:.75rem; }
.slider-value { min-width:55px; text-align:right; font-size:.82rem; font-weight:600; color:var(--accent); }
input[type="range"].standard-slider::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; background:var(--accent); border-radius:50%; cursor:pointer; box-shadow:0 0 10px var(--accent-glow); border: 2px solid #fff; }
.text-input { width:100%; background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-primary); padding:.6rem .75rem; font-size:.85rem; font-family:'Inter',sans-serif; }
.text-input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.emoji-palette { display:flex; gap:0.6rem; margin-bottom:0.5rem; flex-wrap: wrap; align-items: center; position: relative; }
.emoji-btn { 
  cursor:pointer; padding:0; border-radius:8px; background:var(--bg-elevated); 
  transition:var(--transition); border:1px solid var(--border); 
  display: flex; align-items: center; justify-content: center; 
  width: 42px; height: 42px; font-size: 1.5rem; overflow: hidden;
}
.emoji-btn img { width: 70%; height: 70%; object-fit: contain; }
.emoji-btn:hover { background:var(--bg-hover); transform:scale(1.1); border-color: var(--accent); }
.emoji-btn-plus { 
  background: var(--bg-hover); color: var(--accent); font-weight: bold; 
  border: 1px dashed var(--accent); font-size: 1.2rem;
  position: relative;
}
/* Font Selector Improvements */
.font-selector-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.font-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.font-option {
  padding: 10px;
  background: var(--bg-card);
}

/* Floating Emoji Picker */
.emoji-palette-container {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 320px;
  height: 400px;
  background: rgba(20, 20, 42, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  z-index: 5000;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  animation: pickerAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes pickerAppear {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.emoji-palette-header {
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.emoji-categories-nav {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 4px;
}
.category-tab {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}
.category-tab:hover { opacity: 1; background: rgba(255,255,255,0.05); }
.category-tab.active { opacity: 1; background: rgba(108,99,255,0.15); }

.emoji-palette-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scroll-behavior: smooth;
}
.emoji-category-section { margin-bottom: 16px; }
.emoji-category-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  position: sticky;
  top: -12px;
  background: rgba(20, 20, 42, 0.95);
  padding: 4px 0;
  z-index: 2;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.emoji-item {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.emoji-item:hover { background: rgba(255,255,255,0.1); transform: scale(1.15); }
.emoji-item img { width: 28px; height: 28px; object-fit: contain; }

.toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.toggle-sm { width:34px; height:18px; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:var(--bg-elevated); border-radius:100px; cursor:pointer; transition:var(--transition); border:1px solid var(--border); }
.toggle-slider::before { content:''; position:absolute; left:3px; top:3px; width:16px; height:16px; background:var(--text-muted); border-radius:50%; transition:var(--transition); }
.toggle-sm .toggle-slider::before { width:12px; height:12px; top:2px; left:2px; }
.toggle input:checked+.toggle-slider { background:rgba(108,99,255,.2); border-color:var(--accent); }
.toggle input:checked+.toggle-slider::before { transform:translateX(20px); background:var(--accent); }
.toggle-sm input:checked+.toggle-slider::before { transform:translateX(16px); }
.output-preview-controls { display:flex; flex-direction:column; align-items:center; gap:.4rem; width:100%; }
.output-size { font-size:.72rem; color:var(--text-muted); font-weight:500; }
.size-control { display:flex; align-items:center; gap:0.5rem; margin-top:0.5rem; }
.color-input { -webkit-appearance:none; appearance:none; width:36px; height:28px; border:2px solid var(--border); border-radius:6px; cursor:pointer; background:none; padding:0; }
.color-input::-webkit-color-swatch-wrapper { padding:2px; }
.color-input::-webkit-color-swatch { border:none; border-radius:3px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; padding:.55rem 1rem; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-elevated); color:var(--text-primary); cursor:pointer; font-family:'Inter',sans-serif; font-size:.82rem; font-weight:500; transition:var(--transition); text-decoration:none; }
.btn:hover { background:var(--bg-hover); border-color:var(--border-hover); transform:translateY(-1px); }
.btn-icon { width:34px; height:34px; padding:0; font-size:1rem; }
.btn-sm { padding:.35rem .7rem; font-size:.75rem; }
.btn-primary { background:var(--gradient); border:none; color:#fff; font-weight:600; box-shadow:0 4px 20px var(--accent-glow); }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 6px 30px rgba(108,99,255,.4); }
.btn-success { background:linear-gradient(135deg,#22c55e,#16a34a); border:none; color:#fff; font-weight:600; }
.btn-success:hover { box-shadow:0 4px 20px rgba(34,197,94,.3); }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text-secondary); }
.btn-large { width:100%; padding:.85rem 1.25rem; font-size:.95rem; border-radius:var(--radius); }
.btn-icon-left { font-size:1.1rem; }
.processing-section { background:var(--bg-card); border-radius:var(--radius); padding:1rem 1.25rem; border:1px solid var(--border); }
.download-section { background:var(--bg-card); border-radius:var(--radius); padding:1.5rem 1.25rem; border:1px solid rgba(34,197,94,.2); text-align:center; display:flex; flex-direction:column; align-items:center; gap:.75rem; }
.download-section .success-icon { font-size:2rem; }
.download-section p { color:var(--text-secondary); font-weight:500; }
.editor-section { animation:fadeInUp .5s ease; }
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--bg-base); }
::-webkit-scrollbar-thumb { background:var(--bg-hover); border-radius:100px; }
::-webkit-scrollbar-thumb:hover { background:var(--accent); }

/* Zoom Styles */
.output-preview-container.zoom-active {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  z-index: 2000;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 100px rgba(0,0,0,0.9);
  border: 2px solid var(--accent);
}
.output-preview-container.zoom-active .output-preview {
  width: 320px;
  height: 568px;
}
.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 1999;
  display: none;
}
.zoom-overlay.active {
  display: block;
}
.btn-xs { padding: 0.2rem 0.4rem; font-size: 0.7rem; }

/* General Modal Styles */
.modal { position: fixed; inset: 0; z-index: 20000; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.3s ease; animation: fadeInModal 0.3s ease; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }
.modal.hidden { display: none; opacity: 0; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); }
.modal-content { 
  position: relative; width: 90%; max-width: 450px; 
  background: #1c1c1e; border-radius: 24px; overflow: hidden; 
  display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalScaleUp { from { transform: scale(0.9) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-header { 
  padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); 
  display: flex; justify-content: space-between; align-items: center; 
}
.modal-header h3 { 
  font-size: 1.25rem; font-weight: 700; 
  background: var(--gradient); 
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent; 
}

.modal-body { padding: 1.5rem; flex: 1; }
.modal-hint { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.25rem; }

.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); }



/* Resolution Specific */
.resolution-options { display: flex; flex-direction: column; gap: 0.75rem; }
.res-option { 
  display: flex; align-items: center; justify-content: space-between; 
  padding: 1rem 1.25rem; border-radius: 12px; border: 1px solid var(--border); 
  background: var(--bg-elevated); cursor: pointer; transition: all 0.2s;
}
.res-option:hover:not(.disabled) { border-color: var(--accent); background: var(--bg-hover); transform: translateX(4px); }
.res-option.selected { border-color: var(--accent); background: rgba(108,99,255,0.15); box-shadow: 0 0 15px var(--accent-glow); }
.res-option.disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); }
.res-info { display: flex; flex-direction: column; gap: 0.1rem; }
.res-label { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.res-dimensions { font-size: 0.75rem; color: var(--text-muted); }
.res-badge { font-size: 0.65rem; font-weight: 800; padding: 0.15rem 0.4rem; border-radius: 4px; background: var(--bg-hover); color: var(--text-secondary); }
.res-option.selected .res-badge { background: var(--accent); color: #fff; }

/* Profile Menu */
.profile-menu {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(30px);
  animation: slideTop 0.3s ease;
  z-index: 1001;
}
.profile-info { padding-bottom: 0.75rem; text-align: left; }
.profile-name { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; font-size: 1rem; }
.profile-email { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.profile-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }
.profile-item {
  width: 100%; text-align: left; background: none; border: none;
  padding: 0.6rem 0.8rem; font-size: 0.9rem; color: #ff5f5f; font-weight: 600;
  border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.profile-item:hover { background: rgba(255, 95, 95, 0.1); }

/* Onboarding & Verification Specifics */
.onboarding-content, .verification-content, .welcome-content { max-width: 420px; text-align: center; padding: 2.5rem; }
.form-group { text-align: left; margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.code-input { font-size: 2rem; font-weight: 800; text-align: center; letter-spacing: 8px; color: var(--accent); padding: 1.25rem !important; }
.welcome-badge { font-size: 4rem; margin-bottom: 1.25rem; display: block; animation: bounce 2s infinite; }
.welcome-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; color: var(--text-primary); }
.welcome-content p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.6; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes slideTop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Hero Section Adjustments */
.hero h1 { 
  background: var(--gradient); 
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent; 
}

/* Modal Footer Fix */
.modal-footer .btn-large { width: 100%; justify-content: center; }
/* -- Button Loading State -- */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* -- Success Animation (Checkmark) -- */
.success-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}
.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4bb543;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #4bb543;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4bb543;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0px 0px 0px 40px #4bb5430a; } }

/* -- Settings Modal Styles -- */
.settings-content {
    max-width: 500px;
}
.settings-group {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.info-item {
    margin-bottom: 1.25rem;
}
.info-item:last-child { margin-bottom: 0; }
.info-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.info-item p {
    font-size: 1rem;
    font-weight: 500;
}
.plan-badge {
    background: var(--primary-color);
    color: #fff;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.danger-zone {
    border: 1px solid rgba(255, 68, 68, 0.2);
    background: rgba(255, 68, 68, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}
.danger-zone h4 {
    color: #ff4444;
    margin-bottom: 0.5rem;
}
.danger-zone p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.btn-danger-text {
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.3);
}
.btn-danger-text:hover {
    background: #ff4444;
    color: #fff;
    border-color: #ff4444;
}

.warning-box {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 4px;
}
.warning-box p { font-size: 0.95rem; line-height: 1.5; }

/* Header SaaS elements */
.lang-selector { position: relative; }
.btn-lang { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0.5rem; border-radius: 50%; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.btn-lang:hover { background: var(--bg-hover); color: var(--accent); }
.dropdown-menu { 
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-card); 
  border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem; 
  min-width: 140px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 1002;
  backdrop-filter: blur(20px);
}
.dropdown-menu button { 
  width: 100%; text-align: left; background: none; border: none; padding: 0.6rem 0.8rem; 
  color: var(--text-primary); cursor: pointer; border-radius: 6px; font-size: 0.85rem; transition: var(--transition);
}
.dropdown-menu button:hover { background: var(--bg-hover); color: var(--accent); }

/* Prominent Language Selector */
.prominent-lang {
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition);
}
.prominent-lang:hover {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.12);
}
/* Compact Hero Actions Grid (Premium Redesign) */
.hero-actions-grid {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-action-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-inner, .premium-upload-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-inner:hover, .premium-upload-box:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(108, 99, 255, 0.15);
}

.hero-action-card h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
}

.hero-import-wrap {
    display: flex;
    gap: 0.75rem;
}

.hero-import-wrap .import-input {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.premium-upload-box {
    cursor: pointer;
    text-align: center;
    border: 1px dashed var(--border);
}

.upload-icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    transition: var(--transition);
}

.premium-upload-box:hover .upload-icon-circle {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

.premium-upload-box .drop-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 800px) {
    .hero-actions-grid {
        flex-direction: column;
        padding: 1rem;
    }
}
.lang-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Legal & Info Content */
.legal-content {
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.legal-text-body {
    overflow-y: auto;
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-right: 1rem;
}
.legal-text-body h4 {
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}
.legal-text-body p {
    margin-bottom: 1rem;
}
.legal-text-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
}
.legal-text-body li {
    margin-bottom: 0.5rem;
}

.auth-buttons { display: flex; gap: 0.75rem; }

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner .6s linear infinite;
}
@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Footer */
.main-footer { background: var(--bg-base); border-top: 1px solid var(--border); padding: 4rem 2.5rem 2rem; margin-top: 4rem; width: 100%; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
@media (max-width: 768px) { .footer-content { grid-template-columns: 1fr; gap: 2rem; } }
.footer-tagline { color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; max-width: 300px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-socials a { color: var(--text-muted); transition: var(--transition); }
.footer-socials a:hover { color: var(--accent); transform: translateY(-3px); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* Pricing Overhaul */
.pricing-content { max-width: 1000px; padding: 2.5rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; align-items: stretch; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }

.plan-card { 
  background: rgba(255, 255, 255, 0.03); 
  border: 1px solid rgba(255, 255, 255, 0.08); 
  border-radius: 24px; padding: 2.5rem 2rem; 
  display: flex; flex-direction: column; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  position: relative; overflow: hidden;
}

.plan-card:hover { transform: translateY(-10px); border-color: rgba(108, 99, 255, 0.4); box-shadow: 0 20px 40px rgba(0,0,0,0.4); background: rgba(255, 255, 255, 0.05); }

.plan-card.featured { 
  background: rgba(108, 99, 255, 0.05); 
  border: 2px solid var(--accent); 
  box-shadow: 0 0 30px rgba(108, 99, 255, 0.15);
  transform: scale(1.05);
}

.plan-card.featured:hover { transform: scale(1.05) translateY(-10px); }

.most-popular {
  position: absolute; top: 22px; right: -42px;
  width: 160px;
  background: var(--gradient); color: #fff;
  font-size: 0.7rem; font-weight: 800; padding: 0.5rem 0;
  transform: rotate(45deg); text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10; letter-spacing: 0.1em;
  text-align: center;
  pointer-events: none;
}

.plan-header { margin-bottom: 2rem; }
.plan-header h4 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.plan-desc { color: var(--text-muted); font-size: 0.85rem; }

.price { 
  font-size: 2.6rem; font-weight: 800; color: var(--text-primary); 
  margin: 1rem 0; display: flex; align-items: baseline; 
  gap: 0.2rem; flex-wrap: wrap; line-height: 1.2;
}
.price span { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }

.plan-features { list-style: none; margin-bottom: 2.5rem; flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.plan-features li { 
  font-size: 0.88rem; color: var(--text-secondary); 
  display: flex; align-items: flex-start; gap: 0.8rem; 
  line-height: 1.4;
}
.plan-features li i { 
  font-style: normal; font-weight: 700; font-size: 0.9rem;
  min-width: 18px; text-align: center;
}
.plan-features li:not(.faint) i { color: var(--accent); }
.plan-features li.faint { opacity: 0.25; filter: grayscale(1); }
.plan-features li.faint i { color: var(--text-muted); }
.plan-features li strong { color: #fff; font-weight: 600; }

/* Advanced AI Results */
.viral-score-card {
  width: 100%; max-width: 400px; background: rgba(108, 99, 255, 0.08); 
  border-radius: 16px; padding: 1.25rem; margin-bottom: 1.5rem; 
  border: 1px solid rgba(108, 99, 255, 0.2);
}
.score-header { display: flex; justify-content: space-between; margin-bottom: 0.75rem; font-weight: 700; font-size: 0.9rem; }
#viral-score-value { color: var(--accent); font-size: 1.1rem; }
.score-bar-bg { height: 8px; background: rgba(255,255,255,0.05); border-radius: 100px; overflow: hidden; margin-bottom: 0.75rem; }
.score-bar-fill { height: 100%; background: var(--gradient); width: 0%; transition: width 1.5s cubic-bezier(0.1, 0, 0.1, 1); }
.score-explanation { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.social-post-generator { width: 100%; max-width: 400px; text-align: left; margin-bottom: 2rem; }
.social-post-generator h4 { font-size: 0.9rem; margin-bottom: 1rem; color: #fff; }
.post-item { margin-bottom: 1rem; }
.post-item label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 0.4rem; display: block; }
.copy-field { 
  display: flex; align-items: center; justify-content: space-between; 
  background: var(--bg-elevated); border: 1px solid var(--border); 
  padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.85rem; color: var(--text-primary);
  font-weight: 500;
}
#ai-title, #ai-caption { word-break: break-word; }
.metric-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

.btn-copy { background: none; border: none; cursor: pointer; opacity: 0.6; transition: 0.2s; font-size: 1rem; }
.btn-copy:hover { opacity: 1; transform: scale(1.1); }

/* Credits Top-up */
.credits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.credit-option { 
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; 
  padding: 1.5rem 1rem; text-align: center; cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.credit-option:hover { border-color: var(--accent); background: rgba(108, 99, 255, 0.05); }
.credit-option.featured { border-color: var(--accent); background: rgba(108, 99, 255, 0.1); }
.credit-option .mins { font-weight: 700; font-size: 1.1rem; color: #fff; }
.credit-option .price { font-size: 1.2rem; color: var(--accent); margin: 0; }
.btn-full { width: 100%; }

/* Dashboard */
.dashboard-content { max-width: 800px; height: 80vh; overflow-y: auto; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.project-item { 
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; 
  display: flex; flex-direction: column; gap: 0.75rem; transition: var(--transition); cursor: pointer;
}
.project-item:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--bg-hover); }
.project-thumb { aspect-ratio: 9/16; background: #000; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.5rem; overflow: hidden; }
.project-thumb svg { width: 40px; height: 40px; }
.project-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.project-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; }

/* Auth & Payment Card Redesign */
.auth-content-wrapper { 
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 3rem 2.5rem;
  width: 100%; 
  max-width: 480px; /* Fixed professional width for desktop */
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 40px rgba(108, 99, 255, 0.2);
  position: relative;
  margin: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 580px) {
  .auth-content-wrapper {
    padding: 2.5rem 1.75rem;
    max-width: 100%;
    border-radius: 20px;
    margin: 1rem;
  }
}

.auth-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}
.auth-modal-close:hover {
  opacity: 0.7;
  transform: scale(1.1);
}


/* Specific view adjustments if any */
#onboarding-view, #login-view, #forgot-email-view {
  width: 100%;
}

.auth-view .modal-header h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: -0.5px;
}

.auth-view .modal-body {
  margin-top: 1.5rem;
  text-align: left;
}

.auth-view .form-group {
  margin-bottom: 1.25rem;
}

.auth-view .form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-bottom: 0.5rem;
}

.auth-view .modal-footer {
  margin-top: 1rem;
}

.auth-view .btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
}

.modal-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.code-input {
  letter-spacing: 0.5rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--accent);
  margin: 1rem 0;
}

.modal-note { margin-top: 1.25rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.modal-note a { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }
.modal-note a:hover { text-decoration: underline; }
.payment-methods { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.payment-btn { flex: 1; padding: 0.75rem; border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 10px; color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-weight: 600; }
.payment-btn.active { border-color: var(--accent); background: rgba(108, 99, 255, 0.1); color: var(--accent); }
.item-danger { color: var(--error) !important; }
.item-danger:hover { background: rgba(239, 68, 68, 0.1) !important; }

.btn-close-modal { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.btn-close-modal:hover { color: #fff; transform: rotate(90deg); }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }

/* Success Checkmark Animation */
.success-animation {
  text-align: center;
  padding: 3rem 2rem !important;
}

.success-icon-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
}

.checkmark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: var(--success);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--success);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: #fff;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
  100% { box-shadow: inset 0px 0px 0px 50px var(--success); }
}

.welcome-content h2 {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
}
/* -- Legal/Info Modal Styles -- */

/* -- Legal/Info Modal Styles -- */
.legal-content { max-width: 600px; max-height: 85vh; }
.legal-text-body { overflow-y: auto; line-height: 1.6; color: #d1d1d6; }
.legal-text-body h4 { color: #ffffff; margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }
.legal-text-body h5 { color: #ffffff; margin: 1rem 0 0.4rem; font-size: 1rem; }
.legal-text-body p { margin-bottom: 1rem; }
.legal-text-body ul { margin-bottom: 1rem; padding-left: 1.5rem; }
.legal-text-body li { margin-bottom: 0.5rem; }
.info-section { padding-bottom: 1rem; }
.warning-box { background: rgba(255, 159, 10, 0.1); border-left: 4px solid #ff9f0a; padding: 1rem; border-radius: 4px; }

/* Homepage Enhancement: Features & FAQ */
.homepage-extra {
  margin-top: 4rem;
  width: 100%;
}

.feature-showcase {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  margin-bottom: 5rem;
  padding: 0 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6rem;
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feature-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

.feature-item.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 1;
}

.feature-text h3 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.feature-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 500px;
}

.feature-visual {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.feature-text .feature-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 1rem;
  letter-spacing: 0.05rem;
}

.feature-list {
  list-style: none;
  margin-top: 1.5rem;
  padding-left: 0;
}

.feature-list li {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-visual.product-mockup {
  flex: 1.4;
  perspective: 2000px;
  position: relative;
}

.feature-image-wrapper {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-card);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s;
}

.feature-image-wrapper:hover {
  transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 30px rgba(108, 99, 255, 0.3);
}

.feature-asset {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.feature-image-wrapper img,
.feature-image-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.95;
  transition: opacity 0.3s;
}

.feature-image-wrapper:hover img,
.feature-image-wrapper:hover video {
  opacity: 1;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
  pointer-events: none; /* Let clicks pass to video if needed */
}

.feature-image-wrapper:hover .play-overlay {
  background: rgba(0, 0, 0, 0);
}

.play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px var(--accent);
  transition: transform 0.3s, background 0.3s;
}

.feature-image-wrapper:hover .play-icon {
  transform: scale(1.1);
  background: var(--accent);
}

/* FAQ Section */
.faq-section {
  padding-bottom: 8rem;
}

.container-small {
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4rem;
  color: #fff;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.faq-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(108, 99, 255, 0.3);
}

.faq-question {
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.faq-question .arrow {
  font-size: 0.8rem;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.faq-item.active .faq-question .arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s;
}

.faq-item.active .faq-content {
  max-height: 500px;
  padding-bottom: 1.5rem;
}

.faq-content p {
  padding: 0 2rem 1.5rem 2rem;
  color: #e0e0e0; /* Improved contrast for dark background */
  line-height: 1.6;
  font-size: 1rem;
}

@media (max-width: 900px) { .feature-item, .feature-item.reverse {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
  .feature-text p {
    margin: 0 auto;
  }
  .feature-showcase {
    gap: 6rem;
  }
}

@media (max-width: 480px) {
  .auth-content-wrapper {
    padding: 2rem 1.5rem;
    width: 95%;
  }
}

/* --- New UI/UX Improvements --- */

/* Improved Login/Profile Button */
.nav-btn-login {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-btn .avatar {
    border: 2px solid var(--accent);
    padding: 2px;
    background: var(--bg-card);
    transition: all var(--transition);
}

.profile-btn:hover .avatar {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Custom Color Picker */
.color-picker-content {
    background: var(--bg-card);
    border: 1px solid var(--accent);
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.custom-color-input label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.hex-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.hex-input-wrapper input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: monospace;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.hex-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--accent);
}

/* Font Selector Modal */
.font-selector-content {
    max-width: 400px;
}

.font-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.font-item {
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.font-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.font-item.active {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.1);
}

.font-preview-text {
    font-size: 1.2rem;
}

/* Home Confirmation Modal */
.footer-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Emoji Picker Fix */
#emoji-picker-body {
    max-height: 350px;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

#emoji-picker-body::-webkit-scrollbar {
    width: 6px;
}

#emoji-picker-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Logo Clickable */
.logo.clickable {
    cursor: pointer;
}

.logo.clickable:hover .logo-text {
    color: var(--accent);
}

.upload-modal-content {
    max-width: 600px;
    width: 90%;
}

.upload-modal-content .modal-body {
    padding: 2.5rem;
}

.upload-modal-content .drop-zone {
    border-style: dashed;
    background: rgba(108, 99, 255, 0.05);
}

.upload-modal-content .drop-zone:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* Welcome Success Animation */
.success-animation {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #4bb71b;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #4bb71b;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #4bb71b;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 40px #4bb71b; }
}
/* --- Import Flow Extensions --- */

/* Import Overlay */
.import-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

.import-overlay-content {
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.spinner-premium {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(108, 99, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 2rem;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 30px var(--accent-glow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.import-overlay h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#import-platform-text {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 2rem;
}

.import-progress-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.import-progress-fill {
  height: 100%;
  background: var(--gradient);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px var(--accent-glow);
}

#import-progress-percent {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.import-hint {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Tool Selection Modal */
.tool-selection-content {
  max-width: 700px;
}

.import-preview-box {
  width: 100%;
  height: 160px;
  background: var(--bg-elevated);
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
}

.import-preview-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.video-info-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#import-video-title {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.platform-badge {
  padding: 0.3rem 0.8rem;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.05);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.tool-card h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
}

.tool-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .tool-choice-grid {
    grid-template-columns: 1fr;
  }
}

.modal-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.modal-separator::before,
.modal-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.modal-separator span {
  padding: 0 1rem;
}

.modal-link-import .hero-import-container {
  margin-bottom: 0;
  max-width: 100%;
}

/* --- Improved Download UI --- */
.import-thumbnail-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16/9;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
  background: #000;
}

.import-thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.import-stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.import-meta-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.import-meta-text::before {
  content: '•';
  color: var(--accent);
  font-size: 1.2rem;
}

.import-thumbnail-after {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16/9;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #000;
  margin: 0 auto 2rem;
  display: block;
}

.tool-preview-section {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.video-info-center {
  margin-top: 1rem;
}

.video-info-center h4 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 700;
  display: block;
  line-height: 1.3;
}


.import-preview-box {
  display: none; /* Hide old class if still referenced */
}

/* =====================================================
   AUTOMATIC CLIP MAKER — COMING SOON STATE
   ===================================================== */

/* Card shell */
.mode-card--coming-soon {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.88;
  border-color: rgba(108, 99, 255, 0.25) !important;
  background: var(--bg-card) !important;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}
.mode-card--coming-soon:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(108, 99, 255, 0.15);
}

/* Shimmer sweep across card on hover */
.mode-card--coming-soon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(108,99,255,0.07) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.mode-card--coming-soon:hover::after {
  transform: translateX(100%);
}

/* WIP Badge */
.mode-badge--wip {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%) !important;
  color: #fff !important;
  font-size: 0.6rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: wip-pulse 2.5s ease-in-out infinite;
}
@keyframes wip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0.18); }
}

/* Gear icon — slow spin */
.mode-icon--spin-wrap {
  display: inline-block;
  line-height: 1;
}
.mode-icon--gear {
  display: inline-block;
  font-size: 2.5rem;
  animation: gear-spin 5s linear infinite;
  transform-origin: center;
  filter: grayscale(0.4);
}
@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Muted feature list */
.mode-features--muted li {
  color: var(--text-muted) !important;
  opacity: 0.7;
}
.mode-features--muted li::before {
  filter: grayscale(1);
}

/* Coming-soon progress bar at the bottom */
.coming-soon-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 0.65rem 1rem;
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius);
}
.coming-soon-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

/* Animated bouncing dots */
.coming-soon-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.coming-soon-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-bounce 1.4s ease-in-out infinite;
}
.coming-soon-dots span:nth-child(1) { animation-delay: 0s; }
.coming-soon-dots span:nth-child(2) { animation-delay: 0.2s; }
.coming-soon-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1.2); opacity: 1; }
}

/* Light mode adjustments */
body.light-mode .mode-card--coming-soon {
  border-color: rgba(108, 99, 255, 0.15) !important;
}
body.light-mode .coming-soon-bar {
  background: rgba(108,99,255,0.04);
}

/* Toast notification for coming-soon clicks */
.coming-soon-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a35;
  color: #e8e6f0;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(108,99,255,0.3);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.coming-soon-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
body.light-mode .coming-soon-toast {
  background: #fff;
  color: #1e1e2f;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border-color: rgba(108,99,255,0.2);
}


/* =====================================================
   TYPEWRITER ANIMATION
   ===================================================== */
.typewriter-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

#typewriter-text {
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.3px;
}

.typewriter-cursor {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--accent);
  animation: cursor-blink 0.7s steps(1) infinite;
  margin-left: 1px;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@media (max-width: 640px) {
  #typewriter-text {
    font-size: 0.85rem;
  }
  .typewriter-container {
    min-height: 1.6rem;
  }
}

/* Unified Import Quality Selection Styles */
.tool-card--ai { position: relative; }
.tool-badge--wip {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255, 193, 7, 0.15); color: #ffc107;
  padding: 4px 10px; border-radius: 100px;
  font-size: 0.65rem; font-weight: 800; border: 1px solid rgba(255,193,7,0.3);
  letter-spacing: 0.5px;
}

.quality-step-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.btn-back-tool { background: none; border: none; color: var(--text-muted); cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.btn-back-tool:hover { color: var(--accent); }
#quality-step-title { font-size: 1.1rem; color: #fff; }

.quality-options-grid { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.quality-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem 1.4rem; 
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(108, 99, 255, 0.1); 
  border-radius: 16px;
  cursor: pointer; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.quality-option:hover { 
  transform: translateX(6px) scale(1.01); 
  border-color: var(--accent); 
  background: rgba(108, 99, 255, 0.08); 
  box-shadow: 0 10px 25px rgba(0,0,0,0.3), 0 0 15px var(--accent-glow);
}
.quality-option.selected { 
  border-color: var(--accent); 
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%); 
  box-shadow: 0 0 25px var(--accent-glow); 
}

.quality-main { display: flex; flex-direction: column; gap: 4px; }
.quality-title-row { display: flex; align-items: center; gap: 10px; }
.quality-label { font-weight: 700; color: #fff; font-size: 1rem; }
.quality-hint { font-size: 0.75rem; color: var(--text-secondary); opacity: 0.8; font-weight: 400; }
.quality-option:hover .quality-hint { color: #fff; opacity: 1; }
.quality-meta { font-size: 0.75rem; color: var(--text-muted); }
.quality-badge { font-size: 0.65rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,0.05); color: var(--text-secondary); }

#import-video-title {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.loading-qualities { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; }
.spinner-sm { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   MOBILE RESPONSIVE REFINEMENTS (Premium Feel)
   ===================================================== */
@media (max-width: 768px) {
  :root {
    --radius-lg: 12px;
  }
  
  .main-header {
    padding: 0.75rem 1rem;
  }
  
  .logo-img {
    height: 2.5rem;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
  
  .auth-buttons {
    gap: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  /* Hero Section */
  .hero {
    padding: 2.5rem 1rem 1rem;
  }
  
  .hero h1 {
    font-size: 2.8rem;
    letter-spacing: -1px;
    margin-bottom: 1rem;
  }
  
  .hero .tagline {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .hero-import-container {
    border-radius: 20px;
    padding: 0.4rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .import-input {
    padding: 1rem;
    text-align: center;
  }
  
  .btn-primary.btn-large {
    width: 100%;
    border-radius: 14px;
  }

  /* Features & Grid */
  .hero-actions-grid {
    gap: 1rem;
    padding: 1rem 0;
    flex-direction: column;
    align-items: stretch;
  }
  
  .card-inner, .premium-upload-box {
    padding: 1.5rem;
  }
  
  .feature-item {
    gap: 2.5rem !important;
  }
  
  .feature-text h3 {
    font-size: 1.75rem;
  }
  
  /* Editor Responsiveness */
  .editor-layout {
    gap: 1rem;
    grid-template-columns: 1fr;
  }
  
  .preview-panel {
    width: 100%;
  }
  
  .video-container {
    border-radius: 12px;
    aspect-ratio: 9/16; /* Force vertical preview if needed */
  }
  
  .settings-panel {
    width: 100%;
  }
  
  .central-controls {
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
  }
  
  .control-group {
    flex: 1 1 40%;
  }
  
  /* Timeline */
  .modern-time-adjuster {
    height: 44px; /* Larger for touch */
  }
  
  .time-btn {
    width: 40px;
  }
  
  .range-slider-container {
    height: 20px; /* Thicker for touch */
  }

  /* Modals */
  .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 20px;
  }
  
  .auth-content-wrapper {
    padding: 2rem 1.25rem;
  }
  
  .pricing-grid {
    gap: 1rem;
    grid-template-columns: 1fr;
  }
  
  .plan-card {
    padding: 2rem 1.5rem;
  }
  
  .plan-card.featured {
    transform: none; /* Avoid scaling issues on mobile */
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-socials {
    justify-content: center;
  }
}

/* Global Logo Styling */
.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s;
}

.logo:hover .logo-img {
  transform: scale(1.1);
}

@media (max-width: 600px) {
  .logo-img {
    height: 32px;
  }
}
