html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  /* Allow vertical scrolling while preventing horizontal overflow */
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  color: #333;
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Landing page styles */
.hero {
  background: linear-gradient(135deg, #000428, #004e92);
  min-height: 80vh;
  color: #fff;
}

.features {
  background: #0b0f19;
}

.features h3 {
  color: #fff;
}

.features p {
  color: #adb5bd;
}

.cta {
  background: linear-gradient(135deg, #004e92, #000428);
  color: #fff;
}

a {
  color: #6ea8fe;
}

.sidebar {
  min-height: 100vh;
  background-color: #111827;
  width: 240px;
  transition: width 0.3s;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar .navbar-brand {
  font-size: 1.25rem;
}

.sidebar.collapsed .navbar-brand {
  display: none;
}

.sidebar .nav-link {
  color: #cbd5e1;
  white-space: nowrap;
}

.sidebar .nav-link i {
  font-size: 1.2rem;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
}

.sidebar .menu-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar.collapsed .menu-text {
  display: none;
}

.sidebar .user-name {
  white-space: nowrap;
}

.sidebar.collapsed .user-name {
  display: none;
}

.sidebar .nav-link.active {
  background-color: #1e293b;
  color: #fff;
}

.header {
  background-color: #111827;
  color: #e2e2e2;
}

.sidebar-tooltip .tooltip-inner {
  background-color: #1e293b;
  color: #fff;
}

.sidebar-tooltip .tooltip-arrow::before {
  border-right-color: #1e293b;
}

.dashboard-card {
  color: #333;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff, #f9fafb);
}

.dashboard-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 1.5rem;
}

.dashboard-module {
  margin-bottom: 3rem;
}

.dashboard-section-title {
  font-weight: 600;
  border-left: 4px solid #4f46e5;
  padding-left: 0.5rem;
}

.login-background {
  background: url('/images/login-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
}

.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding-top: 10%;
}

/* Conversation panel */
.conversation-list {
  height: calc(100vh - 260px);
  overflow-y: auto;
  position: relative;
}

#btnNewConversations {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
}

.conversation-card {
  border: none;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #ffffff, #f7f7f7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
}
.conversation-card.active {
  border: 2px solid #6d28d9;
}

.conversation-card.unanswered {
  border-left: 24px solid #d97706;
}

.conversation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.conversation-card .last-message {
  text-overflow: ellipsis;
}

.conversation-card .assigned-user {
  position: absolute;
  right: 0.5rem;
  bottom: 0.25rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.conversation-item .conversation-time {
  position: absolute;
  right: 0.5rem;
  bottom: 0.25rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.followup-card.completed {
  opacity: 0.6;
}

.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 10;
}

.fullscreen-loader {
  position: fixed;
  z-index: 1050;
}

#originSelectBtn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem;
    height: calc(10vh - 340px);
    flex-grow: 1;
    overflow-y: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.chat-message {
  margin-bottom: 0.75rem;
  display: flex;
}

.chat-message.sent .bubble {
  margin-left: auto;
  background: linear-gradient(45deg, #4f46e5, #6d28d9);
  color: #fff;
}

.chat-message.received .bubble {
  margin-right: auto;
  background: #f1f5f9;
}

.chat-message .bubble {
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  max-width: 75%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message .bubble img.chat-thumb {
  max-width: 200px;
  cursor: pointer;
}

.tag-badge {
  background: linear-gradient(45deg, #06b6d4, #3b82f6);
}

.topic-badge.ai {
  background: #e5e7eb;
  color: #374151;
}

.topic-badge.human {
  background: linear-gradient(45deg, #f43f5e, #fb7185);
}

.btn-primary {
  background: linear-gradient(45deg, #4f46e5, #6d28d9);
  border: none;
}

.btn-success {
  background: linear-gradient(45deg, #059669, #10b981);
  border: none;
}

.btn-warning {
  background: linear-gradient(45deg, #d97706, #f59e0b);
  border: none;
  color: #fff;
}

.btn-danger {
  background: linear-gradient(45deg, #dc2626, #ef4444);
  border: none;
}

.table .disabled-row {
  color: #6c757d;
}

th[data-sort] {
  cursor: pointer;
}

.sort-indicator {
  font-size: 0.75rem;
}

/* Landing page */
.hero {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  min-height: 80vh;
  color: #fff;
  padding: 5rem 1rem;
  animation: fadeIn 1s ease-in-out;
}

.features img {
  transition: transform 0.3s;
}

.features img:hover {
  transform: scale(1.05);
}

.policy-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Conversations v2 */
.conversations-v2 .conv-header {
  background-color: #111827;
  color: #e2e2e2;
}

.conversations-v2 .conv-body {
  height: calc(100vh - 50px);
}

.conversations-v2 .filters-panel,
.conversations-v2 .actions-panel {
  background-color: #1e293b;
  color: #cbd5e1;
  overflow-y: auto;
}

.conversations-v2 .filters-panel .filter-item,
.conversations-v2 .actions-panel .action-item {
  cursor: pointer;
}

.conversations-v2 .filters-panel .filter-item {
  margin-bottom: 0.75rem;
}

.conversations-v2 .filters-panel .filter-item.active {
  color: #0d6efd;
  font-weight: 600;
}

.conversations-v2 .list-panel {
  background-color: #f8f9fa;
  overflow-y: auto;
}

.conversations-v2 .conversation-item {
  cursor: pointer;
  padding: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.conversations-v2 .conversation-item:hover {
  background-color: #e5e7eb;
}

.conversations-v2 .chat-panel {
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.conversations-v2 .chat-messages {
  flex-grow: 1;
  overflow-y: auto;
}

.conversations-v2 .chat-input {
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.context-content {
    white-space: pre-wrap;
}
