/* Testphasen-Portal — App-specific styles */

/* ─── Toggle Switch ─── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-secondary);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-primary);
  border-radius: 26px;
  transition: var(--transition-base);
}

.toggle .slider:before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .slider {
  background: var(--success);
}

.toggle input:checked + .slider:before {
  transform: translateX(22px);
}


/* ─── Config Section ─── */
.config-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.config-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--almas-red);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.config-icon {
  font-size: 16px;
}


/* ─── Range Slider ─── */
.config-range {
  width: 100%;
  accent-color: var(--almas-red);
  margin-top: var(--space-sm);
  height: 6px;
  cursor: pointer;
}


/* ─── Contact Card ─── */
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.contact-card .contact-info {
  flex: 1;
  display: flex;
  gap: var(--space-sm);
}

.contact-card .contact-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.contact-card .contact-input:focus {
  border-color: var(--border-focus);
}


/* ─── Badge variants (Testphasen-specific) ─── */
.badge-admin {
  background: var(--warning-bg);
  color: var(--warning);
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-vertriebler {
  background: var(--info-bg);
  color: var(--info);
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}


/* ─── Reset Config Warning Box ─── */
.reset-config-warning {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
}

.reset-config-warning label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.reset-config-warning p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-left: 28px;
}


/* ─── Chat Widget ─── */
.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--almas-red);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.chat-bubble:hover {
  transform: scale(1.1);
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 500px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 400;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-secondary);
}

.chat-window.open {
  display: flex;
}

.chat-header {
  background: var(--bg-sidebar);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header .title {
  font-weight: 600;
  font-size: 15px;
}

.chat-header .close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.chat-header .close-btn:hover {
  color: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--info);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg.bot .typing {
  display: inline-block;
}

.chat-msg.bot .typing span {
  animation: blink 1.4s infinite;
  display: inline-block;
}

.chat-msg.bot .typing span:nth-child(2) { animation-delay: .2s; }
.chat-msg.bot .typing span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: .3; }
  30% { opacity: 1; }
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  gap: var(--space-sm);
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: border-color var(--transition-fast);
}

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

.chat-input-area button {
  background: var(--almas-red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.chat-input-area button:hover {
  background: var(--almas-red-hover);
}


/* ─── Mobile Adjustments ─── */
@media (max-width: 768px) {
  .contact-card .contact-info {
    flex-direction: column;
  }

  .chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    height: 60vh;
  }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    height: 60vh;
  }
}
