/* Utility Classes and Special Components */

/* Status Indicators */
.upload-status {
  margin-top: 10px;
  padding: 8px;
  border-radius: 4px;
}

.success {
  background-color: #d4edda;
  color: #155724;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
}

.pending {
  background-color: #fff3cd;
  color: #856404;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 20px;
  background-color: #f3f3f3;
  border-radius: 4px;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid var(--bs-gray);
  border-top: 4px solid var(--bs-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
#toast {
  position: fixed;
  top: 24px;
  right: 24px;
  min-width: 220px;
  background: var(--bs-primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(30,60,90,0.13);
  font-size: 1.1rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* Transcript Chat Bubbles */
.transcript-bubbles-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.transcript-bubble {
  max-width: 70%;
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 1.05em;
  box-shadow: 0 1px 4px rgba(30,60,90,0.06);
  position: relative;
  word-break: break-word;
  display: flex;
  flex-direction: column;
}

.transcript-agent {
  background: #e6f3ff;
  color: #1a365d;
  align-self: flex-start;
  border-top-left-radius: 4px;
  border-top-right-radius: 16px;
  margin-right: auto;
}

.transcript-customer {
  background: #f7fafc;
  color: #333;
  align-self: flex-end;
  border-top-right-radius: 4px;
  border-top-left-radius: 16px;
  margin-left: auto;
}

.transcript-speaker {
  font-weight: bold;
  margin-right: 8px;
}

.transcript-timestamp {
  font-size: 0.85em;
  color: #888;
  margin-right: 8px;
}

/* Details/Summary */
details > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--bs-primary);
  margin-bottom: 6px;
}

details[open] > summary {
  color: var(--bs-accent);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 40, 60, 0.45);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bs-white);
  border-radius: 10px;
  max-width: 700px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(30, 60, 90, 0.18);
  padding: 32px 24px 24px 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

/* Chat Container Styles */
.chat-container {
  margin-top: 32px;
}

.chat-container h3 {
  margin-bottom: 8px;
  color: var(--bs-heading);
}

.chat-history {
  background: var(--bs-bg);
  border-radius: 8px;
  min-height: 60px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-form input[type="text"] {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #cfd8dc;
  font-size: 1rem;
}

.chat-form button {
  padding: 10px 18px;
  background: var(--bs-primary);
  color: var(--bs-white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.chat-form button:hover {
  background: var(--bs-accent);
}

.chat-form button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.error-message {
  color: var(--bs-error);
  margin-top: 6px;
  font-size: 0.9em;
}
