/* ============================================================
   Konzepthaus — Module-specific Styles
   ============================================================ */

/* ---- Bib: Pflanzenliste ---- */
.plant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plant-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.plant-strip:active { transform: scale(0.985); }
.plant-strip:hover { background: var(--bg-card-hover); }

.plant-strip-info {
  flex: 1;
  min-width: 0;
}

.plant-name-de {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plant-name-latin {
  display: block;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 2px;
}

.plant-strip-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-right: 4px;
}

.plant-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.4;
}

.plant-badge-img {
  background: var(--bg-btn-ghost-h);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 2px 4px;
}

.plant-badge-module {
  background: var(--accent-dim);
  color: var(--accent);
}

.plant-badge-ready {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.plant-badge-growing {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.plant-strip-action {
  flex-shrink: 0;
}

/* ---- Bib: Ansichtsoptionen ---- */
.bib-view-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bib-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.bib-pill:hover { background: var(--bg-btn-ghost); border-color: var(--text-dim); }
.bib-pill.active:hover { background: var(--accent-bright, #00e0b0); }
.bib-pill:active { transform: scale(0.95); }

.bib-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.bib-cat-tag {
  display: inline-block;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--cat-purple-dim, rgba(180, 130, 255, 0.1));
  color: var(--cat-purple);
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- Bib: Pflanzen-Detail ---- */
.detail-section {
  margin-bottom: 16px;
}

.detail-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  gap: 12px;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--cat-purple-dim, rgba(180, 130, 255, 0.1));
  color: var(--cat-purple);
}

.detail-tag.warning {
  background: rgba(255,85,85,0.1);
  color: var(--error);
}

.detail-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 8px 0;
}

/* ---- Bib: Bildergalerie (Detail) ---- */
.plant-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.plant-gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-input);
}

.plant-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.plant-gallery-item:active img {
  transform: scale(1.05);
}

.plant-gallery-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  text-align: center;
}

/* Fullscreen Lightbox */
.plant-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease;
}

.plant-lightbox img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.plant-lightbox-caption {
  color: #fff;
  font-size: 0.88rem;
  text-align: center;
}

.plant-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

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

/* ---- Bib: KI-Chat ---- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px - 40px);
  max-height: calc(100dvh - 56px - 40px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeIn 0.2s ease;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-actions {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.chat-tts-btn {
  background: var(--bg-btn-ghost);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 5px 12px;
  transition: all 0.2s;
}

.chat-tts-btn:hover,
.chat-tts-btn:active {
  background: var(--accent-dim);
  border-color: rgba(0,200,160,0.3);
  color: var(--accent);
}

.chat-bubble-system {
  align-self: center;
  background: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-style: italic;
  text-align: center;
  padding: 4px 8px;
}

.chat-typing {
  align-self: flex-start;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 8px 14px;
}

.chat-typing-dots {
  display: inline-flex;
  gap: 4px;
}

.chat-typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 0 6px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}

.chat-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font);
  resize: none;
  max-height: 100px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-field:focus {
  border-color: var(--accent);
}

.chat-input-field::placeholder {
  color: var(--text-dim);
}

.chat-btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.chat-btn-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.chat-btn-mic {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.chat-btn-mic.recording {
  background: rgba(255, 60, 60, 0.15);
  border-color: var(--error);
  color: var(--error);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Chat Context Card */
.chat-context-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-context-card .plant-emoji {
  font-size: 1.4rem;
}

.chat-context-card .plant-info {
  flex: 1;
}

.chat-context-card .plant-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
}

.chat-context-card .plant-info span {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- PL1: Plant Chips (horizontal scroll) ---- */
.plant-scroll-wrap {
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.plant-scroll-wrap::-webkit-scrollbar { display: none; }

.plant-scroll {
  display: flex;
  gap: 8px;
  width: max-content;
}

.plant-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 66px;
  white-space: nowrap;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.plant-chip:active { transform: scale(0.95); }
.plant-chip.active {
  background: var(--accent-dim);
  border-color: rgba(0,200,160,0.4);
  color: var(--accent);
}

.plant-emoji { font-size: 1.5rem; line-height: 1; }

/* ---- PL1: Channel Rows ---- */
.channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.channel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.channel-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.wavelength {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: normal;
}

.channel-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: right;
}

.channel-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---- PL1: Stage Buttons ---- */
.stage-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.stage-btn:active { transform: scale(0.97); }
.stage-btn.active {
  background: var(--accent-dim);
  border-color: rgba(0,200,160,0.4);
  color: var(--accent);
}

/* ---- PL1: Connection Badge ---- */
.connection-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.connection-badge.disconnected {
  background: rgba(100,100,100,0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(100,100,100,0.25);
}

.connection-badge.connected {
  background: rgba(0,200,160,0.12);
  color: var(--accent);
  border: 1px solid rgba(0,200,160,0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.disconnected .status-dot { background: var(--status-off); }
.connected .status-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
