/* ============================================================
   Pink + Silver Sparkle Luxury Style - Voice Gift QR System
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --pink-light: #FFE4EC;
  --pink: #FF69B4;
  --pink-dark: #E75480;
  --pink-deep: #C71585;
  --silver: #C0C0C0;
  --silver-light: #E8E8E8;
  --silver-dark: #A9A9A9;
  --silver-shine: #F0F0F0;
  --white: #FFFFFF;
  --black: #1A1A2E;
  --gray: #666;
  --gray-light: #999;
  --gradient-pink: linear-gradient(135deg, #FF69B4 0%, #FF1493 50%, #C71585 100%);
  --gradient-silver: linear-gradient(135deg, #E8E8E8 0%, #C0C0C0 50%, #A9A9A9 100%);
  --gradient-sparkle: linear-gradient(135deg, #FFE4EC 0%, #FF69B4 30%, #FF1493 60%, #C71585 100%);
  --shadow-pink: 0 4px 20px rgba(255, 105, 180, 0.3);
  --shadow-silver: 0 4px 20px rgba(192, 192, 192, 0.3);
  --shadow-sparkle: 0 0 30px rgba(255, 105, 180, 0.2), 0 0 60px rgba(192, 192, 192, 0.1);
  --font-main: 'Georgia', 'Times New Roman', serif;
  --font-accent: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  --radius: 20px;
  --radius-sm: 12px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-main);
  background: var(--gradient-sparkle);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Sparkle Background ---- */
.sparkle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--white);
  border-radius: 50%;
  animation: sparkleFloat 3s ease-in-out infinite;
  opacity: 0;
}

.sparkle::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: -8px;
  font-size: 16px;
  color: var(--silver-light);
  text-shadow: 0 0 6px var(--silver), 0 0 12px var(--pink);
}

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  50% { transform: translateY(-20px) scale(1); opacity: 0.8; }
  100% { transform: translateY(-40px) scale(0); opacity: 0; }
}

/* ---- Container ---- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- Card ---- */
.card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 35px 25px;
  width: 100%;
  box-shadow: var(--shadow-sparkle);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    rgba(255, 105, 180, 0.05),
    transparent,
    rgba(192, 192, 192, 0.05),
    transparent
  );
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Logo / Icon ---- */
.logo {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
  background: var(--gradient-pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-pink);
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.2; }
}

.logo-icon svg {
  width: 40px;
  height: 40px;
  fill: var(--white);
}

.logo h1 {
  font-family: var(--font-accent);
  font-size: 28px;
  background: var(--gradient-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  font-weight: 700;
}

.logo p {
  color: var(--gray);
  font-size: 13px;
  margin-top: 5px;
  font-style: italic;
  letter-spacing: 1px;
}

/* ---- Decorative Line ---- */
.divider {
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--silver), var(--pink), transparent);
  margin: 20px auto;
  position: relative;
}

.divider::before,
.divider::after {
  content: '◆';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: var(--pink);
}

.divider::before { left: -5px; }
.divider::after { right: -5px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border: none;
  border-radius: 50px;
  font-family: var(--font-accent);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
  width: 100%;
  max-width: 280px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-pink);
  color: var(--white);
  box-shadow: var(--shadow-pink);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(255, 105, 180, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: var(--gradient-silver);
  color: var(--black);
  box-shadow: var(--shadow-silver);
}

.btn-secondary:hover {
  box-shadow: 0 6px 30px rgba(192, 192, 192, 0.4);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.97);
}

.btn-outline {
  background: transparent;
  color: var(--pink-dark);
  border: 2px solid var(--pink);
}

.btn-outline:hover {
  background: var(--pink);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Recording Button (special) ---- */
.btn-record {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 0;
  background: var(--gradient-pink);
  box-shadow: var(--shadow-pink);
  border: 3px solid var(--white);
  position: relative;
}

.btn-record::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 105, 180, 0.3);
  animation: pulseRing 1.5s ease-in-out infinite;
}

.btn-record.recording {
  background: var(--gradient-silver);
  animation: recordPulse 1s ease-in-out infinite;
}

