/* ========================================
   VALENTINE PROPOSAL APP - MAIN STYLES
   Premium Cinematic Design
   ======================================== */

/* CSS Variables */
:root {
  /* Base colors */
  --bg-dark: #0a0a0f;
  --text-light: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  
  /* Glass effect */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Animations */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
  --font-script: 'Great Vibes', cursive;
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Particles Container */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Main Content Container */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transform: skewX(-15deg);
  pointer-events: none;
}

/* Typography */
.title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.script-text {
  font-family: var(--font-script);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Gender Selection */
.gender-select {
  display: flex;
  gap: 1rem;
}

.gender-option {
  flex: 1;
  position: relative;
}

.gender-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.gender-option label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gender-option input:checked + label {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.15);
}

.gender-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 20px var(--glow-color);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow-color);
}

.btn-yes {
  background: linear-gradient(135deg, #ff6b8a, #ff8fab);
  color: white;
  font-size: 1.25rem;
  padding: 1.25rem 3rem;
  box-shadow: 0 4px 30px rgba(255, 107, 138, 0.4);
}

.btn-yes:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 40px rgba(255, 107, 138, 0.6);
}

.btn-no {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.75rem 1.5rem;
  transition: var(--transition-bounce);
}

.btn-no:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-block {
  width: 100%;
}

/* Status Indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-pending {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-opened {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.status-accepted {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

/* Link Display */
.link-display {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.link-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.link-url {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.link-url input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-family: monospace;
  font-size: 0.875rem;
  outline: none;
}

.btn-copy {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-copy.copied {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

/* Proposal Question */
.proposal-question {
  text-align: center;
  padding: 2rem 0;
}

.partner-name {
  font-family: var(--font-script);
  font-size: clamp(2.5rem, 8vw, 4rem);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.proposal-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.proposal-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Celebration Names */
.celebration-names {
  text-align: center;
  margin: 2rem 0;
}

.names-display {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.6;
}

.heart-icon {
  display: inline-block;
  color: #ff6b8a;
  animation: heartbeat 1.5s infinite;
  margin: 0 0.5rem;
}

/* Audio Overlay */
.audio-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.audio-overlay.hidden {
  display: none;
}

.tap-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.tap-text {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(1.2);
  }
  20% {
    transform: scale(1.1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--glow-color);
  }
  50% {
    box-shadow: 0 0 40px var(--glow-color), 0 0 60px var(--glow-color);
  }
}

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

/* Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Tracking Page */
.tracking-container {
  text-align: center;
}

.tracking-status {
  margin: 2rem 0;
}

.status-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.status-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.status-description {
  color: var(--text-muted);
}

.tracking-info {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.info-value {
  font-weight: 500;
}

/* Success Animation Container */
.success-container {
  text-align: center;
  display: none;
}

.success-container.visible {
  display: block;
}

/* Responsive Design - Mobile First */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }
  
  .glass-card {
    max-width: 450px;
    padding: 2.5rem;
  }
}

/* Tablets */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .app-container {
    padding: 1.5rem;
    min-height: 100svh; /* Use small viewport height for mobile browsers */
  }
  
  .glass-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
    max-width: 100%;
  }
  
  /* Typography adjustments */
  .main-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .subtitle {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }
  
  /* Form layout changes */
  .gender-select {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .gender-option {
    padding: 1rem;
  }
  
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-input {
    padding: 0.875rem 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Proposal adjustments */
  .proposal-buttons {
    width: 100%;
  }
  
  .btn-yes {
    width: 100%;
    padding: 1rem 2rem;
  }
  
  .btn-no {
    min-width: auto;
    padding: 0.75rem 1.5rem;
  }
  
  /* Names display */
  .names-display {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
  
  /* Audio overlay */
  .tap-icon {
    font-size: 3.5rem;
  }
  
  .tap-text {
    font-size: 1.1rem;
  }
  
  /* Tracking page adjustments */
  .tracking-info {
    padding: 1.25rem;
  }
  
  .link-url {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .link-url input {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
  }
  
  .btn-copy {
    width: 100%;
    padding: 0.75rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .app-container {
    padding: 1rem;
    padding-top: env(safe-area-inset-top, 1rem);
    padding-bottom: env(safe-area-inset-bottom, 1rem);
  }
  
  .glass-card {
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
  }
  
  /* Typography for small screens */
  .main-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    margin-bottom: 0.5rem;
  }
  
  .subtitle {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    margin-bottom: 1.5rem;
  }
  
  /* Button adjustments */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    min-height: 48px; /* Touch target minimum */
  }
  
  .btn-yes {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
  }
  
  .btn-no {
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
    min-height: 44px;
  }
  
  /* Form inputs - larger touch targets */
  .form-input {
    padding: 1rem;
    font-size: 16px;
    min-height: 50px;
  }
  
  .form-textarea {
    min-height: 100px;
  }
  
  /* Gender selection */
  .gender-option {
    padding: 0.875rem;
  }
  
  .gender-icon {
    font-size: 1.5rem;
  }
  
  .gender-label {
    font-size: 0.9rem;
  }
  
  /* Partner name display */
  .partner-name {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  
  .proposal-text {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    margin-bottom: 1.5rem;
  }
  
  /* Tracking page */
  .tracking-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .info-label {
    font-size: 0.8rem;
  }
  
  .info-value {
    font-size: 0.95rem;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .app-container {
    padding: 0.75rem;
  }
  
  .glass-card {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }
  
  .main-title {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .gender-option {
    padding: 0.75rem;
  }
  
  .gender-icon {
    font-size: 1.25rem;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .app-container {
    padding: 0.75rem 1.5rem;
    min-height: auto;
  }
  
  .glass-card {
    padding: 1.5rem;
    max-width: 600px;
  }
  
  .main-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  
  .subtitle {
    margin-bottom: 1rem;
  }
  
  .form-group {
    margin-bottom: 0.75rem;
  }
  
  .gender-select {
    flex-direction: row;
  }
  
  .audio-overlay {
    flex-direction: row;
    gap: 1rem;
  }
  
  .tap-icon {
    font-size: 2.5rem;
    margin-bottom: 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .glass-card {
    border-width: 0.5px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .heart-icon {
    animation: none;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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