/* Agents Feature Styles */

/* Agents Container */
#agents-content {
  padding-top: 20px;
  background: #f8f9fa;
  min-height: calc(100vh - 150px);
}

/* Search Bar */
.agent-search-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.agent-search-container input {
  max-width: 400px;
}

/* Create Agent Button */
.create-agent-btn {
  background: #445082;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.create-agent-btn:hover {
  background: #7F8ACA;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(68, 80, 130, 0.3);
}

/* Agents List */
.agents-list-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.agents-list-container .table {
  margin-bottom: 0;
}

.agents-list-container .table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.agents-list-container .table thead th {
  font-weight: 600;
  color: #495057;
  padding: 15px;
  border: none;
}

.agents-list-container .table tbody td {
  padding: 15px;
  vertical-align: middle;
  border-color: #f1f3f5;
}

.agents-list-container .table tbody tr:hover {
  background: #f8f9fa;
}

/* Agent Form */
.agent-form-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.agent-form-container .form-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e9ecef;
}

.agent-form-container .form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.agent-form-container .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
}

.agent-form-container .form-text {
  color: #6c757d;
  font-size: 0.875rem;
}

/* Toggle Switches */
.form-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-switch .form-check-input {
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.form-switch .form-check-input:checked {
  background-color: #445082;
  border-color: #445082;
}

.form-switch label {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}

/* Test Buttons */
.test-btn {
  background: transparent;
  color: #445082;
  border: 1px solid #445082;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.test-btn:hover {
  background: #445082;
  color: white;
}

/* Schedule Section */
.schedule-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.repeat-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.repeat-inputs input[type="number"] {
  width: 80px;
}

/* Email Tags */
.email-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  min-height: 50px;
  align-items: flex-start;
}

.email-tags .badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 400;
  background-color: #445082 !important;
  color: white;
}

.email-tags .badge:hover {
  background-color: #7F8ACA !important;
}

.email-tags .btn-close {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  opacity: 0.8;
}

/* Agent Status Indicators */
.agent-status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.agent-status-active {
  background: #28a745;
  animation: pulse 2s infinite;
}

.agent-status-paused {
  background: #ffc107;
}

.agent-status-inactive {
  background: #6c757d;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

/* Previous Runs Button */
.previous-runs-btn {
  background: transparent;
  color: #445082;
  text-decoration: underline;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.previous-runs-btn:hover {
  color: #7F8ACA;
}

/* Loading States */
.agents-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  background: white;
  border-radius: 8px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 8px;
}

.empty-state i {
  color: #dee2e6;
}

.empty-state h5 {
  color: #495057;
  margin-top: 20px;
}

.empty-state p {
  color: #6c757d;
  margin-bottom: 20px;
}

/* Run History Modal */
.run-item {
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.run-item:hover {
  background: #e9ecef;
}

.run-item .badge {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Pagination */
.pagination-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.pagination-info .rows-per-page {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-info select {
  width: auto;
  padding: 4px 8px;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .agent-form-container {
    padding: 20px;
  }

  .schedule-inputs {
    grid-template-columns: 1fr;
  }

  .agents-list-container .table {
    font-size: 0.875rem;
  }

  .agents-list-container .dropdown-menu {
    font-size: 0.875rem;
  }

  .agent-search-container input {
    max-width: 100%;
  }
}

/* Email Typeahead */
#emailSuggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#emailSuggestions .dropdown-item {
  color: #212529;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#emailSuggestions .dropdown-item:hover,
#emailSuggestions .dropdown-item.active {
  background-color: #445082;
  color: white;
}

#emailSuggestions .dropdown-item:focus {
  outline: none;
}

/* Mention Typeahead */
#mentionSuggestions {
  position: absolute;
  z-index: 1050;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: none;
}

#mentionSuggestions.show {
  display: block;
}

#mentionSuggestions .dropdown-item {
  color: #212529;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  padding: 0.5rem 1rem;
}

#mentionSuggestions .dropdown-item:hover,
#mentionSuggestions .dropdown-item.active {
  background-color: #445082;
  color: white;
}

#mentionSuggestions .dropdown-item:focus {
  outline: none;
}

/* Domain Badges */
.domain-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.domain-funding {
  background: #e3f2fd;
  color: #1565c0;
}

.domain-underwriting {
  background: #f3e5f5;
  color: #6a1b9a;
}

.domain-sales {
  background: #e8f5e9;
  color: #2e7d32;
}

.domain-risk {
  background: #ffebee;
  color: #c62828;
}

.domain-analytics {
  background: #fff3e0;
  color: #e65100;
}

.domain-program-management {
  background: #f1f8e9;
  color: #558b2f;
}