/* Main Styles */
:root {
  --primary-color: #4caf50;
  --secondary-color: #2196f3;
  --dark-color: #333;
  --light-color: #f4f4f4;
  --danger-color: #f44336;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --info-color: #2196f3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f8f9fa;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Login Screen */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f8f9fa;
}

.login-box {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-box h1 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.login-box button {
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.login-box button:hover {
  background-color: #45a049;
}

.login-error {
  color: var(--danger-color);
  margin-top: 10px;
  display: none;
}

/* Dashboard */
.dashboard {
  display: none;
  padding: 20px 0;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.dashboard-title {
  font-size: 24px;
  color: var(--dark-color);
}

.logout-btn {
  background-color: var(--danger-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.logout-btn:hover {
  background-color: #d32f2f;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card h3 {
  font-size: 16px;
  color: #666;
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
}

.dashboard-tabs {
  margin-bottom: 20px;
}

.tab-buttons {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  padding: 10px 20px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.tab-content {
  display: none;
  padding: 20px 0;
}

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

/* Call Initiator */
.call-form {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #45a049;
}

/* Call History */
.call-history {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.call-list {
  list-style: none;
}

.call-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.call-item:hover {
  background-color: #f9f9f9;
}

.call-item:last-child {
  border-bottom: none;
}

.call-item .call-time {
  font-size: 14px;
  color: #666;
}

.call-item .call-number {
  font-weight: bold;
}

.call-item .call-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 10px;
}

.call-item .call-duration {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.call-status.completed {
  background-color: #e8f5e9;
  color: var(--success-color);
}

.call-status.in-progress {
  background-color: #fff8e1;
  color: var(--warning-color);
}

.call-status.failed {
  background-color: #ffebee;
  color: var(--danger-color);
}

/* Call summary in call history */
.call-summary {
  font-size: 14px;
  color: #555;
  margin-top: 10px;
  font-style: italic;
  line-height: 1.4;
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 3px solid #ddd;
}

/* Transcript */
.transcript-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-top: 30px;
  display: none;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #f5f5f5;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 1px solid #eee;
}

.transcript-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.close-transcript {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
}

.transcript-messages {
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

/* Role explanation header */
.transcript-roles-header {
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 8px;
  text-align: center;
}

.role-explanation {
  font-size: 14px;
  color: #555;
}

.agent-indicator {
  color: var(--primary-color);
  margin-right: 5px;
}

.caller-indicator {
  color: var(--secondary-color);
  margin-right: 5px;
  margin-left: 15px;
}

.message {
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  position: relative;
}

.message.agent {
  background-color: #e8f5e9;
  margin-right: 20%;
  border-left: 4px solid var(--primary-color);
}

.message.caller {
  background-color: #e3f2fd;
  margin-left: 20%;
  border-left: 4px solid var(--secondary-color);
}

.message .speaker {
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.message.agent .speaker {
  color: var(--primary-color);
}

.message.caller .speaker {
  color: var(--secondary-color);
}

.message .content {
  line-height: 1.5;
  font-size: 15px;
}

.message .timestamp {
  font-size: 12px;
  color: #666;
  text-align: right;
  margin-top: 8px;
}

.error-details {
  font-size: 12px;
  color: #f44336;
  margin-top: 10px;
  font-family: monospace;
}

/* Success message */
.success {
  color: var(--success-color);
  font-weight: bold;
  background-color: rgba(76, 175, 80, 0.1);
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid var(--success-color);
  margin-bottom: 10px;
}

/* Transcript summary */
.transcript-summary {
  margin: 15px 0 25px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  border-left: 4px solid var(--info-color);
}

.short-summary {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.full-summary {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

/* Conversation header */
.conversation-header {
  margin: 20px 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.conversation-header h3 {
  font-size: 18px;
  color: #333;
  margin: 0;
}

/* No transcript message */
.no-transcript {
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  text-align: center;
  color: #666;
  font-style: italic;
  margin: 15px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .tab-buttons {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #eee;
  }

  .tab-btn.active {
    border-bottom: 1px solid #eee;
    border-left: 3px solid var(--primary-color);
  }
}

/* Contacts Tab */
.contacts-container {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contacts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.contacts-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #1976d2;
}

.contacts-filters {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: bold;
}

.filter-group select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.search-group {
  flex: 1;
  max-width: 300px;
}

.search-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.contacts-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
}

.contacts-table th,
.contacts-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.contacts-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.contacts-table tr:hover {
  background-color: #f5f5f5;
}

.contact-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.contact-status.ready {
  background-color: #e3f2fd;
  color: #1976d2;
}

.contact-status.attempted {
  background-color: #fff8e1;
  color: #ff8f00;
}

.contact-status.successful {
  background-color: #e8f5e9;
  color: #388e3c;
}

.contact-status.failed {
  background-color: #ffebee;
  color: #d32f2f;
}

.contact-actions {
  display: flex;
  gap: 5px;
}

.contact-actions button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.call-btn {
  background-color: var(--primary-color);
  color: white;
}

.call-btn:hover {
  background-color: #45a049;
}

.no-contacts {
  text-align: center;
  padding: 20px;
  color: #666;
}

.batch-call-status {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-details {
  display: flex;
  justify-content: space-between;
}

.icon {
  display: inline-block;
  margin-right: 5px;
}
