/* Connector panel styles - extracted to prevent @keyframes/@media corruption in HTML */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f1f5f9;
}

.ccp-panel {
  position: fixed;
  inset: 1px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ccp-header {
  flex-shrink: 0;
  background: #0f766e;
  color: #fff;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-sizing: border-box;
}

.ccp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.ccp-header-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ccp-header-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ccp-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccp-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.35);
}

.ccp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ccp-btn[data-tooltip] {
  position: relative;
}

.ccp-btn[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  pointer-events: none;
  z-index: 10001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-tooltip] {
  position: relative;
}

.ccp-recording-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.recording-idle {
  background: rgba(255, 255, 255, 0.5);
}

.recording-active {
  background: #f87171;
  animation: blink 1.2s infinite;
}

.recording-paused {
  background: #fbbf24;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.ccp-header-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ccp-header-controls-group {
  gap: 2px;
}

.ccp-header-controls-group + .ccp-header-controls-group {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 4px;
  margin-left: 2px;
}

.main-container {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  position: relative;
}

.scroll-indicators {
  display: none;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.scroll-indicators.is-visible {
  display: flex;
}

.scroll-indicators.is-faded {
  opacity: 0;
  pointer-events: none;
}

.scroll-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s;
}

.scroll-indicator.is-active {
  background: #fff;
}

@media (max-width: 640px) {
  .main-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: 0;
    -webkit-overflow-scrolling: touch;
  }

  .main-container .ccp-column,
  .main-container .wisdom-column {
    min-width: max(320px, 100%);
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

.ccp-column {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.ccp-column #containerDiv {
  flex: 1;
}

.wisdom-column {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wisdom-column #q-container {
  flex: 1;
}

.main-container #containerDiv {
  width: 100% !important;
  height: 100% !important;
  position: relative;
  /* min-height: 400px; */
}

#q-container {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.ccp-dial-section {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.ccp-dial-section.is-open {
  display: flex;
}

.ccp-dial-form {
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 300px;
}

.ccp-dial-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.ccp-dial-form select,
.ccp-dial-form input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.ccp-dial-form .ccp-btn-dial-submit {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #0f766e;
  color: #fff;
}

.ccp-dial-form .ccp-btn-dial-submit:hover:not(:disabled) {
  background: #0d5c56;
}

.ccp-dial-form .ccp-btn-dial-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ccp-dial-form .validation-message {
  font-size: 12px;
  color: #dc2626;
  margin-top: -6px;
  margin-bottom: 8px;
  min-height: 18px;
}

.ccp-dial-form input.is-invalid {
  border-color: #dc2626;
}

.ccp-disposition-section {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.ccp-disposition-section.is-open {
  display: flex;
}

.ccp-disposition-form {
  position: relative;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ccp-disposition-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.ccp-disposition-form select,
.ccp-disposition-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.ccp-disposition-form textarea {
  min-height: 80px;
  resize: vertical;
}

.ccp-disposition-form .ccp-btn-dial-submit {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #0f766e;
  color: #fff;
}

.ccp-disposition-form .ccp-btn-dial-submit:hover {
  background: #0d5c56;
}

.ccp-disposition-form .ccp-btn-dial-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ccp-disposition-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.ccp-disposition-close-btn:hover {
  color: #334155;
  background: #f1f5f9;
}

.error-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 13px;
  margin: 8px 10px;
}

.error-banner.is-visible {
  display: flex;
}

.loading-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.ccp-btn.is-active {
  background: rgba(255, 255, 255, 0.35);
}

.mode-icon-btn .mode-icon-chevron {
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.mode-icon-btn .mode-icon-line {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.mode-icon-btn.is-extended .mode-icon-chevron {
  opacity: 1;
}

.mode-icon-btn.is-extended .mode-icon-line {
  opacity: 0.4;
}

.dial-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.recording-resumed {
  background: #f87171;
  animation: blink 1.2s infinite;
}

#accordion {
  visibility: hidden;
  width: 100%;
}

#accordion .accordion-close-btn {
  float: right;
  margin: -2px 0 0 8px;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

#accordion .accordion-close-btn:hover {
  color: #fff;
}

#tblContact tbody td:first-child a {
  color: #0f766e;
}
