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

:root {
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-light: #EFF6FF;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --background: #F9FAFB;
  --white: #FFFFFF;
  --success: #10B981;
  --success-bg: #D1FAE5;
  --error: #EF4444;
  --error-bg: #FEE2E2;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-primary);
  background-color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-cta {
  background: var(--primary);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--primary-hover);
}

/* Hero Section */
.hero {
  padding: 80px 0 100px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--white) 100%);
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.125rem;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* How It Works */
.how-it-works {
  padding: 80px 0;
  background: var(--white);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  text-align: center;
  padding: 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.step-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Features */
.features {
  padding: 80px 0;
  background: var(--background);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.feature {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
  padding: 80px 0;
  text-align: center;
  background: var(--primary);
  color: var(--white);
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 32px;
}

.cta-section .btn-primary {
  background: var(--white);
  color: var(--primary);
}

.cta-section .btn-primary:hover {
  background: var(--background);
}

/* Footer */
.footer {
  padding: 40px 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* App Page */
.app-main {
  padding: 40px 0;
  min-height: calc(100vh - 73px);
  background: var(--background);
}

.app-header {
  margin-bottom: 32px;
}

.app-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.app-header p {
  color: var(--text-secondary);
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.input-section,
.output-section {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea::placeholder {
  color: var(--text-muted);
}

.textarea-large {
  min-height: 200px;
}

.textarea-medium {
  min-height: 120px;
}

/* Tone Selector */
.tone-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tone-btn {
  padding: 10px 20px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tone-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tone-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Output Area */
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.output-header label {
  margin-bottom: 0;
}

.output-area {
  min-height: 300px;
  padding: 20px;
  background: var(--background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 260px;
  color: var(--text-muted);
  text-align: center;
}

.output-placeholder svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.response-text {
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Voice Notice */
.voice-notice {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius);
}

.voice-notice p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.voice-notice a {
  color: var(--primary);
  font-weight: 500;
}

/* Messages */
.error-message {
  padding: 16px;
  background: var(--error-bg);
  color: var(--error);
  border-radius: var(--radius);
  margin-top: 20px;
  font-size: 0.95rem;
}

.success-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius);
  margin-top: 20px;
  font-size: 0.95rem;
}

.success-message a {
  color: var(--success);
  font-weight: 600;
}

/* Voice Training Page */
.voice-container {
  max-width: 700px;
}

.info-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.info-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-content h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.info-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.voice-form {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  animation: rotate 1s linear infinite;
}

.spinner-circle {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .tone-selector {
    flex-direction: column;
  }

  .tone-btn {
    width: 100%;
  }

  .info-card {
    flex-direction: column;
  }

  .voice-form {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .navbar {
    padding: 12px 0;
  }

  .logo {
    font-size: 1.25rem;
  }

  .hero {
    padding: 60px 0 80px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .btn-large {
    padding: 14px 24px;
    font-size: 1rem;
  }
}
