/* Base styles for EarChecker site */
:root {
  --primary: #1C7ED6;
  --accent: #2FBF71;
  --dark: #0F172A;
  --medium: #334155;
  --light: #F8FAFC;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Lato', sans-serif;
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--light);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 999;
}

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

nav .nav-links a {
  margin-left: 1rem;
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
}
nav .nav-links a:hover {
  color: var(--primary);
}

/* Hero section */
/* Hero layout */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  gap: 2rem;
}
.hero-content {
  flex: 1 1 300px;
  text-align: left;
}
.hero-illustration {
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-illustration img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.hero h1 {
  font-size: 2.4rem;
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
}
.hero .buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.button-primary {
  background-color: var(--accent);
  color: white;
}
.button-primary:hover {
  background-color: #28a860;
}
.button-secondary {
  background-color: transparent;
  color: white;
  border: 1px solid white;
}
.button-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Features section */
.section {
  padding: 3rem 2rem;
}
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.feature-card {
  flex: 1 1 250px;
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.feature-card p {
  margin: 0;
  color: var(--medium);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--medium);
}

/* Test page */
.test-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.test-wrapper h2 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.8rem;
}
.test-wrapper .freq-display {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}
.test-wrapper .level-display {
  margin-bottom: 1rem;
  color: var(--medium);
  font-size: 0.9rem;
}
.test-wrapper .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* Calibration and screening styles */
.calibration-step, .screening-step {
  margin-top: 1.5rem;
}
.calibration-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.calibration-controls input[type="range"] {
  width: 200px;
}
.calibration-controls span {
  min-width: 50px;
  display: inline-block;
}
.calibration-step button.button-accent {
  background-color: var(--accent);
  color: white;
}
.calibration-step button.button-accent:hover {
  background-color: #28a860;
}
.test-wrapper .controls button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  color: white;
}
.test-wrapper .controls .play-btn {
  background-color: var(--primary);
}
.test-wrapper .controls .heard-btn {
  background-color: var(--accent);
}
.test-wrapper .controls .louder-btn {
  background-color: var(--primary);
}
.test-wrapper .controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.test-wrapper .next-frequency {
  text-align: center;
}

/* Assistant widget */
.assistant-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  cursor: pointer;
  z-index: 9999;
}
.assistant-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  display: none;
  flex-direction: column;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9998;
}
.assistant-window.open {
  display: flex;
}
.assistant-window header {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-weight: 600;
}
.chat-messages {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}
.chat-input {
  display: flex;
  border-top: 1px solid #e5e7eb;
}
.chat-input input {
  flex: 1;
  padding: 0.5rem;
  border: none;
  outline: none;
  font-size: 1rem;
}
.chat-input button {
  border: none;
  background-color: var(--primary);
  color: white;
  padding: 0 1rem;
  cursor: pointer;
  font-size: 1rem;
}
.chat-message {
  margin-bottom: 0.5rem;
  display: flex;
}
.chat-message.user {
  justify-content: flex-end;
}
.chat-message.bot {
  justify-content: flex-start;
}
.chat-message span {
  padding: 0.5rem 0.75rem;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
  font-size: 0.9rem;
}
.chat-message.user span {
  background-color: var(--primary);
  color: white;
  border-bottom-right-radius: 0;
}
.chat-message.bot span {
  background-color: #e5e7eb;
  color: var(--dark);
  border-bottom-left-radius: 0;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
  .test-wrapper {
    padding: 1.5rem;
    margin: 1rem;
  }
  .assistant-window {
    width: 90%;
    right: 5%;
  }
}