/* ==========================================================================
   CardGenerator Stylesheet (Premium Dark Tarot Glassmorphism)
   ========================================================================== */

.app-container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  min-height: 100vh;
}

/* Main Content Grid */
.main-content {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-xl);
  align-items: start;
  flex: 1;
}

@media (max-width: 1024px) {
  .app-container {
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
  }
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: var(--space-xl);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: var(--space-sm);
}

.panel-title span {
  color: var(--accent-primary);
  font-size: 22px;
}

/* ==========================================================================
   Settings Form Controls
   ========================================================================== */
.control-group {
  margin-bottom: var(--space-xl);
}

.group-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Presets Grid Control */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.presets-grid button:last-child {
  grid-column: span 2;
}

.preset-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--transition-fast);
  color: var(--text-color);
  font-family: var(--font-body);
}

.preset-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.preset-card.active {
  background: rgba(102, 252, 241, 0.05);
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}

.preset-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-card.active .preset-name {
  color: var(--text-color);
}

.preset-value {
  font-size: 0.88rem;
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Double input fields side-by-side */
.double-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.double-inputs input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  outline: none;
}

.double-inputs input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(102, 252, 241, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.glass-input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.glass-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(102, 252, 241, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.input-helper {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Format radio toggle buttons */
.format-toggle {
  display: flex;
  gap: var(--space-sm);
}

.format-toggle input[type="radio"] {
  display: none;
}

.format-toggle .toggle-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.format-toggle .toggle-btn span.material-symbols-rounded {
  font-size: 22px;
  color: var(--text-muted);
}

.format-toggle .toggle-btn:hover {
  background: var(--glass-hover);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.15);
}

.format-toggle input[type="radio"]:checked + .toggle-btn {
  background: rgba(102, 252, 241, 0.05);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}

.format-toggle input[type="radio"]:checked + .toggle-btn span.material-symbols-rounded {
  color: var(--accent-primary);
}

.format-desc {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Generate PDF Button */
.btn-generate {
  margin-top: 10px;
}

/* Progress bar container styling */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.08);
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.1s ease;
}

.progress-text {
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--text-muted);
  text-align: center;
}

/* Info Box */
.info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-xl);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.info-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.info-title span {
  font-size: 16px;
}

/* ==========================================================================
   Workspace Panel & Drag Drop
   ========================================================================== */
.workspace-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  min-width: 0;
}

/* Drag and drop zone */
.drop-zone {
  background: rgba(22, 27, 34, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(102, 252, 241, 0.03);
  box-shadow: inset 0 0 20px rgba(102, 252, 241, 0.05);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: none;
}

.drop-icon span {
  font-size: 48px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.drop-zone:hover .drop-icon span,
.drop-zone.dragover .drop-icon span {
  color: var(--accent-primary);
}

.drop-zone h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.browse-link {
  color: var(--accent-primary);
  text-decoration: underline;
  font-weight: 600;
}

.file-types {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#file-input {
  display: none;
}

/* ==========================================================================
   Cards Queue / List
   ========================================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: fadeIn var(--transition-normal);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.batch-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Cards Queue Grid */
.cards-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-lg);
}

.queue-card-item {
  background: rgba(22, 27, 34, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-fast);
  cursor: grab;
  user-select: none;
}

.queue-card-item:active {
  cursor: grabbing;
}

.queue-card-item.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: var(--accent-primary);
}

.queue-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-secondary);
}

.card-index-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent-primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  z-index: 5;
}

.card-thumbnail-wrapper {
  aspect-ratio: 5 / 7;
  overflow: hidden;
  background: #06040d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Queue Card Actions row (Bottom of thumbnail) */
.card-queue-actions {
  display: flex;
  background: rgba(10, 8, 20, 0.95);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-xs) var(--space-sm);
  justify-content: space-between;
  align-items: center;
}

.card-filename-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  font-weight: 500;
}

.action-buttons-group {
  display: flex;
  gap: 4px;
}

.btn-icon-action {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-action span {
  font-size: 16px;
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-icon-action.btn-delete:hover {
  background: rgba(255, 138, 138, 0.1);
  color: var(--error);
}

/* CSS Keyframe fadeIn */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
