/* Contact Sheet 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 400px;
  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 */
.contact-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;
}

.contact-uploader-box:hover,
.contact-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: 6px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  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:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  border-color: rgba(255, 255, 255, 0.05);
}

.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;
}

/* Page Navigation Bar */
.page-nav-group {
  background: rgba(15, 23, 42, 0.9);
  padding: 3px 6px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.page-nav-btn {
  padding: 4px 10px;
  font-size: 0.76rem;
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.page-nav-btn:hover:not(:disabled) {
  background: #4f46e5;
  color: #ffffff;
}

.page-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a5b4fc;
  padding: 0 8px;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

/* 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;
}

.contact-canvas {
  display: block;
  max-width: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
  transition: none; /* Instant smooth pan and zoom */
  transform-origin: center center;
  border-radius: 4px;
}

/* Panel Header & Sub-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 Buttons */
.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 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(16, 185, 129, 0.4);
  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(16, 185, 129, 0.55);
}

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

.btn-zip-export {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #db2777 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  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);
}

.btn-zip-export: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-zip-export:active {
  transform: translateY(1px);
}

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

/* Queue Actions Bar */
.queue-actions-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.queue-actions-bar .btn-subtle {
  flex: 1;
  text-align: center;
  padding: 5px 6px;
  font-size: 0.72rem;
}

/* Contact Photo Queue Strip */
.contact-queue-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px;
  scrollbar-width: thin;
}

.contact-card-thumb {
  position: relative;
  flex: 0 0 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.contact-card-thumb img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  display: block;
}

.contact-card-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}

.contact-card-del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(244, 63, 94, 0.85);
  color: #fff;
  border: none;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 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;
  }
}
