/* ============================================
   DR. FREUDENSTEIN'S THEME
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Comic+Neue:ital,wght@0,400;0,700;1,400&family=Special+Elite&display=swap');

:root {
  --bg-dark: #0d0d1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #16213e;
  --accent-yellow: #ffe66d;
  --accent-red: #ff6b6b;
  --accent-teal: #4ecdc4;
  --accent-purple: #a29bfe;
  --accent-orange: #ff9f43;
  --text-primary: #f0f0f0;
  --text-secondary: #aaaacc;
  --border-color: #333355;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(162, 155, 254, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 107, 107, 0.08) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: 'Comic Neue', cursive;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ============================================
   HEADER
   ============================================ */

header {
  text-align: center;
  padding: 40px 20px 30px;
  position: relative;
}

.title-badge {
  display: inline-block;
  background: var(--accent-red);
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 15px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

header h1 {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 3px;
  line-height: 1.1;
  text-shadow: 3px 3px 0px var(--accent-red), 6px 6px 0px rgba(255, 107, 107, 0.3);
  color: var(--accent-yellow);
}

.highlight {
  color: var(--accent-teal);
  display: block;
}

.subtitle {
  font-family: 'Special Elite', serif;
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 1rem;
  font-style: italic;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  margin-top: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DOCTOR SECTION
   ============================================ */

.doctor-section {
  position: sticky;
  top: 20px;
}

.doctor-container {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.3s ease;
}

.doctor-container:hover {
  transform: translateY(-4px);
}

.doctor-svg-wrapper {
  position: relative;
  display: inline-block;
}

#doctor-svg {
  width: 200px;
  height: 300px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: filter 0.3s ease;
}

/* Floating animations for SVG elements */
.float-text {
  animation: floatUp 3s ease-in-out infinite;
}

.float-text2 {
  animation: floatUp 3.5s ease-in-out infinite 0.5s;
}

.float-text3 {
  animation: floatSide 4s ease-in-out infinite;
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatSide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* Thinking bubble */
.thinking-bubble {
  position: absolute;
  top: -10px;
  right: -80px;
  background: white;
  color: #333;
  border-radius: 15px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  max-width: 160px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  line-height: 1.4;
  z-index: 10;
  animation: bubbleFloat 3s ease-in-out infinite;
}

.thinking-bubble::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  border: 8px solid transparent;
  border-top-color: white;
  border-bottom: 0;
}

.thinking-bubble::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 10px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  opacity: 0.7;
}

#thinking-text {
  transition: opacity 0.3s ease;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

.doctor-name-plate {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.doctor-name-plate strong {
  display: block;
  font-family: 'Special Elite', serif;
  font-size: 0.85rem;
  color: var(--accent-yellow);
  margin-bottom: 4px;
}

.doctor-name-plate small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* ============================================
   INPUT SECTION
   ============================================ */

.input-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.form-card h2 {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: var(--accent-yellow);
  margin-bottom: 8px;
}

.form-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.form-subtitle em {
  color: var(--accent-teal);
}

/* Problem Tags */
.problem-tags {
  margin-bottom: 20px;
}

.problem-tags p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: 'Comic Neue', cursive;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag-btn:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(162, 155, 254, 0.3);
}

.tag-btn-clicked {
  transform: scale(0.9) !important;
}

/* Input group */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#problem-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Comic Neue', cursive;
  font-size: 1rem;
  padding: 14px 16px;
  resize: vertical;
  transition: all 0.3s ease;
  min-height: 100px;
}

#problem-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
  background: rgba(78, 205, 196, 0.04);
}

#problem-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
}

/* Diagnose Button */
.diagnose-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-red), #c0392b);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
  position: relative;
  overflow: hidden;
}

.diagnose-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);