/* ==========================================================================
   Silhouette Generator & Vectorizer Studio Stylesheet - PicDriver
   High-contrast silhouette extraction, vector SVG path export, scenic backdrops
   ========================================================================== */

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --surface-color: #0f172a;
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

.silhouette-workspace {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.tool-hero {
  text-align: center;
  padding: 2.5rem 1rem 1.75rem;
  max-width: 800px;
  margin: 0 auto;
}

.tool-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.tool-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Studio Grid */
.silhouette-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 1.75rem;
  align-items: start;
}

/* Stage Column */
.silhouette-stage-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.silhouette-viewport-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.5);
  position: relative;
}

.silhouette-viewport-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-badge.accent {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.hud-badge.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.3);
}

.silhouette-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Canvas Viewport */
.silhouette-canvas-container {
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: #0f1117;
  background-image: 
    linear-gradient(45deg, #181c26 25%, transparent 25%), 
    linear-gradient(-45deg, #181c26 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #181c26 75%), 
    linear-gradient(-45deg, transparent 75%, #181c26 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

#silhouette-canvas {
  max-width: 100%;
  max-height: 580px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.control-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.65rem;
}

.control-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Presets & Toggles */
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.style-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  transition: all 0.2s ease;
  text-align: left;
}

.style-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
}

.style-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.style-btn-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Form Groups & Sliders */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-value-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #818cf8;
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  transition: background 0.2s;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  transition: transform 0.15s, background 0.15s;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #818cf8;
}

.backdrop-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.backdrop-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.backdrop-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.backdrop-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #fff;
}

/* Export Card */
.export-card {
  background: linear-gradient(145deg, rgba(30, 34, 45, 0.9), rgba(20, 23, 31, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.2);
}

.btn-download-vector {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-download-vector:hover {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.45);
}

.export-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-download-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.btn-download-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

table tr:last-child td {
  border-bottom: none;
}

/* Mobile & Tablet Breakpoint */
@media (max-width: 768px) {
  .silhouette-grid {
    grid-template-columns: 1fr;
  }

  .silhouette-canvas-container {
    min-height: 340px;
    padding: 0.75rem;
  }

  .style-grid,
  .backdrop-row,
  .landscape-row,
  .export-sub-row {
    grid-template-columns: 1fr;
  }

  .silhouette-viewport-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Touch-Up & Vectorizer Toolbar */
.canvas-toolbar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.tool-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 0.2rem;
}

.landscape-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.landscape-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  transition: all 0.2s;
  text-align: left;
}

.landscape-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
}

.landscape-btn.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: #06b6d4;
  color: #fff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.svg-stat-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

