/* ==========================================
   Interview Prep Buddy - Styles
   ========================================== */

/* CSS Variables / Design Tokens */
:root {
  /* Colors */
  --primary: 173 80% 40%;
  --primary-foreground: 0 0% 100%;
  --secondary: 173 60% 95%;
  --secondary-foreground: 173 80% 25%;
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 173 60% 90%;
  --accent-foreground: 173 80% 25%;
  --border: 214 32% 91%;
  --ring: 173 80% 40%;
  --success: 142 76% 36%;
  --warning: 38 92% 50%;
  --error: 0 84% 60%;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(173, 80%, 40%), hsl(173, 90%, 50%));
  --gradient-hero: linear-gradient(180deg, hsl(173, 60%, 95%), hsl(var(--background)));

  /* Shadows */
  --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.05);
  --shadow-md: 0 4px 6px -1px hsl(0 0% 0% / 0.1);
  --shadow-lg: 0 10px 30px -10px hsl(173, 80%, 40%, 0.2);
  --shadow-glow: 0 0 40px hsl(173, 80%, 40%, 0.3);

  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* Dark Theme */
[data-theme="dark"] {
  --primary: 173 80% 45%;
  --primary-foreground: 0 0% 100%;
  --secondary: 173 30% 15%;
  --secondary-foreground: 173 60% 80%;
  --background: 222 47% 8%;
  --foreground: 210 40% 98%;
  --card: 222 47% 11%;
  --card-foreground: 210 40% 98%;
  --muted: 217 33% 17%;
  --muted-foreground: 215 20% 65%;
  --accent: 173 30% 20%;
  --accent-foreground: 173 60% 80%;
  --border: 217 33% 20%;

  --gradient-hero: linear-gradient(180deg, hsl(173, 30%, 12%), hsl(var(--background)));
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
img.logo-image {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: hsl(var(--accent));
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: hsl(var(--foreground));
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.mobile-menu.active {
  display: flex;
}

.mobile-link {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .nav-links,
  .nav-actions {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary));
}

.btn-success {
  background: hsl(var(--success));
  color: white;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-record {
  background: hsl(var(--error));
  color: white;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 50px;
}

.btn-record.recording {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================
   Pages
   ========================================== */
.page {
  display: none;
  padding-top: 80px;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
  background: var(--gradient-hero);
  padding: 4rem 1.5rem 6rem;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

.stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ==========================================
   Features Section
   ========================================== */
.features {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(var(--primary));
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* ==========================================
   Practice Page
   ========================================== */
.practice-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.practice-header {
  margin-bottom: 2rem;
}

.question-counter {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
  display: block;
}

.progress-bar {
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.question-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.question-category {
  display: inline-block;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.question-tip {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}

.recorder-section {
  margin-bottom: 2rem;
}

.recorder-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.recorder-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-icon {
  font-size: 1.5rem;
}

.status-text {
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.timer {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: monospace;
  color: hsl(var(--primary));
  margin-bottom: 1.5rem;
}

.recorder-controls {
  margin-bottom: 1rem;
}

.recorder-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.transcript-section {
  margin-bottom: 2rem;
}

.transcript-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.transcript-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.transcript-text {
  color: hsl(var(--muted-foreground));
  line-height: 1.8;
}

.practice-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================
   Feedback Page
   ========================================== */
.feedback-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.feedback-header {
  text-align: center;
  margin-bottom: 3rem;
}

.feedback-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feedback-header p {
  color: hsl(var(--muted-foreground));
}

.confidence-section {
  margin-bottom: 3rem;
}

.confidence-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
}

.confidence-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
}

.confidence-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.confidence-bg {
  fill: none;
  stroke: hsl(var(--muted));
  stroke-width: 8;
}

.confidence-fill {
  fill: none;
  stroke: hsl(var(--primary));
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.confidence-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.confidence-value .score {
  font-size: 3rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

.confidence-value .label {
  font-size: 1.5rem;
  color: hsl(var(--muted-foreground));
}

.confidence-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.confidence-message {
  color: hsl(var(--muted-foreground));
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feedback-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.feedback-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.feedback-icon.clarity { background: hsl(173 60% 90%); }
.feedback-icon.relevance { background: hsl(38 92% 90%); }
.feedback-icon.structure { background: hsl(262 83% 90%); }
.feedback-icon.confidence { background: hsl(142 76% 90%); }

.feedback-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.score-bar {
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.score-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.5s ease;
}

.score-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--primary));
  display: block;
  margin-bottom: 0.75rem;
}

.feedback-card p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.improvement-tips {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.improvement-tips h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.tips-list {
  list-style: none;
}

.tips-list li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
}

.tips-list li:last-child {
  border-bottom: none;
}

.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: hsl(var(--success));
  font-weight: bold;
}

.feedback-actions {
  text-align: center;
}

/* ==========================================
   Contribute Page
   ========================================== */
.contribute-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.contribute-header {
  text-align: center;
  margin-bottom: 3rem;
}

.contribute-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contribute-header p {
  color: hsl(var(--muted-foreground));
}

.contribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.contribute-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.contribute-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.contribute-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contribute-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.contribute-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.getting-started {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.getting-started h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.tech-stack {
  text-align: center;
  margin-bottom: 2rem;
}

.tech-stack h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.tech-badge {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid hsl(var(--success));
}

.toast.error {
  border-left: 4px solid hsl(var(--error));
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 640px) {
  .hero {
    padding: 2rem 1rem 4rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .question-text {
    font-size: 1.25rem;
  }

  .confidence-ring {
    width: 140px;
    height: 140px;
  }

  .confidence-value .score {
    font-size: 2.25rem;
  }
}
