/* =========================================================
   DONYLOGIC BOTS — Vector, Motion & Font Studio
   Cyber-Dark Modern Theme
   ========================================================= */

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(15, 20, 32, 0.75);
  --bg-card-hover: rgba(22, 30, 48, 0.85);
  --border: rgba(79, 216, 255, 0.15);
  --border-focus: rgba(79, 216, 255, 0.5);
  --cyan: #4fd8ff;
  --cyan-glow: rgba(79, 216, 255, 0.35);
  --violet: #7c5cff;
  --violet-glow: rgba(124, 92, 255, 0.35);
  --gold: #ffd166;
  --red: #ff5c77;
  --green: #4ade80;
  --text: #f0f4fc;
  --text-muted: #8c9ba5;
  --font-main: "Saira", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", monospace;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg-dark: #edf2f7;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(240, 246, 252, 0.96);
  --border: rgba(100, 116, 139, 0.28);
  --border-focus: rgba(99, 102, 241, 0.6);
  --text: #0f172a;
  --text-muted: #64748b;
}

[data-theme="light"] body {
  background-color: #edf2f7;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  color: #0f172a;
}

[data-theme="light"] .studio-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(100, 116, 139, 0.28);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(79, 216, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(124, 92, 255, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
}

/* Header */
.studio-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
  line-height: 1;
}

.brand-logo {
  height: 20px;
  width: auto;
  max-width: 130px;
  display: block;
  object-fit: contain;
}

[data-theme="light"] .brand-logo {
  filter: invert(1);
}

.brand-service-name {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  letter-spacing: 1.2px !important;
  text-transform: uppercase !important;
  color: var(--text) !important;
  font-family: var(--font-main, sans-serif) !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 92, 119, 0.2));
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.25);
  animation: vipPulse 2s infinite alternate;
}

@keyframes vipPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); box-shadow: 0 0 16px rgba(255, 209, 102, 0.45); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-main);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4fd8ff 0%, #7c5cff 100%);
  color: #05070d;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--cyan-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(79, 216, 255, 0.6);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(79, 216, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-gold {
  background: linear-gradient(135deg, #ffd166 0%, #ff9e00 100%);
  color: #0a0e17;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 209, 102, 0.4);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 209, 102, 0.65);
}

/* Tabs Navigation */
.studio-tabs-nav {
  max-width: 1300px;
  margin: 20px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.is-active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.tab-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tab-tag.free {
  background: rgba(74, 222, 128, 0.18);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.tab-tag.stars {
  background: rgba(255, 209, 102, 0.18);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.4);
}

/* Main Studio Layout */
.studio-main {
  max-width: 1300px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bento Grid Panels */
.studio-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.studio-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
}

.panel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--cyan);
  background: rgba(79, 216, 255, 0.05);
}

.dropzone i {
  font-size: 2.2rem;
  color: var(--cyan);
}

.dropzone p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Dual Preview Area */
.preview-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 380px;
}

@media (max-width: 640px) {
  .preview-stage {
    grid-template-columns: 1fr;
  }
}

.preview-box {
  background: rgba(7, 9, 14, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  z-index: 2;
}

.preview-content {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.preview-content img, .preview-content svg {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.6));
}

/* Canvas Stage for Motion Studio */
.canvas-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#motionCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Paywall Lock Overlay */
.paywall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  z-index: 50;
  border-radius: var(--radius-md);
}

.paywall-icon {
  font-size: 3rem;
  color: var(--gold);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.paywall-overlay h3 {
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 700;
}

.paywall-overlay p {
  max-width: 440px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Font Studio: Glyphs Grid */
.glyphs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.glyph-slot {
  aspect-ratio: 1;
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.glyph-slot:hover {
  border-color: var(--cyan);
  background: rgba(79, 216, 255, 0.05);
}

.glyph-slot.is-filled {
  border-color: var(--violet);
  background: rgba(124, 92, 255, 0.1);
}

.glyph-slot .glyph-char {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.glyph-slot .glyph-preview {
  width: 32px;
  height: 32px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glyph-slot .glyph-preview svg {
  width: 100%;
  height: 100%;
}

/* Type Tester Arena */
.type-arena {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  background: rgba(7, 9, 14, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.6rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.type-arena:focus {
  border-color: var(--cyan);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: #0b0f19;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: var(--cyan);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

/* Utility */
.code-box {
  background: #030407;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.tutorial-step {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tutorial-step strong {
  color: var(--text);
}

/* 4-Mode Generator Switcher */
.gen-mode-nav {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.gen-mode-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .2s;
}

.gen-mode-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.gen-mode-btn.is-active {
  color: #fff;
  background: rgba(79, 216, 255, 0.15);
  border-color: rgba(79, 216, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gen-mode-pane {
  display: none;
}

.gen-mode-pane.is-active {
  display: block;
}

/* Live CSS SVG Animations */
@keyframes svgLaserStroke {
  0% { stroke-dashoffset: 1200; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; filter: drop-shadow(0 0 14px var(--cyan)); }
  100% { stroke-dashoffset: -1200; opacity: 0.8; }
}

@keyframes svgNeonPulse {
  0% { transform: scale(0.97); filter: drop-shadow(0 0 6px rgba(79, 216, 255, 0.4)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 0 22px var(--cyan)) drop-shadow(0 0 40px var(--violet)); }
  100% { transform: scale(0.97); filter: drop-shadow(0 0 6px rgba(79, 216, 255, 0.4)); }
}

@keyframes svgKineticSpin {
  0% { transform: rotateY(0deg) rotateZ(0deg); }
  50% { transform: rotateY(180deg) rotateZ(4deg); }
  100% { transform: rotateY(360deg) rotateZ(0deg); }
}

@keyframes svgCyberGlitch {
  0%, 100% { transform: translate(0, 0); filter: drop-shadow(0 0 4px var(--cyan)); }
  20% { transform: translate(-3px, 2px); filter: drop-shadow(-4px 0 var(--red)) drop-shadow(4px 0 var(--cyan)); }
  40% { transform: translate(2px, -2px); filter: drop-shadow(3px -2px var(--violet)); }
  60% { transform: translate(-2px, -1px); filter: drop-shadow(-2px 2px var(--cyan)); }
  80% { transform: translate(3px, 1px); }
}

.anim-css-stroke svg path, .anim-css-stroke svg polygon, .anim-css-stroke svg polyline {
  stroke-dasharray: 1200 !important;
  animation: svgLaserStroke 4s ease-in-out infinite !important;
}

.anim-css-pulse svg {
  animation: svgNeonPulse 2.5s ease-in-out infinite !important;
}

.anim-css-spin svg {
  animation: svgKineticSpin 6s linear infinite !important;
  transform-style: preserve-3d;
}

.anim-css-glitch svg {
  animation: svgCyberGlitch 1s steps(4) infinite !important;
}

/* CSS Animation Toolbar */
.css-anim-bar {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 10px;
  flex-wrap: wrap;
}

.css-anim-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.css-anim-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.css-anim-btn.is-active {
  color: #fff;
  background: rgba(79, 216, 255, 0.2);
  border-color: var(--cyan);
}

