/* ============================================
   Luna Ravel - Nada de Ti LP
   Mobile-first, 1 screen, zero scroll
   ============================================ */

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

:root {
  /* Colors */
  --bg-dark: #0a1628;
  --bg-mid: #0f1d32;
  --bg-light: #1a2a4a;
  --text-primary: #ffffff;
  --text-secondary: #8a9bb0;
  --text-muted: #5a6a7a;
  --spotify-green: #1DB954;
  --spotify-green-hover: #1ed760;
  --spotify-green-active: #169c46;
  
  /* Spacing */
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(
    180deg,
    var(--bg-dark) 0%,
    var(--bg-mid) 40%,
    var(--bg-light) 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  color: var(--text-primary);
  overflow: hidden; /* Prevent scroll */
}

/* Main Container - Full viewport, centered */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1rem;
  padding-top: calc(1rem + var(--safe-area-top));
  padding-bottom: calc(1.5rem + var(--safe-area-bottom) + 24px); /* Extra 24px for iOS home bar safety */
}

/* Card - Central content wrapper */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

/* Album Cover */
.cover-wrapper {
  width: 100%;
  max-width: 280px;
  margin-bottom: 1.5rem;
}

.cover {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

/* Typography */
.title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.artist {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* CTA Button - Spotify */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: var(--spotify-green);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 50px;
  min-height: 56px; /* Tap-safe: > 48px */
  min-width: 220px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 4px 16px rgba(29, 185, 84, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cta-button:hover {
  background-color: var(--spotify-green-hover);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(29, 185, 84, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.15);
}

.cta-button:active {
  background-color: var(--spotify-green-active);
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(29, 185, 84, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

.cta-button:focus {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* Spotify Icon */
.spotify-icon {
  flex-shrink: 0;
}

/* Loading State */
.cta-loading {
  display: none;
  position: absolute;
  right: 1rem;
}

.cta-button.loading .cta-loading {
  display: flex;
}

.cta-button.loading {
  background-color: var(--spotify-green-active);
  pointer-events: none;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  padding-bottom: calc(1.5rem + var(--safe-area-bottom) + 24px); /* Extra 24px for iOS home bar safety */
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.9) 0%,
    rgba(10, 22, 40, 0) 100%
  );
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-secondary);
}

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

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Small phones (< 375px) */
@media (max-width: 374px) {
  .cover-wrapper {
    max-width: 220px;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .artist {
    font-size: 1rem;
  }
  
  .cta-button {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    min-width: 200px;
  }
}

/* Tablets and larger screens */
@media (min-width: 768px) {
  .cover-wrapper {
    max-width: 320px;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .artist {
    font-size: 1.25rem;
    margin-bottom: 2rem;
  }
  
  .cta-button {
    font-size: 1.25rem;
    padding: 1.125rem 2.5rem;
    min-height: 60px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .cover-wrapper {
    max-width: 360px;
  }
  
  .title {
    font-size: 2.25rem;
  }
}

/* Landscape orientation on mobile - adjust layout */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
  }
  
  .card {
    flex-direction: row;
    gap: 2rem;
    max-width: none;
  }
  
  .cover-wrapper {
    max-width: 200px;
    margin-bottom: 0;
  }
  
  .card > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  
  .footer {
    padding-bottom: 0.5rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cta-button {
    border: 2px solid var(--text-primary);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cta-button {
    transition: none;
  }
  
  .spinner {
    animation: none;
  }
}
