/* ==========================================================================
   PICDRIVER MULTI-LAYER PHOTO STENCIL & BRIDGE GENERATOR STUDIO
   Ultra-Modern Photography Dark Glass Design System
   ========================================================================== */

:root {
  --bg-main: #090d16;
  --surface-color: #0f172a;
  --surface-card: #1e293b;
  --surface-card-hover: rgba(30, 41, 59, 0.9);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --accent-cyan: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
}

/* Main Hero */
.tool-hero {
  text-align: center;
  padding: 2.75rem 1.5rem 1.75rem;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, rgba(9, 13, 22, 0) 70%);
  border-bottom: 1px solid var(--border-subtle);
}

.tool-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.625rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-hero p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 760px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.preset-pill-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.preset-pill-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-color);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Upload Dropzone */
.dropzone-container {
  max-width: 1400px;
  margin: 1.5rem auto 1.25rem;
  padding: 0 1.5rem;
}

.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  color: var(--primary-color);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.dropzone-text {
  text-align: left;
}

.dropzone h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

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

/* Studio Workspace Layout: Stage on Left (1fr), Controls on Right (380px) */
.workspace {
  max-width: 1400px;
  margin: 0 auto 3.5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 1fr);
  gap: 1.75rem;
  align-items: start;
}

/* Canvas Stage Area */
.canvas-container {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.viewport-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-chip {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Layer Isolation Tabs */
.layer-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.layer-tab-btn {
  padding: 0.45rem 0.85rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.layer-tab-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.4);
}

.layer-tab-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.layer-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: inline-block;
}

/* Canvas Viewport */
.viewport-wrapper {
  position: relative;
  width: 100%;
  min-height: 520px;
  background-color: #080c14;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Canvas constraint for mobile responsiveness tests */
canvas {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.canvas-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* Sidebar Controls */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-panel {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.control-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.control-panel h3 svg {
  color: var(--primary-light);
}

.control-group {
  margin-bottom: 1.15rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.control-value {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-size: 0.8125rem;
}

.select-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  border-color: var(--primary-color);
}

.slider-input {
  width: 100%;
  height: 6px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 3px;
  outline: none;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Toggle Switches */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .toggle-slider {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Manual Knife Bridge Mode Button */
.knife-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.knife-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary-color);
  color: var(--text-primary);
}

.knife-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* Bridge Actions */
.bridge-action-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-bridge-action {
  padding: 0.55rem 0.65rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-bridge-action:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  border-color: var(--primary-color);
}

.btn-bridge-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: #ef4444;
}

/* Redesigned High-Impact Download Action Cards */
.download-action-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-download-primary {
  width: 100%;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
  text-align: left;
}

.btn-download-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.btn-download-secondary {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-align: left;
}

.btn-download-secondary:hover {
  background: rgba(45, 59, 82, 0.95);
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-text-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.btn-main-label {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sub-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-download-secondary .btn-sub-label {
  color: var(--text-muted);
}

.btn-format-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  flex-shrink: 0;
}

/* SEO Guide & FAQ */
.seo-section {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.seo-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.seo-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.seo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.seo-card p, .seo-card li {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
}

.seo-card ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

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

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.4);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
.toggle-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.faq-icon {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-light);
  transition: transform 0.2s ease;
}

/* Global Footer */
.pic-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.95);
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.pic-footer p {
  margin: 0;
  color: var(--text-secondary);
}

/* Mobile Responsiveness Breakpoint */
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .canvas-container {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .tool-hero h1 {
    font-size: 1.875rem;
  }

  .tool-hero p {
    font-size: 1rem;
  }

  .dropzone {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .dropzone-text {
    text-align: center;
  }

  .workspace {
    padding: 0 1rem;
  }

  .viewport-wrapper {
    min-height: 360px;
    padding: 0.75rem;
  }

  .seo-card {
    padding: 1.5rem;
  }
}
