/**
 * Sayver Voice Review Styles
 * Integrates recorder interface with existing Sayver website design
 */

/* ============================================================================
   Reset and Base Styles
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   Header Styles (Existing Sayver Design)
   ============================================================================ */

.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.5rem;
  color: #1f2937;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #10b981;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.logo-text {
  color: #1f2937;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #1f2937;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-secondary {
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f9fafb;
  color: #1f2937;
}

.btn-primary {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #059669;
}

/* ============================================================================
   Main Content Area
   ============================================================================ */

.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px); /* Account for header and footer */
  padding: 40px 20px;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.hidden {
  display: none !important;
}

/* ============================================================================
   State Containers
   ============================================================================ */

.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 600px;
  width: 100%;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.state-container h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  font-weight: 700;
  color: #1f2937;
}

.state-container p {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #6b7280;
}

/* Loading State */
.loading-spinner {
  border: 4px solid #e5e7eb;
  border-top: 4px solid #10b981;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error State */
.error-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.support-info {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #6b7280;
}

.support-info a {
  color: #10b981;
  text-decoration: none;
}

.support-info a:hover {
  text-decoration: underline;
}

/* Thank You State */
.success-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.back-button {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 24px;
  background: #10b981;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.back-button:hover {
  background: #059669;
}

/* ============================================================================
   Recording UI
   ============================================================================ */

.recorder-section {
  width: 100%;
  max-width: 500px;
}

.recorder-header {
  text-align: center;
  margin-bottom: 40px;
}

.recorder-header h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: #1f2937;
  font-weight: 700;
}

#product-title {
  font-size: 1.2rem;
  color: #6b7280;
  font-weight: 500;
}

.recorder-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.record-button,
.submit-button,
.file-upload-label {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.record-button:hover,
.submit-button:hover,
.file-upload-label:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.record-button:active,
.submit-button:active,
.file-upload-label:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.record-button:disabled,
.submit-button:disabled,
.file-upload-label:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.button-icon {
  font-size: 1.2rem;
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #10b981;
  font-size: 1.1rem;
  font-weight: 600;
}

.pulse-animation {
  width: 12px;
  height: 12px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.7;
  }
}

.audio-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.listen-text {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  text-align: center;
}

.audio-preview audio {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  background: #f9fafb;
  padding: 8px;
}

.message-text {
  color: #6b7280;
  font-size: 0.95rem;
  min-height: 20px;
  text-align: center;
}

/* File Capture Fallback */
.file-capture-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.file-input {
  display: none;
}

.file-name {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ============================================================================
   Footer Styles (Existing Sayver Design)
   ============================================================================ */

.footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-tagline {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-column h4 {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.footer-column a {
  display: block;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #1f2937;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: #1f2937;
}

/* ============================================================================
   Media Queries (Mobile-First)
   ============================================================================ */

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 16px 20px;
    gap: 16px;
  }

  .nav {
    gap: 20px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .state-container {
    padding: 30px 20px;
  }

  .recorder-header h1 {
    font-size: 2rem;
  }

  .record-button,
  .submit-button,
  .file-upload-label {
    padding: 14px 28px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .state-container h2 {
    font-size: 1.5rem;
  }

  .state-container p {
    font-size: 1rem;
  }

  .recorder-header h1 {
    font-size: 1.8rem;
  }

  .record-button,
  .submit-button,
  .file-upload-label {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
  .header,
  .footer {
    display: none;
  }

  .main-content {
    min-height: auto;
  }

  .state-container {
    box-shadow: none;
    border: 1px solid #000;
  }
}
