/* Atelier Design System - QR Forge Tool */

/* CSS VARIABLES */
:root {
  /* Base Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-disabled: #6b7280;
  
  /* Accent Colors */
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-active: #1d4ed8;
  
  /* Pro Colors */
  --pro-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);
  --pro-text: #0a0a0a;
  --pro-accent: #d97706;
  
  /* Semantic Colors */
  --success: #10b981;
  --success-hover: #047857;
  --error: #ef4444;
  --warning: #f59e0b;
  
  /* Border Colors */
  --border-default: #374151;
  --border-focus: #3b82f6;
  --border-error: #dc2626;
  --border-success: #059669;
  
  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.5;
  min-height: 100vh;
}

/* TYPOGRAPHY */
h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  color: var(--text-primary);
}

h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
  color: var(--text-secondary);
}

h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text-secondary);
}

/* LAYOUT STRUCTURE */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* NAVIGATION */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  z-index: 1000;
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.brand-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.pro-link {
  color: var(--pro-accent);
}

/* HERO HEADER */
.hero-header {
  margin-top: 60px;
  padding: var(--space-2xl) 0;
  text-align: center;
  background: var(--bg-secondary);
}

/* TOOL CONTAINER */
.tool-container {
  padding: var(--space-2xl) 0;
}

.tool-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* CRITICAL: VERTICAL LAYOUT ONLY */
.vertical-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* INPUT PANEL (TOP SECTION) */
.input-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: var(--space-xl);
}

/* QR TYPE SELECTOR */
.qr-type-selector {
  margin-bottom: var(--space-xl);
}

.tab-group {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.tab {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  font-size: 15px;
}

.tab:hover {
  background: var(--border-default);
}

.tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* INPUT SECTIONS */
.input-section {
  margin-bottom: var(--space-xl);
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.input-field,
.select-field {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 150ms ease;
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input-field::placeholder {
  color: var(--text-disabled);
}

.textarea-field {
  width: 100%;
  min-height: 120px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 150ms ease;
}

.textarea-field:focus {
  outline: none;
  border-color: var(--border-focus);
}

.textarea-field::placeholder {
  color: var(--text-disabled);
}

.help-text {
  color: var(--text-disabled);
  font-size: 13px;
  margin-top: var(--space-xs);
}

.char-count {
  color: var(--text-disabled);
  font-size: 13px;
  text-align: right;
  margin-top: var(--space-xs);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--accent-primary);
}

/* OPTIONS PANEL */
.options-panel {
  border-top: 1px solid var(--border-default);
  padding-top: var(--space-xl);
}

.option-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.option-group.pro-feature {
  opacity: 0.6;
  pointer-events: none;
}

.option-group.pro-feature::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(1px);
}

.pro-badge {
  position: absolute;
  top: -10px;
  right: 0;
  background: var(--pro-gradient);
  color: var(--pro-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 1;
}

.color-picker-group {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.color-input {
  flex: 1;
}

.color-input label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 13px;
}

.color-input input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  cursor: pointer;
}

.file-upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: 8px;
  padding: var(--space-lg);
  text-align: center;
  background: var(--bg-primary);
  cursor: pointer;
  margin-top: var(--space-sm);
}

.file-upload-zone input[type="file"] {
  display: none;
}

.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.disabled input,
.disabled select {
  cursor: not-allowed;
}

/* PREVIEW PANEL (BOTTOM SECTION) */
.preview-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: var(--space-xl);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.preview-container {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.qr-display {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state,
.loading-state,
.error-state {
  text-align: center;
  color: var(--text-muted);
}

.empty-state h4,
.error-state h4 {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.error-state {
  color: var(--error);
}

/* Error icon removed to comply with no emoji rule */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* BUTTONS */
.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-default);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-download {
  background: var(--success);
  color: var(--text-primary);
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms ease;
  font-family: inherit;
  margin-right: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.btn-download:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-download.pro-locked {
  background: var(--border-default);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.pro-badge-inline {
  background: var(--pro-gradient);
  color: var(--pro-text);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: var(--space-xs);
}

/* DOWNLOAD SECTION */
.download-section {
  border-top: 1px solid var(--border-default);
  padding-top: var(--space-lg);
}

.download-buttons {
  margin-bottom: var(--space-md);
}

.download-options {
  margin-top: var(--space-md);
}

/* PRO CTA BAR */
.pro-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-default);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}

.cta-content {
  color: var(--text-secondary);
  font-size: 14px;
}

.cta-content strong {
  color: var(--text-primary);
}

.btn-pro {
  background: var(--pro-gradient);
  color: var(--pro-text);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 150ms ease;
  font-family: inherit;
}

.btn-pro:hover {
  opacity: 0.9;
}

.btn-pro.full-width {
  width: 100%;
  padding: 12px 24px;
  font-size: 16px;
}

.cta-close {
  background: none;
  border: none;
  color: var(--text-disabled);
  font-size: 20px;
  cursor: pointer;
  padding: var(--space-xs);
  margin-left: var(--space-md);
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-disabled);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: var(--space-lg);
}

.upgrade-feature {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.feature-list {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.feature-list li {
  padding: var(--space-sm) 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: var(--space-lg);
}

.feature-list li::before {
  content: '✓';
  color: var(--success);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.upgrade-pricing {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.price-subtitle {
  color: var(--text-disabled);
  font-size: 14px;
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-default);
}

/* NOTIFICATION */
.notification {
  position: fixed;
  top: 80px;
  right: var(--space-lg);
  background: var(--success);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  z-index: 1500;
  max-width: 300px;
}

.notification button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
}

/* BUG REPORT BUTTON */
.bug-report-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--border-default);
  color: var(--text-muted);
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 150ms ease;
  font-family: inherit;
  z-index: 1000;
}

.bug-report-btn:hover {
  opacity: 0.8;
}

/* FOOTER */
.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-default);
  padding: var(--space-lg) 0;
  text-align: center;
  color: var(--text-disabled);
  margin-top: var(--space-3xl);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .container,
  .nav-container {
    padding: 0 var(--space-md);
  }
  
  .tool-layout {
    padding: 0 var(--space-md);
  }
  
  .tab-group {
    flex-wrap: wrap;
  }
  
  .tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 10px 12px;
  }
  
  .color-picker-group {
    flex-direction: column;
  }
  
  .pro-cta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
  }
  
  .bug-report-btn {
    bottom: 20px;
    left: 20px;
    right: auto;
  }
  
  .download-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .btn-download {
    margin: 0;
  }
}

/* CANVAS STYLING */
#qr-canvas canvas {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#qr-canvas img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* SUCCESS STATE */
.success-banner {
  background: var(--success);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: 6px;
  margin-bottom: var(--space-md);
  display: none;
  align-items: center;
  gap: var(--space-sm);
}

.success-banner.active {
  display: flex;
}

.success-icon {
  font-weight: bold;
}