/* ============================
   PDF.AI — Light Blue Theme
   ============================ */

:root {
  --bg-deep:       #FFFFFF;
  --bg-dark:       #F8FAFC;
  --bg-surface:    #EFF6FF;
  --glass-bg:      rgba(59, 130, 246, 0.05);
  --glass-border:  rgba(59, 130, 246, 0.15);
  --glass-inner:   rgba(59, 130, 246, 0.08);

  --purple-400:    #60A5FA;
  --purple-500:    #3B82F6;
  --purple-600:    #2563EB;
  --purple-700:    #1D4ED8;
  --blue-400:      #60A5FA;
  --green-400:     #10B981;
  --red-400:       #EF4444;

  --text-primary:  #1F2937;
  --text-secondary:#4B5563;
  --text-muted:    #6B7280;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-glow:   0 0 40px rgba(59, 130, 246, 0.2);
  --shadow-card:   0 8px 32px rgba(59, 130, 246, 0.12);
  --shadow-float:  0 20px 60px rgba(59, 130, 246, 0.15);
  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Utilities ===== */
.hidden { display: none !important; }
.view { display: none; min-height: 100vh; }
.view.active { display: flex; flex-direction: column; }
.panel { display: none; flex: 1; flex-direction: column; gap: 24px; }
.panel.active { display: flex; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass-inner {
  background: var(--glass-inner);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

/* ===== Global Background Orbs ===== */
.global-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth-orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.15;
  animation: orbFloat 10s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: #93C5FD; top: -200px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 450px; height: 450px; background: #BFDBFE; bottom: -150px; right: -100px; animation-delay: -4s; }
.orb-3 { width: 350px; height: 350px; background: #DBEAFE; top: 40%; left: 60%; animation-delay: -7s; }
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-40px) scale(1.06); }
}

/* ===== Landing View ===== */
#view-landing { position: relative; }
#view-landing > * { position: relative; z-index: 1; }

/* Header */
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
}
.glass-header { border-radius: 0; }

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

