/* ==========================================================================
   RECEIPTS STUDIO & LIVE CUSTOMIZER - WORKSPACE STYLES
   ========================================================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0B0F17;
  color: #F1F5F9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Studio Navigation Bar */
.studio-navbar {
  height: 60px;
  background: #111827;
  border-bottom: 1px solid #1F2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.studio-badge {
  background: rgba(0, 192, 135, 0.15);
  color: #00C087;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.btn-studio {
  background: #1F2937;
  color: #F1F5F9;
  border: 1px solid #374151;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-studio:hover {
  background: #374151;
  color: #FFF;
}

.btn-studio-primary {
  background: #0052FF;
  border-color: #0052FF;
  color: #FFFFFF;
}

.btn-studio-primary:hover {
  background: #0045D8;
}

.btn-studio-download {
  background: #00C087;
  border-color: #00C087;
  color: #070B12;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 192, 135, 0.3);
}

.btn-studio-download:hover {
  background: #00DA99;
  border-color: #00DA99;
  color: #000;
  box-shadow: 0 6px 20px rgba(0, 192, 135, 0.45);
}

/* Studio Workspace 2-Column Grid */
.studio-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Sidebar Controls Panel */
.studio-sidebar {
  background: #111827;
  border-right: 1px solid #1F2937;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid #1F2937;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9CA3AF;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Template Switcher Grid */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.template-card-btn {
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  color: #E5E7EB;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-card-btn:hover {
  background: #2D3748;
  border-color: #4B5563;
}

.template-card-btn.active {
  background: rgba(0, 82, 255, 0.12);
  border-color: #0052FF;
  color: #FFFFFF;
}

.template-card-btn .tpl-name {
  font-size: 13px;
  font-weight: 700;
}

.template-card-btn .tpl-sub {
  font-size: 11px;
  color: #9CA3AF;
}

/* Color Presets */
.palette-preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.palette-chip {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #1F2937;
  color: #D1D5DB;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.palette-chip:hover {
  background: #2D3748;
}

.palette-chip.active {
  border-color: #0052FF;
  background: rgba(0, 82, 255, 0.15);
  color: #FFF;
}

.palette-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Custom Color Pickers */
.color-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px 12px;
}

.color-field-label {
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 500;
}

.color-field-input {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

/* Form Groups */
.studio-form-group {
  margin-bottom: 14px;
}

.studio-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  margin-bottom: 6px;
}

.studio-input {
  width: 100%;
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 9px 12px;
  color: #F9FAFB;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.studio-input:focus {
  border-color: #0052FF;
}

/* Sample Loaders Stack */
.sample-loader-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sample-loader-btn {
  background: #1F2937;
  border: 1px solid #374151;
  color: #E5E7EB;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.sample-loader-btn:hover {
  background: #2D3748;
  border-color: #6B7280;
}

/* Main Preview Stage (Right Canvas) */
.studio-stage {
  background: radial-gradient(circle at 50% 50%, #151D2C 0%, #0B0F17 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stage-top-bar {
  height: 48px;
  border-bottom: 1px solid #1F2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(8px);
}

.view-mode-tabs {
  display: flex;
  gap: 4px;
}

.view-mode-btn {
  background: none;
  border: 1px solid transparent;
  color: #9CA3AF;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-mode-btn.active {
  background: #1F2937;
  color: #FFF;
  border-color: #374151;
}

.stage-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  overflow-y: auto;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .studio-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .studio-sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid #1F2937;
  }
  .studio-stage {
    min-height: 900px;
  }
}

/* Toast Notifications */
.studio-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #00C087;
  color: #070B12;
  font-weight: 700;
  font-size: 13.5px;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Camera Snapshot Flash Effect */
@keyframes camera-flash {
  0% { opacity: 0; }
  50% { opacity: 0.85; }
  100% { opacity: 0; }
}

.snapshot-flash-overlay {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
}

.snapshot-flash-overlay.flashing {
  animation: camera-flash 0.35s ease-out;
}

