/**
 * Gipsy Services Frontend - Main Styles
 * Following the exact design from provided images
 */

/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: "Gipsy Neue Regrade";
  line-height: 1.6;
  color: #333;
  background: #fff;
  overflow-x: hidden;
}

/* Screen Management */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* ======================
   INPUT SCREEN STYLES
   ====================== */

#inputScreen {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.input-container {
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.hero-section {
  margin-bottom: 4rem;
}

.hero-title {
  font-size: clamp(4rem, 12vw, 12rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  color: #5400ff;
  text-transform: uppercase;
}

.hero-title span {
  display: block;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-title .wanna {
  animation-delay: 0.1s;
  font-size: 250px;
  margin-bottom: 20px;
}
.hero-title .see-how {
  animation-delay: 0.2s;
  font-size: 226px;
}
.hero-title .far-your {
  animation-delay: 0.3s;
  font-size: 122px;
}
.hero-title .could-go {
  animation-delay: 0.4s;
  font-size: 183px;
}

.hero-subtitle {
  font-size: 87px;
  font-weight: 800;
  color: #5400ff;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.6s forwards;
}

.form-container {
  z-index: 10;
  margin: -97px auto -40px auto;
  position: relative;
  width: 1000px;
}

.search-form {
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.8s forwards;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 80px;
  z-index: 10;
}

.input-group {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 80px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

#companyInput {
  font-family: "Gipsy Neue Regrade";
  font-weight: 800;
  width: 100%;
  padding: 1.5rem 2rem;
  padding-right: 5rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  border: none;
  outline: none;
  background: transparent;
  color: #39ff14;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#companyInput::placeholder {
  color: #39ff14;
  opacity: 0.7;
}

.submit-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translate(-20px, -50%);
  width: 3.5rem;
  height: 3.5rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.submit-btn svg {
  width: 100%;
  height: 100%;
  color: #39ff14;
}
.submit-btn:hover svg {
  color: #fff;
}

.submit-btn:hover {
  background: #39ff14;
  /* transform: translateY(-50%) scale(1.05); */
}

.submit-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* ======================
   RESULTS SCREEN STYLES
   ====================== */

#resultsScreen {
  background: white;
  overflow-y: auto;
}

.results-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 0;
  padding-bottom: 0;
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #5400ff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #f3f4f6;
}

.company-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #39ff14;
  letter-spacing: -0.05em;
  margin: 0;
  line-height: 11rem;
  text-transform: capitalize;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Player Section */
.player-section {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  flex-shrink: 0;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.player-icon {
  width: 4.5rem;
  height: 4.5rem;
  background: #1f2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.player-details {
  display: flex;
  flex-direction: column;
  line-height: 1.5rem;
}

.player-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

.player-company {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #1f2937;
  text-transform: capitalize;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-btn {
  width: 4.5rem;
  height: 4.5rem;
  background: #5400ff;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.play-btn:hover {
  background: #5400ff;
  transform: scale(1.05);
}

.waveform-container {
  flex: 1;
  height: 240px;
  background: transparent;
  overflow: hidden;
  position: relative;
  border: none;
}

#waveform {
  width: 100%;
  height: 100%;
}

/* SoundCloud-style waveform customization */
#waveform wave {
  cursor: pointer;
}

#waveform canvas {
  border-radius: 6px;
}

/* Ensure proper waveform rendering */
.waveform-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.time-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  font-family: "Monaco", "Menlo", monospace;
  flex-shrink: 0;
}

.time-separator {
  color: #d1d5db;
}

/* Analysis Content */
.analysis-content {
  background: transparent;
  border-radius: 16px;
  padding: 2rem;
  border: none;
  flex-shrink: 2;
  overflow: hidden;
}

.analysis-text {
  max-width: none;
  line-height: 1.7;
}

.analysis-text h2 {
  font-size: clamp(6rem, 3vw, 2rem);
  font-weight: 800;
  color: #5400ff;
  margin-bottom: 0;
  margin-top: 2rem;
  letter-spacing: -0.03em;
  line-height: 1.2em;
}

.analysis-text h2:first-child {
  margin-top: 0;
}

.analysis-text h3 {
  font-size: clamp(2.5rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #28007a;
  margin-bottom: 0.5rem;
  margin-top: 2.5rem;
}

.analysis-text:first-child h3 {
  margin-top: 0;
}

.analysis-text p {
  font-size: clamp(1.6rem, 1.5vw, 1.1rem);
  color: #28007a;
  margin-bottom: 1.5rem;
  text-align: left;
  letter-spacing: -0.02em;
  line-height: 1.5em;
}

.analysis-text strong {
  color: #28007a;
  font-weight: 600;
}

/* ======================
   ERROR SCREEN STYLES
   ====================== */

#errorScreen {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-container {
  text-align: center;
  max-width: 500px;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.retry-btn {
  background: #5400ff;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: #5400ff;
  transform: translateY(-2px);
}

/* ======================
   LOADING OVERLAY
   ====================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  padding: 2rem;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #5400ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #5400ff;
  margin-bottom: 0.5rem;
}

/* ======================
   UTILITY CLASSES
   ====================== */

.hidden {
  display: none !important;
}

.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;
}

/* ======================
   ANIMATIONS
   ====================== */

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

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ======================
   FOCUS STYLES
   ====================== */

button:focus-visible,
input:focus-visible {
  outline: 2px solid #5400ff;
  outline-offset: 2px;
}

/* ======================
   PRINT STYLES
   ====================== */

@media print {
  .screen:not(#resultsScreen) {
    display: none;
  }

  .results-header,
  .player-section {
    display: none;
  }

  .analysis-content {
    box-shadow: none;
    border: none;
  }
}

/* ======================
   PLAYER STYLES
   ====================== */

#waveform {
  cursor: pointer;
  position: relative;
}
#hover {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  pointer-events: none;
  height: 100%;
  width: 0;
  mix-blend-mode: overlay;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
#waveform:hover #hover {
  opacity: 1;
}
#time,
#currentTime,
#duration {
  position: absolute;
  z-index: 11;
  top: 50%;
  margin-top: -1px;
  transform: translateY(-50%);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px;
  color: #ddd;
}
#time,
#currentTime {
  left: 0;
}
#duration {
  right: 0;
}
