/**
 * Combined Chatbot - Frontend Styles
 * Merges JAMP Chatbot and Hausa TTS Assistant aesthetics
 *
 * @package Combined_Chatbot
 */

/* ==================== Color Palette (JAMP orange theme) ==================== */
:root {
  --ccb-primary: #D15827;
  --ccb-primary-dark: #A84620;
  --ccb-primary-light: #E07947;
  --ccb-primary-pale: #F5D4C7;
  --ccb-primary-ghost: #FDF6F3;
  --ccb-accent: #D97752;
  --ccb-text-dark: #5C2415;
  --ccb-text-medium: #8B4028;
}

/* ==================== Reset ==================== */
#ccb_chatContainer *,
#ccb_floatingButton *,
#ccb_feedback-modal * {
  box-sizing: border-box;
}

/* ==================== Floating Toggle Button ==================== */
.ccb-toggle-btn,
#ccb_floatingButton {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  background-color: var(--ccb-primary);
  color: white;
  padding: 1rem;
  border-radius: 50%;
  box-shadow:
    0 10px 15px -3px rgba(209, 88, 39, 0.3),
    0 4px 6px -2px rgba(209, 88, 39, 0.2);
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccb-toggle-btn:hover,
#ccb_floatingButton:hover {
  background-color: var(--ccb-primary-dark);
  transform: scale(1.1);
}

.ccb-toggle-btn:active,
#ccb_floatingButton:active {
  transform: scale(0.95);
}

.ccb-toggle-btn.hidden,
#ccb_floatingButton.hidden {
  display: none;
}

.ccb-toggle-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* ==================== Widget Container ==================== */
.ccb-widget-container,
#ccb_chatContainer {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: flex-end;
}

.ccb-widget-container.active,
#ccb_chatContainer.active {
  display: flex;
}

/* ==================== Widget Card ==================== */
.ccb-widget-card {
  background: white;
  border-radius: 1.5rem;
  box-shadow:
    0 20px 25px -5px rgba(209, 88, 39, 0.1),
    0 10px 10px -5px rgba(209, 88, 39, 0.04);
  padding: 1.25rem;
  width: 28rem;
  height: 80vh;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--ccb-primary-pale);
  display: flex;
  flex-direction: column;
}

/* ==================== Header Buttons (mute + close) ==================== */
.ccb-header-btns {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  z-index: 10;
}

.ccb-close-btn,
.ccb-mute-btn {
  color: #6b7280;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccb-close-btn:hover,
.ccb-mute-btn:hover {
  color: var(--ccb-primary);
  background-color: var(--ccb-primary-ghost);
}

.ccb-close-btn svg,
.ccb-mute-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ccb-mute-btn.muted {
  color: var(--ccb-primary);
}

/* ==================== Bot Switch Tabs ==================== */
.ccb-bot-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ccb-bot-tab {
  flex: 1;
  padding: 0.625rem;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.5rem;
  outline: none;
  background-color: white;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.ccb-bot-tab:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(209, 88, 39, 0.1);
}

.ccb-bot-tab.active[data-tab="jamp"] {
  background-color: var(--ccb-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(209, 88, 39, 0.3);
}

.ccb-bot-tab.active[data-tab="hausa"] {
  background-color: var(--ccb-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(209, 88, 39, 0.3);
}

.ccb-bot-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==================== Bot Panel Visibility ==================== */
.ccb-bot-panel {
  display: none;
}

.ccb-bot-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ==================== Shared Header Styles ==================== */
.ccb-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0;
}

.ccb-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0.2rem 0 0 0;
  display: block;
}

/* ==================== JAMP Specific Styles ==================== */
.ccb-jamp-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.ccb-jamp-title-text {
  color: var(--ccb-primary);
}

.ccb-status {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 0.15rem;
  display: none;
}

.ccb-status.active {
  display: block;
}

.ccb-status.connecting {
  color: #eab308;
}

.ccb-status.connected {
  color: #22c55e;
}

.ccb-status.error {
  color: #ef4444;
}

/* Language + Voice row */
.ccb-selects-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.ccb-selects-row .ccb-voice-container {
  flex: 1;
  margin-bottom: 0;
}

/* Voice Select */
.ccb-voice-container {
  margin-bottom: 0.625rem;
}

.ccb-voice-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ccb-primary);
  margin-bottom: 0.2rem;
  display: block;
}