.btn-record.recording::before {
  border-color: rgba(192, 192, 192, 0.3);
}

@keyframes recordPulse {
  0%, 100% { box-shadow: var(--shadow-pink); }
  50% { box-shadow: 0 0 0 15px rgba(255, 105, 180, 0.1), 0 0 0 30px rgba(255, 105, 180, 0.05); }
}

.btn-record svg {
  width: 30px;
  height: 30px;
  fill: var(--white);
}

/* ---- Timer Display ---- */
.timer {
  font-family: var(--font-accent);
  font-size: 48px;
  font-weight: 700;
  color: var(--pink-deep);
  text-align: center;
  margin: 15px 0;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
}

.timer-label {
  font-size: 14px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 5px;
  font-style: italic;
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--silver-light);
  border-radius: 2px;
  margin: 15px 0;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-pink);
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 8px;
  height: 8px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--pink);
}

/* ---- Status Messages ---- */
.status {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin: 10px 0;
  line-height: 1.6;
}

.status-info {
  background: rgba(255, 105, 180, 0.08);
  color: var(--pink-deep);
  border: 1px solid rgba(255, 105, 180, 0.15);
}

.status-success {
  background: rgba(0, 200, 150, 0.08);
  color: #008060;
  border: 1px solid rgba(0, 200, 150, 0.15);
}

.status-error {
  background: rgba(255, 50, 50, 0.08);
  color: #cc3333;
  border: 1px solid rgba(255, 50, 50, 0.15);
}

.status-reminder {
  background: rgba(255, 193, 7, 0.1);
  color: #b8860b;
  border: 1px solid rgba(255, 193, 7, 0.2);
  animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---- Waveform Animation ---- */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  margin: 15px 0;
}

.waveform-bar {
  width: 4px;
  background: var(--gradient-pink);
  border-radius: 2px;
  animation: waveAnim 0.8s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 35px; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 25px; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; height: 40px; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; height: 30px; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; height: 38px; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; height: 22px; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; height: 35px; }
.waveform-bar:nth-child(9) { animation-delay: 0.8s; height: 28px; }
.waveform-bar:nth-child(10) { animation-delay: 0.9s; height: 32px; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* ---- Play Button ---- */
.btn-play {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 0;
  background: var(--gradient-pink);
  box-shadow: var(--shadow-pink);
  border: 3px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 15px auto;
}

.btn-play:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 105, 180, 0.4);
}

.btn-play:active {
  transform: scale(0.95);
}

.btn-play svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
  margin-left: 3px;
}

/* ---- Play Progress ---- */
.play-progress {
  width: 100%;
  margin: 10px 0;
}

.play-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray);
  font-family: var(--font-accent);
  margin-top: 5px;
}

/* ---- Gift Code Display ---- */
.gift-code-display {
  text-align: center;
  margin: 10px 0;
  padding: 10px;
  background: rgba(192, 192, 192, 0.1);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--silver);
}

.gift-code-display label {
  font-size: 11px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.gift-code-display .code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--pink-deep);
  letter-spacing: 2px;
  margin-top: 3px;
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--silver-light);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Hidden Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Fade In Animation ---- */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Slide Up Animation ---- */
.slide-up {
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Heart Decoration ---- */
.heart-deco {
  text-align: center;
  font-size: 20px;
  color: var(--pink);
  margin: 10px 0;
  opacity: 0.6;
  letter-spacing: 8px;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .card {
    padding: 25px 20px;
    border-radius: 16px;
  }

  .logo h1 {
    font-size: 24px;
  }

  .timer {
    font-size: 40px;
  }

  .btn {
    padding: 14px 28px;
    font-size: 15px;
  }

  .btn-record {
    width: 70px;
    height: 70px;
  }

  .btn-play {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 360px) {
  .card {
    padding: 20px 15px;
  }

  .logo h1 {
    font-size: 20px;
  }

  .timer {
    font-size: 34px;
  }
}

/* ---- Safe Area for Notch Phones ---- */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}