.header-user { display: flex; align-items: center; gap: 12px; }
.credit-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--purple-500);
}
.credit-pill-label { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* Hero */
.landing-main {
  display: flex; flex-direction: column;
  align-items: center; gap: 24px;
  padding: 60px 24px 80px;
  max-width: 720px; margin: 0 auto; width: 100%;
}

.hero-text { text-align: center; }
.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800; letter-spacing: -1px;
  line-height: 1.15;
}
.hero-accent {
  background: linear-gradient(135deg, var(--purple-500), #60A5FA);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 18px; color: var(--text-secondary); margin-top: 12px; }

/* Landing Upload Zone */
.landing-upload-zone {
  width: 100%;
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  cursor: pointer; transition: var(--transition);
  text-align: center;
  background: rgba(59, 130, 246, 0.03);
}
.landing-upload-zone:hover, .landing-upload-zone.dragover {
  border-color: var(--purple-500);
  background: rgba(59, 130, 246, 0.07);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.selected-file-box {
  width: 100%; max-width: 400px;
  padding: 30px;
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.upload-icon-wrap { color: var(--purple-500); animation: iconFloat 3s ease-in-out infinite; }
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.upload-text { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.upload-hint { font-size: 14px; color: var(--text-muted); }

.upload-features { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.feature-badge {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
}

/* Upload Progress */
.upload-progress { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.progress-bar { width: 100%; height: 6px; background: var(--glass-inner); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--purple-600), var(--purple-400));
  border-radius: 3px; transition: width 0.3s ease;
}
#landing-upload-status, #upload-status { font-size: 13px; color: var(--text-secondary); }

/* ===== Logo & Branding ===== */
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
.logo-icon.small { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.logo-text { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.logo-accent { color: var(--purple-500); }

/* ===== Documents Table ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 12px; }
.section-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.table-container {
  width: 100%; overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.doc-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; text-align: left;
}

.doc-table th {
  padding: 14px 18px; background: rgba(59, 130, 246, 0.04);
  font-weight: 600; color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}

.doc-table td {
  padding: 14px 18px; border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary); vertical-align: middle;
}

.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: rgba(59, 130, 246, 0.03); }

.doc-name-cell { display: flex; align-items: center; gap: 12px; }
.doc-name-cell span:last-child {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}

.file-icon {
  font-size: 18px; width: 36px; height: 36px;
  background: rgba(59, 130, 246, 0.08); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 40px; text-align: center; color: var(--text-muted);
}
.empty-icon { font-size: 40px; opacity: 0.4; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-input {
  background: #FFFFFF;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 11px 13px;
  color: var(--text-primary); font-size: 14px; font-family: inherit;
  transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.form-input::placeholder { color: var(--text-muted); }
.form-error {
  background: rgba(239, 68, 68, 0.07); border: 1px solid rgba(239, 68, 68, 0.25);
  color: #DC2626; padding: 9px 13px; border-radius: var(--radius-sm); font-size: 13px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px;
  border-radius: var(--radius-sm); border: none;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: white; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45); }
.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--purple-500); color: var(--purple-500); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--glass-bg); color: var(--text-primary); }
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981); color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover { transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon {
  background: none; border: none; color: var(--text-secondary); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); font-size: 18px; line-height: 1;
  transition: var(--transition); display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--glass-bg); color: var(--text-primary); }

.btn-loader {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Google Button ===== */
.btn-google {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 20px;
  background: white; color: #1f2937;
  border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; width: 100%;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18); background: #f9fafb; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--glass-border);
}

/* ===== Auth Modal ===== */
.auth-modal {
  max-width: 400px; width: 100%;
  border-radius: var(--radius-xl); padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative; background: #FFFFFF;
  box-shadow: var(--shadow-float);
}

.auth-modal-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 4px; }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 18px; padding: 4px 8px;
  border-radius: 6px; transition: var(--transition); line-height: 1;
}
.modal-close:hover { background: var(--glass-bg); color: var(--text-primary); }

/* Tabs */
.auth-tabs {
  display: flex; position: relative;
  background: rgba(59, 130, 246, 0.06); border-radius: var(--radius-sm);
  padding: 4px;
}
.tab-btn {
  flex: 1; padding: 9px; background: none; border: none;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; border-radius: calc(var(--radius-sm) - 2px);
  position: relative; z-index: 1; transition: var(--transition);
}
.tab-btn.active { color: white; }
.tab-indicator {
  position: absolute; top: 4px; left: 4px;
  height: calc(100% - 8px); width: calc(50% - 4px);
  background: linear-gradient(135deg, var(--purple-500), var(--purple-600));
  border-radius: calc(var(--radius-sm) - 2px);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.tab-indicator.right { transform: translateX(100%); }

.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }

/* ===== Dashboard View ===== */
#view-dashboard { display: grid; grid-template-columns: 230px 1fr; }

.sidebar {
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  gap: 8px; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
  border-radius: 0; background: var(--bg-dark);
}
.sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.credit-widget { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; }
.credit-icon { font-size: 18px; }
.credit-info { display: flex; flex-direction: column; flex: 1; }
.credit-label { font-size: 11px; color: var(--text-muted); }
.credit-value { font-size: 20px; font-weight: 700; color: var(--purple-500); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.nav-item:hover { background: var(--glass-bg); color: var(--text-primary); }
.nav-item.active { background: rgba(59, 130, 246, 0.1); color: var(--purple-500); border: 1px solid rgba(59, 130, 246, 0.2); }

.sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px; border-top: 1px solid var(--glass-border);
}
.user-badge { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-500), var(--blue-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: white; flex-shrink: 0;
}
.user-email-short { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { display: flex; flex-direction: column; padding: 28px; gap: 20px; min-height: 100vh; overflow-y: auto; }

/* Panel Headers */
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title { font-size: 22px; font-weight: 700; }
.panel-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ===== PDF Editor ===== */
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; flex: 1; min-height: 0; }

.pdf-viewer-wrapper { border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.viewer-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--glass-border);
}
.page-info { font-size: 13px; color: var(--text-secondary); padding: 0 6px; }
.toolbar-sep { flex: 1; }
.zoom-level { font-size: 12px; color: var(--text-muted); min-width: 40px; text-align: center; }

.canvas-container {
  flex: 1; overflow: auto;
  text-align: center;
  padding: 20px; background: #F1F5F9;
}
.canvas-container.adding-text { cursor: crosshair; }
.pdf-wrapper-inner {
  display: inline-block; position: relative; text-align: left;
  box-shadow: var(--shadow-card); border-radius: 4px;
}
#pdf-canvas { display: block; border-radius: 4px; }
#field-overlay { position: absolute; top: 0; left: 0; pointer-events: none; }

.field-marker {
  position: absolute; border: 2px solid var(--purple-500);
  background: rgba(59, 130, 246, 0.08); border-radius: 4px; pointer-events: none;
}
.field-marker-label {
  position: absolute; top: -20px; left: 0;
  font-size: 10px; color: var(--purple-500);
  background: #EFF6FF; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}

.fields-panel { border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; background: var(--bg-dark); border: 1px solid var(--glass-border); }
.fields-header { display: flex; align-items: center; justify-content: space-between; }
.fields-title { font-size: 14px; font-weight: 600; }
.fields-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.fields-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 20px 0; }

.field-item {
  background: #FFFFFF; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  animation: fadeInUp 0.2s ease;
}
.field-item-header { display: flex; align-items: center; justify-content: space-between; }
.field-key-label { font-size: 12px; font-weight: 600; color: var(--purple-500); }
.field-pos-info { font-size: 11px; color: var(--text-muted); }
.field-value-input {
  background: #FFFFFF; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  outline: none; transition: var(--transition);
}
.field-value-input:focus { border-color: var(--purple-500); }

.generate-info { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.cost-badge {
  background: rgba(59, 130, 246, 0.07); border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm); padding: 10px;
  font-size: 12px; color: var(--purple-500); text-align: center;
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  border-radius: var(--radius-xl); padding: 24px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-float); background: #FFFFFF;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-top: -6px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 13px 18px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-float); max-width: 340px;
  animation: slideInRight 0.3s ease;
}
.toast.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #059669; }
.toast.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #DC2626; }
.toast.info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--purple-500); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeInUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .landing-header { padding: 12px 20px; }
  .landing-main { padding: 40px 16px 60px; }
  .hero-title { font-size: 28px; }
  #view-dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .editor-layout { grid-template-columns: 1fr; }
}

