/* -------------------------
   Root & Reset
-------------------------- */
:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary: #20c997;
  --danger: #dc3545;
  --success: #28a745;
  --bg: #f4f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(135deg, #eaf3f7, #fdfefe);
  color: var(--text);
}

/* -------------------------
   Layout
-------------------------- */
.container {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  padding: 28px;
  animation: fadeInUp 0.8s ease;
}

/* -------------------------
   Header
-------------------------- */
header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 110px;
  margin-bottom: 10px;
  animation: float 4s ease-in-out infinite;
}

h1 {
  margin: 0;
  font-size: 26px;
  color: var(--primary-dark);
}

.subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* -------------------------
   Controls
-------------------------- */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

button {
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#startBtn {
  background: linear-gradient(135deg, var(--success), #4ade80);
  color: white;
}

#stopBtn {
  background: linear-gradient(135deg, var(--danger), #f87171);
  color: white;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* -------------------------
   Textarea
-------------------------- */
textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

/* -------------------------
   Analyze Button
-------------------------- */
.analyze {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 17px;
}

/* -------------------------
   Result Section
-------------------------- */
.result {
  margin-top: 24px;
  display: none;
  animation: fadeIn 0.6s ease;
}

.patient-section {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border-radius: var(--radius-md);
  padding: 18px;
  line-height: 1.7;
}

.patient-section h3 {
  margin-top: 0;
  color: var(--primary-dark);
}

.summary-section {
  margin-top: 16px;
  padding: 14px;
  background: #fafafa;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

details.technical-section {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #f3f4f6;
}

details summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--primary-dark);
}

/* -------------------------
   Animations
-------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* -------------------------
   Responsive
-------------------------- */
@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .card { padding: 20px; }
}
