/* ==========================================================================
   TalkEase Design System & Modern UI/UX Architecture
   Palette: Emotional Wellness Slate, Deep Indigo, Vibrant Teal, Warm Coral
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Color Palette */
  --te-primary: #4361ee;
  --te-primary-hover: #3a56d4;
  --te-primary-light: #eef2ff;
  --te-secondary: #06d6a0;
  --te-secondary-dark: #05b386;
  --te-accent: #7209b7;
  --te-dark: #0f172a;
  --te-dark-surface: #1e293b;
  --te-gray-100: #f8fafc;
  --te-gray-200: #f1f5f9;
  --te-gray-300: #e2e8f0;
  --te-gray-400: #94a3b8;
  --te-gray-600: #475569;
  --te-gray-800: #1e293b;
  --te-danger: #ef4444;
  --te-warning: #f59e0b;
  --te-success: #10b981;
  
  /* Gradients */
  --te-gradient-primary: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  --te-gradient-calm: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
  --te-gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --te-gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
  --te-gradient-wellness: linear-gradient(135deg, #06d6a0 0%, #118ab2 100%);

  /* Shadows & Glassmorphism */
  --te-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --te-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --te-shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --te-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --te-glass-bg: rgba(255, 255, 255, 0.82);
  --te-glass-border: rgba(226, 232, 240, 0.8);
  --te-glass-blur: blur(12px);

  /* Typography */
  --te-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --te-radius-sm: 8px;
  --te-radius-md: 12px;
  --te-radius-lg: 18px;
  --te-radius-xl: 24px;
}

body {
  font-family: var(--te-font-sans);
  color: var(--te-dark);
  background-color: var(--te-gray-100);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Crisis Helpline Emergency Ribbon */
.emergency-banner {
  background: linear-gradient(90deg, #991b1b 0%, #b91c1c 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 0;
  text-align: center;
  position: relative;
  z-index: 1040;
}
.emergency-banner a {
  color: #fef08a;
  text-decoration: underline;
  font-weight: 700;
}

/* Navigation */
.navbar-te {
  background: var(--te-glass-bg);
  backdrop-filter: var(--te-glass-blur);
  -webkit-backdrop-filter: var(--te-glass-blur);
  border-bottom: 1px solid var(--te-glass-border);
  transition: all 0.3s ease;
  padding: 0.8rem 0;
}
.navbar-brand-logo {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--te-primary) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.navbar-brand-logo span {
  color: var(--te-secondary-dark);
}
.nav-link-custom {
  font-weight: 600;
  color: var(--te-gray-600) !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: var(--te-radius-sm);
  transition: all 0.2s ease;
}
.nav-link-custom:hover {
  color: var(--te-primary) !important;
  background: var(--te-primary-light);
}

/* Hero Section */
.hero-wrapper {
  background: var(--te-gradient-hero);
  color: #fff;
  padding: 5rem 0 6rem 0;
  position: relative;
  overflow: hidden;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5f3fc;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 1.5rem;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 600px;
  margin-bottom: 2.2rem;
  font-weight: 400;
}

/* Dual Pathways (Emotional Support vs Social Companionship) */
.pathway-card {
  border-radius: var(--te-radius-lg);
  padding: 2.2rem;
  height: 100%;
  border: 1px solid var(--te-gray-300);
  background: #fff;
  box-shadow: var(--te-shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.pathway-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--te-shadow-xl);
  border-color: var(--te-primary);
}
.pathway-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}
.pathway-support::before {
  background: var(--te-gradient-primary);
}
.pathway-companion::before {
  background: var(--te-gradient-wellness);
}
.pathway-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--te-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.4rem;
}
.icon-support {
  background: var(--te-primary-light);
  color: var(--te-primary);
}
.icon-companion {
  background: #ecfdf5;
  color: var(--te-secondary-dark);
}

