/* ============================================================
   WeddingHub — Core System (Futuristic Glass UI)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300&family=Outfit:wght@200;300;400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.18s var(--ease-out);
  --t-normal: 0.45s var(--ease-out);

  --blur-glass: 26px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 18px 70px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Fine film grain over everything — kills the flat "template" look */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Ambient aurora field ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}

.aurora span:nth-child(1) {
  width: 62vw; height: 62vw;
  top: -22vw; left: -14vw;
  animation: drift-a 26s ease-in-out infinite;
}
.aurora span:nth-child(2) {
  width: 54vw; height: 54vw;
  top: 18vh; right: -20vw;
  animation: drift-b 32s ease-in-out infinite;
}
.aurora span:nth-child(3) {
  width: 70vw; height: 70vw;
  bottom: -30vw; left: 10vw;
  animation: drift-c 38s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vw, 5vh, 0) scale(1.14); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.08); }
  50%      { transform: translate3d(-7vw, 7vh, 0) scale(0.94); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(4vw, -6vh, 0) scale(1.16); }
}

/* Thin scanline / grid veil */
.grid-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

/* ---------- Layout ---------- */
.app-container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 2;
  position: relative;
}

/* Shared glass surface */
.glass {
  position: relative;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  overflow: hidden;
  isolation: isolate;
}

/* Hairline gradient edge on top of every glass panel */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 4;
}

/* ---------- Header ---------- */
.header-card {
  text-align: center;
  padding: 34px 24px 30px;
}

.header-card .halo {
  position: absolute;
  top: -60%;
  left: 50%;
  width: 120%;
  height: 160%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  border-radius: var(--radius-full);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.event-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.7); }
}

.couple-names {
  font-size: clamp(3rem, 13vw, 4.4rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.couple-names .amp {
  display: inline-block;
  font-style: italic;
  font-weight: 300;
  transform: translateY(-2px);
  padding: 0 4px;
}

.rule {
  width: 132px;
  height: 1px;
  margin: 0 auto 16px;
  position: relative;
}

.rule::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  padding: 0 8px;
}

.event-title {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.event-date {
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto;
}

/* ---------- Main panel ---------- */
.main-card {
  padding: 26px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: -6px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
}

.section-label .idx { opacity: 0.75; }

/* ---------- Fields (floating label) ---------- */
.field {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  padding: 22px 16px 10px;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-family: inherit;
  font-weight: 400;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.field label {
  position: absolute;
  left: 16px;
  top: 15px;
  font-size: 0.95rem;
  font-weight: 300;
  pointer-events: none;
  transform-origin: left top;
  transition: transform var(--t-fast), opacity var(--t-fast), color var(--t-fast);
}

.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-9px) scale(0.72);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field .hint {
  display: block;
  margin-top: 6px;
  padding-left: 4px;
  font-size: 0.74rem;
  font-weight: 300;
}

/* ---------- Drop zone ---------- */
.drop-zone {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 38px 20px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--t-normal), background var(--t-normal);
}

.drop-zone:hover { transform: translateY(-3px); }
.drop-zone:active { transform: translateY(0); }

/* Animated dashed frame */
.drop-zone .frame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px dashed;
  pointer-events: none;
  transition: border-color var(--t-normal);
}

.drop-zone .sheen {
  position: absolute;
  top: -120%;
  left: -30%;
  width: 60%;
  height: 340%;
  transform: rotate(18deg);
  pointer-events: none;
  animation: sheen-sweep 6.5s ease-in-out infinite;
}

@keyframes sheen-sweep {
  0%, 62%  { transform: translateX(-40%) rotate(18deg); opacity: 0; }
  70%      { opacity: 1; }
  100%     { transform: translateX(320%) rotate(18deg); opacity: 0; }
}

.drop-orb {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.drop-orb svg {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 2;
}

.drop-orb .ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid;
  animation: orb-spin 14s linear infinite;
}

.drop-orb .ring::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
}

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

.drop-title {
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.drop-subtitle {
  font-size: 0.85rem;
  font-weight: 300;
  max-width: 330px;
  line-height: 1.55;
}

.drop-formats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.format-chip {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-full);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: none;
  overflow: hidden;
  transition: transform var(--t-normal), box-shadow var(--t-normal), background var(--t-normal), opacity var(--t-fast);
}

.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn-full { width: 100%; }

/* Shine sweep on primary actions */
.btn-primary::after,
.btn-accent::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s var(--ease-out);
}

.btn-primary:hover::after,
.btn-accent:hover::after { left: 130%; }

.btn-ghost {
  background: transparent;
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 400;
}