.ccb-voice-select {
  padding: 0.45rem 0.625rem;
  width: 100%;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.5rem;
  outline: none;
  background-color: white;
  color: #374151;
  font-size: 14px;
  transition: border-color 0.2s;
}

.ccb-voice-select:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(209, 88, 39, 0.1);
}

/* Chat Container */
.ccb-chat-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  padding: 1rem;
  background-color: var(--ccb-primary-ghost);
  border-radius: 0.75rem;
  border: 1px solid var(--ccb-primary-pale);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ccb-primary-pale) transparent;
}

.ccb-chat-container::-webkit-scrollbar {
  width: 5px;
}

.ccb-chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.ccb-chat-container::-webkit-scrollbar-thumb {
  background: var(--ccb-primary-pale);
  border-radius: 3px;
}

.ccb-messages {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==================== Messages (shared) ==================== */
.ccb-message {
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  max-width: 80%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
}

.ccb-message.user {
  background-color: var(--ccb-primary-pale);
  color: var(--ccb-text-dark);
  margin-left: auto;
  border: 1px solid var(--ccb-accent);
}

.ccb-message.assistant {
  background-color: white;
  color: var(--ccb-text-dark);
  border: 1px solid var(--ccb-primary-pale);
}

/* Markdown content inside assistant messages */
.ccb-message h1, .ccb-message h2, .ccb-message h3,
.ccb-message h4, .ccb-message h5, .ccb-message h6 {
  font-size: 0.82em;
  font-weight: 700;
  margin: 0.75em 0 0.25em;
  color: var(--ccb-primary);
  line-height: 1.3;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--ccb-primary-pale);
}

.ccb-message p { margin: 0.4em 0; }
.ccb-message ul, .ccb-message ol { margin: 0.4em 0; padding-left: 1.25em; }
.ccb-message li { margin: 0.2em 0; }
.ccb-message strong { color: var(--ccb-text-dark); }
.ccb-message code {
  background: var(--ccb-primary-pale);
  border-radius: 3px;
  padding: 0.1em 0.3em;
  font-size: 0.85em;
}

/* Inline audio-loading indicator inside Hausa message bubble */
.ccb-audio-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ccb-primary-pale);
}

.ccb-audio-loading .ccb-loading-dots {
  display: flex;
  gap: 4px;
}

.ccb-audio-loading .ccb-dot {
  width: 6px;
  height: 6px;
}

.ccb-audio-loading-label {
  font-size: 11px;
  color: var(--ccb-primary);
  opacity: 0.75;
}

/* ==================== Loading Indicator ==================== */
.ccb-loading,
.ccb-loading-overlay {
  display: none;
  justify-content: flex-start;
  padding: 1.5rem;
}

.ccb-loading.active,
.ccb-loading-overlay.active {
  display: flex;
}

.ccb-loading-dots {
  display: flex;
  gap: 0.5rem;
}

.ccb-dot {
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--ccb-primary-light);
  border-radius: 50%;
  animation: ccbWave 0.8s infinite;
}

.ccb-dot-delay-1 {
  animation-delay: 0.2s;
}

.ccb-dot-delay-2 {
  animation-delay: 0.4s;
}

.ccb-dot-delay-3 {
  animation-delay: 0.6s;
}

@keyframes ccbWave {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* ==================== JAMP Input Container ==================== */
.ccb-input-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ccb-input {
  flex: 1;
  padding: 0.875rem;
  font-size: 14px;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.75rem;
  outline: none;
  background-color: white;
  color: #374151;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ccb-input::placeholder {
  color: #9ca3af;
}

.ccb-input:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(209, 88, 39, 0.1);
}