/* Premium Buttons */
.btn-te-primary {
  background: var(--te-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--te-radius-md);
  padding: 0.68rem 1.4rem;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(67, 97, 238, 0.35);
  transition: all 0.2s ease;
}
.btn-te-primary:hover {
  background: var(--te-primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(67, 97, 238, 0.45);
}
.btn-te-secondary {
  background: #fff;
  color: var(--te-dark);
  font-weight: 600;
  border-radius: var(--te-radius-md);
  padding: 0.68rem 1.4rem;
  border: 1px solid var(--te-gray-300);
  box-shadow: var(--te-shadow-sm);
  transition: all 0.2s ease;
}
.btn-te-secondary:hover {
  background: var(--te-gray-200);
  color: var(--te-dark);
}
.btn-te-teal {
  background: var(--te-secondary);
  color: #064e3b;
  font-weight: 700;
  border-radius: var(--te-radius-md);
  padding: 0.68rem 1.4rem;
  border: none;
  transition: all 0.2s ease;
}
.btn-te-teal:hover {
  background: var(--te-secondary-dark);
  color: #fff;
}

/* Companion Directory Cards */
.companion-card {
  background: #fff;
  border-radius: var(--te-radius-lg);
  border: 1px solid var(--te-gray-300);
  box-shadow: var(--te-shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.companion-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--te-shadow-lg);
  border-color: #cbd5e1;
}
.companion-header {
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.companion-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--te-primary-light);
  background: var(--te-gray-200);
  flex-shrink: 0;
}
.companion-badge-verified {
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.companion-rating {
  font-weight: 700;
  font-size: 0.9rem;
  color: #d97706;
  display: flex;
  align-items: center;
  gap: 4px;
}
.companion-body {
  padding: 0 1.5rem 1.5rem 1.5rem;
  flex-grow: 1;
}
.companion-bio {
  color: var(--te-gray-600);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}
.service-pill {
  background: var(--te-gray-200);
  color: var(--te-gray-800);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--te-radius-sm);
  display: inline-block;
  margin-right: 5px;
  margin-bottom: 5px;
}
.companion-footer {
  padding: 1rem 1.5rem;
  background: var(--te-gray-100);
  border-top: 1px solid var(--te-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rate-highlight {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--te-dark);
}
.rate-unit {
  font-size: 0.8rem;
  color: var(--te-gray-600);
  font-weight: 500;
}

/* Interactive Stress Assessment Flow */
.assessment-container {
  max-width: 780px;
  margin: 3rem auto;
  background: #fff;
  border-radius: var(--te-radius-xl);
  padding: 2.5rem;
  border: 1px solid var(--te-gray-300);
  box-shadow: var(--te-shadow-xl);
}
.assessment-progress-bar {
  height: 8px;
  border-radius: 9999px;
  background: var(--te-gray-200);
  overflow: hidden;
  margin-bottom: 2rem;
}
.assessment-progress-fill {
  height: 100%;
  background: var(--te-gradient-calm);
  transition: width 0.3s ease;
}
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  margin-bottom: 0.8rem;
  border: 1.5px solid var(--te-gray-300);
  border-radius: var(--te-radius-md);
  background: #fff;
  font-weight: 600;
  color: var(--te-gray-800);
  transition: all 0.2s ease;
  cursor: pointer;
}
.option-btn:hover {
  border-color: var(--te-primary);
  background: var(--te-primary-light);
  color: var(--te-primary);
  transform: translateX(4px);
}
.option-btn.selected {
  border-color: var(--te-primary);
  background: var(--te-primary-light);
  color: var(--te-primary);
  font-weight: 700;
}

/* WebRTC Call Room Interface */
.call-room-wrapper {
  max-width: 850px;
  margin: 2rem auto;
  background: var(--te-dark);
  border-radius: var(--te-radius-xl);
  padding: 3rem 2rem;
  color: #fff;
  text-align: center;
  box-shadow: var(--te-shadow-xl);
  position: relative;
}
.call-avatar-pulse {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  border: 4px solid #38bdf8;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: pulse-ring 2s infinite cubic-bezier(0.66, 0, 0, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  font-size: 3rem;
  color: #38bdf8;
}
@keyframes pulse-ring {
  to {
    box-shadow: 0 0 0 25px rgba(56, 189, 248, 0);
  }
}
.call-timer {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  font-family: monospace;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}
.call-status-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 2rem;
}
.call-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
.btn-call-control {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-mute {
  background: #334155;
  color: #fff;
}
.btn-mute:hover {
  background: #475569;
}
.btn-end-call {
  background: var(--te-danger);
  color: #fff;
  width: 68px;
  height: 68px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.btn-end-call:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* Footer */
.footer-te {
  background: #0f172a;
  color: #94a3b8;
  padding: 4rem 0 2rem 0;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}
.footer-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}
.footer-link {
  color: #94a3b8;
  text-decoration: none;
  display: block;
  margin-bottom: 0.6rem;
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: #fff;
}
.non-clinical-disclaimer {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--te-radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin-top: 2rem;
}