/* Thumbnail Maker Online - Modern Material UI 3 (M3) Styles */
/* PicDriver Suite */

.workspace-card {
  background: var(--bg-card, rgba(15, 23, 42, 0.75));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-lg, 0 20px 40px -10px rgba(0, 0, 0, 0.5));
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 410px;
  min-height: 640px;
}

@media (max-width: 1080px) {
  .workspace-card {
    grid-template-columns: 1fr;
  }
}

.viewport-col {
  display: flex;
  flex-direction: column;
  background: #070a12;
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.controls-col {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 120px);
  min-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

@media (max-width: 1080px) {
  .controls-col {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: none;
  }
}

.controls-col::-webkit-scrollbar {
  width: 6px;
}

.controls-col::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}

/* Dropzone */
.thumb-uploader-box {
  background: rgba(15, 23, 42, 0.65);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 320px;
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  max-width: 820px;
}

.thumb-uploader-box:hover,
.thumb-uploader-box.drag-over {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: #6366f1;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}

.dropzone-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.dropzone-subtitle {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.95rem;
  margin-bottom: 20px;
  max-width: 520px;
}

.btn-sample-demo {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sample-demo:hover {
  background: #6366f1;
  color: #fff;
  transform: translateY(-1px);
}

/* Floating Viewport Toolbar */
.viewport-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
  flex-wrap: wrap;
  z-index: 10;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.tool-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.tool-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.zoom-display {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary, #f8fafc);
  min-width: 44px;
  text-align: center;
}

/* Canvas Viewport */
.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  background-color: #070a12;
  background-image: 
    linear-gradient(45deg, #0e1422 25%, transparent 25%),
    linear-gradient(-45deg, #0e1422 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #0e1422 75%),
    linear-gradient(-45deg, transparent 75%, #0e1422 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.canvas-container:active {
  cursor: grabbing;
}

.thumb-canvas {
  display: block;
  max-width: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
  transition: none;
  transform-origin: center center;
  border-radius: 6px;
}

/* Floating Viewport Drag Hint */
.viewport-drag-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 15;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.viewport-drag-hint.active-drag {
  border-color: #818cf8;
  background: rgba(79, 70, 229, 0.9);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.7);
  transform: translateX(-50%) scale(1.05);
}

.viewport-drag-hint svg {
  color: #818cf8;
  animation: pic-pulse 2s infinite ease-in-out;
}

.viewport-drag-hint.active-drag svg {
  color: #ffffff;
  animation: none;
}

@keyframes pic-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Multi-Text Layer Tabs */
.text-layer-tabs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.text-layer-tabs-container::-webkit-scrollbar {
  height: 4px;
}

.text-layer-tabs-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

.layer-tab-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.layer-tab-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: #818cf8;
  color: #ffffff;
}

.layer-tab-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  font-weight: 700;
}

.btn-add-layer {
  background: rgba(16, 185, 129, 0.15);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-add-layer:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: translateY(-1px);
}

.layer-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.layer-name-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: #a5b4fc;
  font-family: var(--font-mono, monospace);
}

.layer-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layer-action-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.layer-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.layer-action-btn.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

/* Alignment 9-Grid & Nudge Controls */
.align-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.align-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 6px 0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.align-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #fff;
}

.nudge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nudge-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.nudge-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.nudge-btn:active {
  transform: translateY(1px);
}

/* Panels */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.panel-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-subtle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sub-panel {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.panel-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin-bottom: 2px;
}

.preset-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
  font-weight: 700;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  transition: 0.25s;
}

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

.switch-toggle input:checked + .toggle-slider {
  background-color: #6366f1;
}

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

.select-input,
.text-input {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
  appearance: none;
}

.select-input:hover,
.text-input:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.select-input:focus,
.text-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.control-value {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: #818cf8;
}

/* Radiant Download Button */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #db2777 100%);
  color: #ffffff;
  border: none;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.55), 0 12px 30px rgba(219, 39, 119, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

@keyframes pic-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Badge Buttons */
.badge-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.badge-chip {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f8fafc;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.badge-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
}

.badge-chip.active {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  border-color: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* Steps & Features */
.steps-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .steps-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .steps-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
}