.ccb-send-btn {
  background-color: var(--ccb-primary);
  color: white;
  padding: 0.6rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ccb-send-btn:hover {
  background-color: var(--ccb-primary-dark);
}

.ccb-send-btn:active {
  opacity: 0.85;
}

.ccb-send-icon {
  width: 1rem;
  height: 1rem;
  transform: rotate(90deg);
}


/* Mic button (voice input) */
.ccb-mic-btn {
  background-color: var(--ccb-primary);
  color: white;
  padding: 0.6rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ccb-mic-btn:hover {
  background-color: var(--ccb-primary-dark);
}

.ccb-mic-btn:active {
  opacity: 0.85;
}

.ccb-mic-btn.recording {
  background-color: #ef4444;
  animation: ccbRecordPulse 1.5s ease-in-out infinite;
}

.ccb-mic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==================== Hausa TTS Specific Styles ==================== */
.ccb-hausa-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ccb-hausa-title-text {
  color: var(--ccb-primary);
}

/* Hausa Tabs */
.ccb-hausa-tabs {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.ccb-hausa-tab {
  flex: 1;
  padding: 0.625rem;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.5rem;
  outline: none;
  background-color: white;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.ccb-hausa-tab:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ccb-hausa-tab.active {
  background-color: var(--ccb-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ccb-hausa-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Hausa Chat Body */
.ccb-hausa-chat-body {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background-color: var(--ccb-primary-ghost);
  border-radius: 0.75rem;
  border: 1px solid var(--ccb-primary-pale);
  max-height: calc(80vh - 320px);
  min-height: 220px;
}

.ccb-hausa-chat-body::-webkit-scrollbar {
  width: 5px;
}

.ccb-hausa-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.ccb-hausa-chat-body::-webkit-scrollbar-thumb {
  background: var(--ccb-primary-pale);
  border-radius: 3px;
}

.ccb-conversation {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hausa Messages */
.ccb-hausa-message {
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  max-width: 80%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  animation: ccbSlideIn 0.2s ease-out;
}

@keyframes ccbSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ccb-hausa-user-message {
  background-color: var(--ccb-primary-pale);
  color: var(--ccb-text-dark);
  margin-left: auto;
  border: 1px solid var(--ccb-accent);
}

.ccb-hausa-assistant-message {
  background-color: white;
  color: var(--ccb-text-dark);
  border: 1px solid var(--ccb-primary-pale);
  align-self: flex-start;
}

/* ==================== Tab content visibility ==================== */
.ccb-hausa-tab-content {
  display: none;
}

.ccb-hausa-tab-content.active {
  display: block;
}

/* Hausa Text Input */
.ccb-hausa-input-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ccb-hausa-text-input {
  flex: 1;
  padding: 0.875rem;
  font-size: 14px;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.75rem;
  outline: none;
  background-color: white;
  color: #374151;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  height: auto;
}

.ccb-hausa-text-input::placeholder {
  color: #9ca3af;
}

.ccb-hausa-text-input:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ccb-hausa-submit-button {
  background-color: var(--ccb-primary);
  color: white;
  padding: 0.875rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ccb-hausa-submit-button:hover {
  background-color: var(--ccb-primary-dark);
  transform: scale(1.05);
}

.ccb-hausa-submit-button:active {
  transform: scale(0.95);
}

.ccb-hausa-submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ccb-hausa-submit-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
  transform: rotate(90deg);
}

/* Voice Input Section */
.ccb-hausa-voice-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 0 0.5rem;
}

.ccb-hausa-record-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--ccb-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    transform 0.1s;
  box-shadow:
    0 10px 15px -3px rgba(99, 102, 241, 0.3),
    0 4px 6px -2px rgba(99, 102, 241, 0.2);
}

.ccb-hausa-record-button:hover {
  background-color: var(--ccb-primary-dark);
  transform: scale(1.05);
}

.ccb-hausa-record-button:active {
  transform: scale(0.95);
}

.ccb-hausa-record-button.recording {
  background-color: #ef4444;
  animation: ccbRecordPulse 1.5s ease-in-out infinite;
}

@keyframes ccbRecordPulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.65);
  }
}

.ccb-hausa-mic-icon {
  width: 18px;
  height: 18px;
  color: white;
}

.ccb-hausa-timer {
  font-size: 22px;
  font-weight: 700;
  color: var(--ccb-text-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.ccb-hausa-recording-status {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  font-weight: 500;
  padding: 5px 12px;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid var(--ccb-primary-pale);
  transition: color 0.2s;
}

/* Waveform visualizer */
.ccb-hausa-visualizer {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 44px;
  border-radius: 0.5rem;
  background: var(--ccb-primary-ghost);
  border: 1px solid var(--ccb-primary-pale);
}

.ccb-hausa-timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Audio Player */
.ccb-hausa-audio-player-container {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.ccb-hausa-audio-player-container.ccb-hidden {
  display: none !important;
}

.ccb-hausa-audio-player {
  width: 100%;
  accent-color: var(--ccb-primary);
}

/* Inline Audio Player (per-message) */
.ccb-hausa-inline-audio-wrapper {
  margin-top: 0.75rem;
  width: 100%;
}

.ccb-hausa-inline-audio {
  width: 100%;
  height: 32px;
  border-radius: 0.5rem;
  outline: none;
  accent-color: var(--ccb-primary);
}

.ccb-hausa-inline-audio::-webkit-media-controls-panel {
  background-color: var(--ccb-primary-ghost);
}

/* ==================== Feedback Buttons (JAMP) ==================== */
.feedback-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
}

.feedback-buttons button {
  border: 1px solid #d1d5db;
  padding: 0.625rem;
  border-radius: 50%;
  background-color: white;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.feedback-buttons button:hover {
  background-color: var(--ccb-primary-ghost);
  border-color: var(--ccb-primary-pale);
}

.feedback-buttons button svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #9ca3af;
}

.feedback-buttons button.bg-green-100 {
  background-color: #dcfce7;
  border-color: #86efac;
}

.feedback-buttons button.bg-red-100 {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

/* ==================== Audio Player (JAMP) ==================== */
.audio-player {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.audio-player .play-pause {
  background-color: var(--ccb-primary);
  color: white;
  padding: 0.625rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.audio-player .play-pause:hover {
  background-color: var(--ccb-primary-dark);
}

.audio-player .play-pause svg {
  width: 1.25rem;
  height: 1.25rem;
}

.audio-player .hidden {
  display: none;
}

.audio-player .progress {
  flex: 1;
  min-width: 120px;
  accent-color: var(--ccb-primary);
}

.audio-player .time {
  font-size: 19px;
  color: var(--ccb-text-medium);
  flex-shrink: 0;
}

.audio-player .download {
  background-color: var(--ccb-primary-pale);
  color: var(--ccb-primary-dark);
  padding: 0.625rem;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-player .download:hover {
  background-color: var(--ccb-accent);
}

.audio-player .download svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ==================== Modal ==================== */
.ccb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(92, 36, 21, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.ccb-modal.active {
  display: flex;
}

.ccb-modal-content {
  background-color: white;
  border-radius: 0.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 28rem;
  border: 2px solid var(--ccb-primary-pale);
}

.ccb-modal-title {
  font-size: 23px;
  font-weight: bold;
  color: var(--ccb-primary);
  margin: 0 0 1.5rem 0;
}

.ccb-modal-textarea {
  width: 100%;
  padding: 0.875rem;
  font-size: 19px;
  border: 1px solid var(--ccb-primary-pale);
  border-radius: 0.75rem;
  outline: none;
  margin-bottom: 1.5rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ccb-modal-textarea:focus {
  border-color: var(--ccb-primary-light);
  box-shadow: 0 0 0 3px rgba(209, 88, 39, 0.1);
}

.ccb-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ccb-modal-cancel,
.ccb-modal-submit {
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-size: 19px;
  transition: background-color 0.2s, transform 0.1s;
}

.ccb-modal-cancel {
  background-color: #d1d5db;
  color: #374151;
}

.ccb-modal-cancel:hover {
  background-color: #9ca3af;
}

.ccb-modal-submit {
  background-color: var(--ccb-primary);
  color: white;
}

.ccb-modal-submit:hover {
  background-color: var(--ccb-primary-dark);
}

.ccb-modal-cancel:active,
.ccb-modal-submit:active {
  transform: scale(0.95);
}

/* ==================== Utility ==================== */
.ccb-hidden,
.hidden {
  display: none !important;
}

/* ==================== Mobile Responsive ==================== */

/* Narrow screens: shift inward so widget isn't flush against right edge */
@media (max-width: 520px) {
  .ccb-widget-container,
  #ccb_chatContainer {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    align-items: stretch;
  }

  .ccb-widget-card {
    width: 100%;
    height: 80vh;
    max-height: 80vh;
  }
}

/* Very small screens: full-height sheet from bottom */
@media (max-width: 400px) {
  .ccb-widget-container,
  #ccb_chatContainer {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .ccb-widget-card {
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 95vh;
    width: 100vw;
    margin: 0;
  }
}

/* Touch devices: disable hover scale effects */
@media (hover: none) and (pointer: coarse) {
  .audio-player .progress {
    min-width: 80px;
  }

  .audio-player .time {
    font-size: 13px;
  }
}


/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
