/* ==========================================================================
   Manga Studio - Upload Manager Styles
   ========================================================================== */

.uploader-page {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.uploader-header {
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-title span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(244, 63, 94, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
}

/* Layout Container */
.uploader-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Panel Sections */
.panel-section {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-title h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.custom-input,
.custom-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.custom-input:focus,
.custom-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
  background: rgba(255, 255, 255, 0.08);
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.action-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.action-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Sub-form Card */
.sub-form-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sub-form-card h3 {
  font-size: 0.9rem;
  color: var(--accent-hover);
}

/* Summary Box */
.summary-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-ready {
  color: #22c55e;
}

.status-busy {
  color: #eab308;
}

.full-width {
  width: 100%;
}

.btn-cta {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.btn-cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Drop Zone */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(244, 63, 94, 0.05);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.15);
}

.file-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  transition: transform var(--transition-fast);
}

.drop-zone:hover .drop-icon {
  transform: translateY(-4px);
  color: var(--accent-primary);
}

.drop-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.drop-title strong {
  color: var(--accent-primary);
}

.drop-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Progress Box */
.progress-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

#progress-status-text {
  color: var(--accent-cyan);
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #fb7185);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Preview Header */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.text-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Preview Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Thumbnail Card */
.thumb-card {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.thumb-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #111;
  overflow: hidden;
}

.thumb-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.thumb-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.thumb-delete-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.thumb-footer {
  padding: 0.45rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
}

.thumb-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.thumb-status {
  font-size: 0.7rem;
}

.status-pending { color: var(--text-muted); }
.status-uploading { color: var(--accent-cyan); animation: spin 1s infinite linear; }
.status-success { color: #22c55e; font-weight: bold; }
.status-error { color: #ef4444; font-weight: bold; }

/* Centered Modal */
.centered-modal {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(0.95);
  width: 460px;
  height: auto;
  border-radius: var(--radius-lg);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.centered-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-desc code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 992px) {
  .uploader-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}