/* ---------- Selected files ---------- */
.selected-files-card {
  border-radius: var(--radius-md);
  padding: 16px;
  animation: rise-in 0.45s var(--ease-out);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid;
}

.queue-title {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.queue-size {
  display: block;
  font-size: 0.74rem;
  font-weight: 300;
  margin-top: 3px;
}

.btn-clear {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  transition: var(--t-fast);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
}

.file-list::-webkit-scrollbar { width: 4px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { border-radius: 4px; }

.file-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  overflow: hidden;
  animation: rise-in 0.35s var(--ease-out) backwards;
}

/* Per-file progress underline */
.file-item .file-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  transition: width 0.25s ease;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  flex: 1;
}

.file-thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.file-icon-thumb {
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.file-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.file-size {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.file-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-status-badge {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-full);
}

.file-status-badge.status-uploading { background: rgba(56, 132, 255, 0.18); color: #7cb0ff; }
.file-status-badge.status-success   { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.file-status-badge.status-error     { background: rgba(239, 68, 68, 0.2);  color: #f87171; }

.btn-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  opacity: 0.5;
  transition: var(--t-fast);
}

.btn-remove-file svg { width: 12px; height: 12px; }
.btn-remove-file:hover { opacity: 1; color: #f87171; }

/* ---------- Footer ---------- */
.page-footer {
  text-align: center;
  padding: 4px 0 0;
}

.switch-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 300;
  letter-spacing: 0.3px;
  transition: var(--t-normal);
}

.switch-link:hover { transform: translateY(-2px); }

.signature {
  margin-top: 16px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
  padding: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-xl);
  padding: 36px 28px 32px;
  text-align: center;
  transform: translateY(14px) scale(0.97);
  transition: transform var(--t-normal);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-box { transform: none; }

.modal-title {
  font-size: 1.7rem;
  font-weight: 300;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.55;
}

/* ---------- Circular progress ---------- */
.progress-ring {
  --p: 0;
  position: relative;
  width: 178px;
  height: 178px;
  margin: 26px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.progress-ring .track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.progress-ring .fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  transition: background 0.25s linear;
}

.progress-ring .core {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.progress-percent-huge {
  font-family: 'Space Grotesk', monospace;
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1;
}

.progress-percent-huge .pct {
  font-size: 1.05rem;
  font-weight: 400;
  vertical-align: super;
  margin-left: 2px;
  opacity: 0.7;
}

.progress-detail {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.progress-subtext {
  font-size: 0.8rem;
  font-weight: 300;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-bars {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-end;
  height: 18px;
  margin-top: 16px;
}

.pulse-bars i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 3px;
  animation: bar-bounce 1.1s ease-in-out infinite;
}

.pulse-bars i:nth-child(2) { animation-delay: 0.12s; }
.pulse-bars i:nth-child(3) { animation-delay: 0.24s; }
.pulse-bars i:nth-child(4) { animation-delay: 0.36s; }
.pulse-bars i:nth-child(5) { animation-delay: 0.48s; }

@keyframes bar-bounce {
  0%, 100% { transform: scaleY(0.3); opacity: 0.45; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* Success seal */
.success-seal {
  width: 96px;
  height: 96px;
  margin: 4px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  animation: seal-in 0.7s var(--ease-out);
}

@keyframes seal-in {
  0%   { transform: scale(0.4) rotate(-25deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.success-seal svg { width: 38px; height: 38px; }

.success-seal::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid;
  animation: seal-ripple 2.4s ease-out infinite;
}

@keyframes seal-ripple {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ---------- Toast ---------- */
.toast-notification {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  padding: 13px 24px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 400;
  z-index: 200;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.45s var(--ease-out);
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.toast-notification.show { transform: translateX(-50%) translateY(0); }

.toast-notification.toast-success { background: rgba(16, 185, 129, 0.9); }
.toast-notification.toast-warning { background: rgba(217, 119, 6, 0.92); }
.toast-notification.toast-error   { background: rgba(220, 38, 38, 0.92); }
.toast-notification.toast-info    { background: rgba(37, 99, 235, 0.92); }

/* ---------- Confetti ---------- */
.confetti-piece {
  position: fixed;
  top: -20px;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  z-index: 999;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.font-mono { font-family: 'Space Grotesk', monospace; }

@media (max-width: 480px) {
  body { padding: 16px 12px 48px; }
  .header-card { padding: 28px 18px 24px; }
  .main-card { padding: 20px 15px; }
  .drop-zone { padding: 30px 14px 26px; }
  .progress-ring { width: 154px; height: 154px; }
  .modal-box { padding: 30px 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