/* Editor Sidebar & Tools */
.editor-sidebar { width: 300px; display: flex; flex-direction: column; gap: 20px; padding: 20px; overflow-y: auto; }
.tool-section { display: flex; flex-direction: column; gap: 12px; }
.tool-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tool-hint { font-size: 11px; color: var(--text-muted); }

/* Top Toolbar */
.editor-main-area { display: flex; flex-direction: column; gap: 18px; flex: 1; min-width: 0; }
.top-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: var(--radius-lg); background: #FFFFFF; border: 1px solid var(--glass-border); flex-wrap: wrap; }
.toolbar-divider { width: 1px; height: 24px; background: var(--glass-border); margin: 0 4px; }
.format-toolbar-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; transition: opacity 0.2s; }
.format-toolbar-inline.disabled { opacity: 0.5; pointer-events: none; }

.form-select.inline { padding: 6px 10px; background: #FFFFFF; width: auto; border-radius: 4px; border: 1px solid var(--glass-border); color: var(--text-primary); }
.size-control { display: flex; align-items: center; gap: 4px; background: #FFFFFF; border-radius: 4px; padding: 2px; border: 1px solid var(--glass-border); }
.inline-size { width: 45px; text-align: center; background: transparent; border: none; color: var(--text-primary); -moz-appearance: textfield; padding: 4px; }
.inline-size::-webkit-outer-spin-button, .inline-size::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn-tiny { padding: 4px 8px; font-size: 14px; background: transparent; color: var(--text-secondary); border-radius: 2px; }
.btn-tiny:hover { background: rgba(59, 130, 246, 0.08); color: var(--text-primary); }

.style-toggles { display: flex; align-items: center; gap: 4px; }
.toggle-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 14px; border-radius: 4px; background: transparent; color: var(--text-secondary); font-family: 'Inter', serif; }
.toggle-btn:hover { background: rgba(59, 130, 246, 0.08); color: var(--text-primary); }
.toggle-btn.active { background: rgba(59, 130, 246, 0.12); color: var(--purple-500); }

.color-picker-wrap { position: relative; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; cursor: pointer; }
.color-picker-wrap:hover { background: rgba(59, 130, 246, 0.08); }
.color-icon { font-size: 16px; font-weight: bold; font-family: serif; color: var(--text-secondary); z-index: 1; pointer-events: none; }
.color-picker { position: absolute; opacity: 0; width: 200%; height: 200%; top: -50%; left: -50%; cursor: pointer; }
.color-indicator { position: absolute; bottom: 4px; left: 6px; right: 6px; height: 3px; background: #000; pointer-events: none; }

/* Image Gallery */
.image-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.gallery-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: rgba(59, 130, 246, 0.05); border: 1px solid var(--glass-border); cursor: grab; display: flex; align-items: center; justify-content: center; }
.gallery-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-item:active { cursor: grabbing; }
.btn-delete-img { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(239, 68, 68, 0.85); color: white; border: none; border-radius: 50%; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.gallery-item:hover .btn-delete-img { opacity: 1; }
.mt-auto { margin-top: auto; }

/* Canvas Overlays */
.overlay-element { position: absolute; background: transparent; cursor: move; border: 1px dashed transparent; user-select: none; pointer-events: auto; }
.overlay-element:hover { border-color: rgba(59, 130, 246, 0.5); }
.overlay-element.selected { border-color: var(--purple-500); z-index: 10; }
.overlay-text { outline: none; white-space: pre-wrap; min-width: 20px; min-height: 20px; cursor: text; }
.overlay-image { width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.resizer { position: absolute; width: 8px; height: 8px; background: var(--purple-500); border-radius: 50%; bottom: -4px; right: -4px; cursor: nwse-resize; display: none; }
.overlay-element.selected .resizer { display: block; }
.delete-overlay { position: absolute; top: -10px; right: -10px; background: #ef4444; color: white; border: none; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 10px; }
.overlay-element.selected .delete-overlay { display: flex; }
