/* ============================================
   India's Studio — Content Upload PWA
   Design: Dark luxury, gold accents, mobile-first
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #fefafa;
  --pink: #D4607A;
  --pink-light: #F2B5C5;
  --pink-soft: #f9e4ea;
  --text: #2a1f22;
  --text-dim: rgba(42, 31, 34, 0.5);
  --surface: rgba(212, 96, 122, 0.04);
  --border: rgba(212, 96, 122, 0.15);
  --border-accent: rgba(212, 96, 122, 0.3);
  --error: #c0392b;
  --success: #4a9e6e;
  --radius-card: 14px;
  --radius-tag: 20px;
  --radius-cta: 16px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 600px 400px at 20% 10%, rgba(242, 181, 197, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 60%, rgba(212, 96, 122, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 90%, rgba(242, 181, 197, 0.08) 0%, transparent 70%);
}

/* ---- App Container ---- */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 24px);
}

/* ---- Header ---- */
.header {
  padding: 28px 0 20px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header__logo-mark {
  width: auto;
  height: 52px;
  flex-shrink: 0;
}

.header__logo-mark img {
  height: 100%;
  width: auto;
  display: block;
}

.header__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}

.header__tagline {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* ---- Queue Badge ---- */
.queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.queue-badge[hidden] {
  display: none;
}

.queue-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

/* ---- Offline Toast ---- */
.offline-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #e74c3c;
  letter-spacing: 0.03em;
}

.offline-toast[hidden] {
  display: none;
}

/* ---- Upload Zone ---- */
.upload-zone {
  background: var(--surface);
  border: 1.5px dashed var(--border-accent);
  border-radius: var(--radius-card);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 24px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:active {
  background: rgba(212, 96, 122, 0.06);
  border-color: var(--pink);
}

.upload-zone--has-files {
  border-style: solid;
  border-color: var(--border);
  padding: 16px;
  cursor: default;
}

.upload-zone__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-zone__icon {
  color: var(--pink);
  opacity: 0.7;
}

.upload-zone__text {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.upload-zone__hint {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ---- Preview Grid ---- */
.upload-zone__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.upload-zone__grid[hidden] {
  display: none;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(42, 31, 34, 0.06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-item__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(42, 31, 34, 0.75);
  border: 1px solid rgba(42, 31, 34, 0.2);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
  padding: 0;
  line-height: 1;
}

.preview-item__remove:active {
  background: var(--error);
  transform: scale(0.9);
}

.preview-item__duration {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(42, 31, 34, 0.75);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.03em;
  z-index: 2;
}

.preview-item__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(42, 31, 34, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.preview-item__play svg {
  width: 14px;
  height: 14px;
  fill: var(--text);
  margin-left: 2px;
}

.preview-item__add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  aspect-ratio: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.preview-item__add:active {
  border-color: var(--pink);
  background: rgba(212, 96, 122, 0.06);
}

.preview-item__add svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-dim);
}

.preview-item__error {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(192, 57, 43, 0.9);
  color: var(--text);
  font-size: 10px;
  padding: 4px 6px;
  text-align: center;
  letter-spacing: 0.03em;
  z-index: 2;
}

/* ---- Style Selector ---- */
.section-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.style-selector {
  margin-bottom: 24px;
}

.style-selector__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-tag {
  padding: 9px 16px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.style-tag:active {
  transform: scale(0.96);
}

.style-tag--selected {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

/* ---- Custom Style Input (Other) ---- */
.custom-style-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}

.custom-style-input::placeholder {
  color: var(--text-dim);
}

.custom-style-input:focus {
  border-color: var(--pink);
}

.custom-style-input[hidden] {
  display: none;
}

/* ---- Caption ---- */
.caption-section {
  margin-bottom: 28px;
}

.caption-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}

.caption-input::placeholder {
  color: rgba(42, 31, 34, 0.3);
}

.caption-input:focus {
  border-color: var(--border-accent);
}

.caption-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

/* ---- Submit Button ---- */
.submit-btn {
  width: 100%;
  height: 56px;
  border-radius: var(--radius-cta);
  border: none;
  background: linear-gradient(135deg, #b84560 0%, var(--pink) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  margin-bottom: 28px;
}

.submit-btn:active:not(:disabled):not(.submit-btn--sending) {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.submit-btn--sending {
  cursor: wait;
}

.submit-btn--success {
  background: linear-gradient(135deg, var(--success) 0%, #3d8b5e 100%);
  animation: success-pop 0.3s ease;
}

@keyframes success-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.submit-btn__text,
.submit-btn__loader,
.submit-btn__success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.submit-btn__loader[hidden],
.submit-btn__success[hidden] {
  display: none;
}

.submit-btn__shimmer {
  background: linear-gradient(
    90deg,
    rgba(42, 31, 34, 0.8) 0%,
    rgba(42, 31, 34, 0.5) 40%,
    rgba(42, 31, 34, 0.8) 60%,
    rgba(42, 31, 34, 0.8) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding-bottom: 8px;
}

.footer__schedule {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.footer__powered {
  font-size: 11px;
  color: rgba(42, 31, 34, 0.25);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer__powered strong {
  color: rgba(42, 31, 34, 0.35);
  font-weight: 600;
}

/* ---- Instructions Button ---- */
.instructions-btn {
  display: inline-block;
  margin: 12px auto 14px;
  padding: 10px 24px;
  background: #f5c842;
  color: #2a1f22;
  border: none;
  border-radius: var(--radius-tag);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}

.instructions-btn:active {
  transform: scale(0.96);
  background: #e6b830;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 34, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-overlay[hidden] {
  display: none;
}

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

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  max-width: 400px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(42, 31, 34, 0.15);
  animation: slideUp 0.3s ease;
}

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

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--pink-soft);
  color: var(--pink);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  -webkit-appearance: none;
}

.modal__close:active {
  background: var(--pink-light);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  padding-right: 30px;
  line-height: 1.3;
}

.modal__section {
  margin-bottom: 20px;
}

.modal__subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--pink);
  margin-bottom: 10px;
}

.modal__steps {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0;
}

.modal__steps li {
  counter-increment: steps;
  padding: 8px 0 8px 32px;
  position: relative;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.modal__steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  background: var(--pink-soft);
  color: var(--pink);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__note {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--pink-soft);
  border-radius: 12px;
}

.modal__got-it {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-cta);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
}

.modal__got-it:active {
  transform: scale(0.98);
}

.modal__never {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 0.02em;
  -webkit-appearance: none;
}

.modal__never:active {
  color: var(--text);
}

/* ---- Utility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 481px) {
  .app {
    padding-top: 40px;
  }
}
