/* ═══════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
  --c-primary: #006673;
  --c-primary-light: #0099a6;
  --c-navy: #192443;
  --c-text: #334155;
  --c-text-muted: #64748b;
  --c-border: #e2e8f0;
  --c-surface: rgba(255, 255, 255, 0.98);
  --c-surface-subtle: #f8fafc;
  --c-success: #16a34a;
  --c-success-bg: #f0fdf4;
  --c-error: #dc2626;
  --c-error-bg: #fef2f2;
  --c-warning: #d97706;
  --c-warning-bg: #fffbeb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-btn: 0 4px 14px rgba(0, 102, 115, 0.25);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-brand: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
}

/* ═══════════════════════════════════════════
   FONTS
   ═══════════════════════════════════════════ */
@font-face {
  font-family: 'BeautiqueDisplay';
  src: url('https://res.cloudinary.com/dkvz5fo4b/raw/upload/v1747383665/BeautiqueDisplay-Medium_r8vbhk.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SVN-Gilroy';
  src: url('https://res.cloudinary.com/dkvz5fo4b/raw/upload/v1757666122/SVN-Gilroy_Bold_ij4pya.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    linear-gradient(160deg, rgba(25, 36, 67, 0.7), rgba(0, 40, 50, 0.8)),
    url('https://res.cloudinary.com/dkvz5fo4b/image/upload/v1750818325/Artboard_7_4x_wshqmi.png') center / cover fixed;
  padding: 2rem 1rem;
  color: var(--c-text);
}

/* ═══════════════════════════════════════════
   CONFETTI CANVAS
   ═══════════════════════════════════════════ */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════ */
.app-shell {
  width: 100%;
  max-width: 520px;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeUp 0.5s var(--transition) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.app-header {
  padding: 2.5rem 2rem 0;
}

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo img {
  height: 60px;
}

h1 {
  text-align: center;
  color: var(--c-navy);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════ */
.tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--c-border);
}

.tab-btn {
  flex: 1;
  padding: 1rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
}

.tab-btn:hover {
  color: var(--c-primary);
}

.tab-btn.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

.tab-content {
  display: none;
  padding: 2rem;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════ */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--c-navy);
}

input,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  transition: all var(--transition);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 115, 0.08);
}

/* ═══════════════════════════════════════════
   DRAG & DROP ZONE
   ═══════════════════════════════════════════ */
.drop-zone {
  position: relative;
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.drop-zone:hover {
  border-color: var(--c-primary);
  background: rgba(0, 102, 115, 0.02);
}

.drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.drop-zone-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-navy);
}

.drop-zone-hint {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-top: 0.4rem;
}

.file-name {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-primary);
  text-align: center;
}

.sample-download {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  text-align: center;
}

.sample-download a {
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   PREVIEW
   ═══════════════════════════════════════════ */
.card-preview {
  display: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.card-preview.active {
  display: block;
}

.card-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.preview-label {
  display: block;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stale-badge {
  background: var(--c-warning-bg);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  text-align: center;
  border-bottom: 1px solid #fde68a;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--gradient-brand);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 102, 115, 0.2);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 102, 115, 0.3);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.button--outline {
  background: transparent;
  color: var(--c-primary);
  border: 2px solid var(--c-primary);
  box-shadow: none;
}

.button--outline:hover {
  background: rgba(0, 102, 115, 0.05);
}

/* ═══════════════════════════════════════════
   BATCH UI
   ═══════════════════════════════════════════ */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.preview-table th {
  background: var(--c-surface-subtle);
  padding: 0.75rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--c-border);
}

.preview-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--c-border);
}

.zip-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--c-success-bg);
  color: var(--c-success);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin: 1.5rem 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-top: 0.5rem;
  display: none;
}

/* ═══════════════════════════════════════════
   LOADING & PROGRESS
   ═══════════════════════════════════════════ */
.loading {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--c-navy);
  font-weight: 600;
  font-size: 0.95rem;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 102, 115, 0.1);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  margin-right: 10px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.phase-indicator {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-primary);
  justify-content: center;
}

.phase-indicator.active {
  display: flex;
}

.phase-dot {
  width: 8px;
  height: 8px;
  background: var(--c-primary);
  border-radius: 50%;
  animation: pulseDot 1s ease-in-out infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.8); }
  to   { opacity: 1;   transform: scale(1.2); }
}

/* ═══════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease forwards;
}

.toast--success { background: var(--c-success); }
.toast--error { background: var(--c-error); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════ */
.skeleton-preview {
  aspect-ratio: 3/4;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════ */
.stats-box {
  background: var(--c-surface-subtle);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  text-align: center;
  display: none;
}

.stats-box.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-primary);
}

.stats-label {
  font-size: 0.8rem;
  color: var(--c-text-muted);
}
