/**
 * Yaraa AI Dashboard Styles.
 *
 * @package Yaraa_AI_Sales_Agent.
 */

/* Dashboard Grid. */
.yaraa-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.refresh {
  margin-top: 4px;
}
/* Stat Cards. */
.yaraa-stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.yaraa-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.yaraa-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yaraa-stat-icon .dashicons {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: #ffffff;
}

.yaraa-stat-blue .yaraa-stat-icon {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.yaraa-stat-green .yaraa-stat-icon {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.yaraa-stat-orange .yaraa-stat-icon {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.yaraa-stat-purple .yaraa-stat-icon {
  background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.yaraa-stat-content h3 {
  font-size: 14px;
  font-weight: 500;
  color: #646970;
  margin: 0 0 8px 0;
}

.yaraa-stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #1d2327;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.yaraa-stat-label {
  font-size: 13px;
  color: #a0a5aa;
  margin: 0;
}

/* Dashboard Content Grid. */
.yaraa-dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* Cards. */
.yaraa-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.yaraa-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f1;
}

/* Empty State. */
.yaraa-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #646970;
}

.yaraa-empty-state .dashicons {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: #dcdcde;
  margin-bottom: 16px;
}

.yaraa-empty-state p {
  font-size: 14px;
  margin: 0;
  max-width: 300px;
  margin: 0 auto;
}

/* Quick Actions. */
.yaraa-quick-actions {
  margin: 30px 0;
}

.yaraa-quick-actions h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 16px 0;
}

.yaraa-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.yaraa-action-buttons .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  height: auto;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.yaraa-action-buttons .button .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.yaraa-action-buttons .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive. */
@media (max-width: 782px) {
  .yaraa-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .yaraa-dashboard-content {
    grid-template-columns: 1fr;
  }

  .yaraa-action-buttons {
    flex-direction: column;
  }

  .yaraa-action-buttons .button {
    justify-content: center;
  }
}

/* Notice styling override. */
.yaraa-admin-page .notice {
  margin: 20px 0;
  border-radius: 8px;
  border-left-width: 4px;
}
/**
 * Yaraa AI Sales Agent - Dashboard Page Styles.
 *
 * @package Yaraa_AI_Sales_Agent.
 */

/* Dashboard Page Styles. */
.yaraa-dashboard-page h1 {
	font-size: 24px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 20px;
}

/* Notice. */
.yaraa-notice {
	background: #fff;
	border-left: 4px solid #dba617;
	padding: 12px 16px;
	margin-bottom: 20px;
}

/* Loading State. */
.yaraa-loading-state {
	text-align: center;
	padding: 60px 20px;
	background: #fff;
	border-radius: 12px;
}

.yaraa-loading-state .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: #6366f1;
}

.yaraa-spin {
	animation: yaraa-spin 1s linear infinite;
}

@keyframes yaraa-spin {
	100% {
		transform: rotate(360deg);
	}
}

/* Stats Grid - Dashed Border Cards with LEFT colored border. */
.yaraa-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.yaraa-stat-card {
	background: #fff;
	border-radius: 12px;
	padding: 30px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 16px;
}

.yaraa-stat-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Colored LEFT borders. */
.yaraa-stat-card.yaraa-stat-purple {
	border-left: 3px solid #8b5cf6;
	border-left-style: solid;
}

.yaraa-stat-card.yaraa-stat-green {
	border-left: 3px solid #10b981;
	border-left-style: solid;
}

.yaraa-stat-card.yaraa-stat-blue {
	border-left: 3px solid #6366f1;
	border-left-style: solid;
}

.yaraa-stat-card.yaraa-stat-yellow {
	border-left: 3px solid #f59e0b;
	border-left-style: solid;
}

/* Icon boxes. */
.yaraa-stat-icon-box {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.yaraa-stat-icon-box.purple {
	background: #ede9fe;
}

.yaraa-stat-icon-box.green {
	background: #d1fae5;
}

.yaraa-stat-icon-box.blue {
	background: #dbeafe;
}

.yaraa-stat-icon-box.yellow {
	background: #fef3c7;
}

.yaraa-stat-icon-box.purple .dashicons {
	color: #8b5cf6;
}

.yaraa-stat-icon-box.green .dashicons {
	color: #10b981;
}

.yaraa-stat-icon-box.blue .dashicons {
	color: #6366f1;
}

.yaraa-stat-icon-box.yellow .dashicons {
	color: #f59e0b;
}

.yaraa-stat-icon-box .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.yaraa-stat-info {
	flex: 1;
}

.yaraa-stat-card .yaraa-stat-label {
	display: block;
	font-size: 13px;
	color: #64748b;
	margin-bottom: 4px;
	line-height: 1.3;
}

.yaraa-stat-card .yaraa-stat-label small {
	font-size: 12px;
	color: #94a3b8;
}

.yaraa-stat-card .yaraa-stat-value {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1;
}

/* Dashboard Actions. */
.yaraa-dashboard-actions {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}

.yaraa-month-picker {
	padding: 8px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}

/* Charts Row. */
.yaraa-charts-row {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 20px;
	margin-bottom: 24px;
}

.yaraa-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	margin-bottom: 20px;
}

.yaraa-card-wide {
	grid-column: span 1;
}

.yaraa-card-header {
	padding: 16px 20px;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.yaraa-card-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}

.yaraa-view-all {
	font-size: 13px;
	color: #6366f1;
	text-decoration: none;
}

.yaraa-view-all:hover {
	color: #4f46e5;
	text-decoration: underline;
}

.yaraa-card-body {
	padding: 20px;
}

.yaraa-card-body-table {
	padding: 0;
}

.yaraa-chart-container {
	height: 280px;
	display: flex;
	justify-content: center;
}

.yaraa-chart-bar {
	height: 300px;
}

/* Table Styles (Matching Conversations). */
.yaraa-table {
	width: 100%;
	border-collapse: collapse;
}

.yaraa-table th {
	background: #f8fafc;
	padding: 14px 16px;
	text-align: left;
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid #e2e8f0;
}

.yaraa-table th.col-messages,
.yaraa-table th.col-status,
.yaraa-table th.col-actions {
	text-align: center;
}

.yaraa-table td {
	padding: 16px;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
}

.yaraa-table tbody tr:hover {
	background: #f8fafc;
}

.yaraa-table tbody tr:last-child td {
	border-bottom: none;
}

/* Visitor Info (Matching Conversations). */
.yaraa-visitor-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.yaraa-visitor-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 15px;
	flex-shrink: 0;
}

.yaraa-visitor-details strong {
	display: block;
	color: #1e293b;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 4px;
}

.yaraa-visitor-badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

/* Badges. */
.yaraa-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
}

.yaraa-badge .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

.yaraa-badge-success {
	background: #d1fae5;
	color: #059669;
}

.yaraa-badge-warning {
	background: #fef3c7;
	color: #d97706;
}

/* Message Badge. */
.yaraa-message-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	background: #dbeafe;
	color: #2563eb;
}

.yaraa-message-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Status Badge. */
.yaraa-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
}

.yaraa-status-badge::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.yaraa-status-badge.status-active {
	background: #d1fae5;
	color: #059669;
}

.yaraa-status-badge.status-active::before {
	background: #10b981;
}

.yaraa-status-badge.status-closed {
	background: #e2e8f0;
	color: #64748b;
}

.yaraa-status-badge.status-closed::before {
	background: #94a3b8;
}

/* Last Contact. */
.yaraa-last-contact {
	font-size: 14px;
	color: #1e293b;
}

.yaraa-last-contact-time {
	display: block;
	font-size: 12px;
	color: #94a3b8;
	margin-top: 2px;
}

/* Action Buttons. */
.yaraa-action-buttons {
	display: flex;
	gap: 8px;
	justify-content: center;
}

.yaraa-btn-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
}

.yaraa-btn-icon:hover {
	border-color: #6366f1;
	background: #ede9fe;
}

.yaraa-btn-icon .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #64748b;
}

.yaraa-btn-icon:hover .dashicons {
	color: #6366f1;
}

/* Lead Link. */
.yaraa-lead-link {
	color: #1e293b;
	text-decoration: none;
	font-weight: 500;
}

.yaraa-lead-link:hover {
	color: #6366f1;
	text-decoration: underline;
}

/* Empty State. */
.yaraa-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #64748b;
}

.yaraa-empty-state .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: #cbd5e1;
	margin-bottom: 10px;
}

/* Modal Styles. */
.yaraa-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.yaraa-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.yaraa-modal-container {
	position: relative;
	background: #fff;
	border-radius: 12px;
	width: 95%;
	max-width: 600px;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.yaraa-modal-lg {
	max-width: 1200px;
}

.yaraa-modal-header {
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
}

.yaraa-modal-header h3 {
	margin: 0;
	font-size: 18px;
	display: flex;
	align-items: center;
	gap: 8px;
	color: white;
}

.yaraa-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #fff;
	padding: 0;
	line-height: 1;
	opacity: 0.8;
}

.yaraa-modal-close:hover {
	opacity: 1;
}

.yaraa-modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
	max-height: calc(90vh - 70px);
}

.yaraa-modal-loading {
	text-align: center;
	padding: 40px;
}

/* Visitor Card in Modal. */
.yaraa-visitor-card {
	background: #f8fafc;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
}

.yaraa-visitor-card-header {
	display: flex;
	gap: 20px;
}

.yaraa-visitor-avatar-lg {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 24px;
	flex-shrink: 0;
}

.yaraa-visitor-card-content {
	flex: 1;
}

.yaraa-visitor-info-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 12px;
}

.yaraa-info-item {
	min-width: 0;
}

.yaraa-info-label {
	display: block;
	font-size: 11px;
	color: #64748b;
	margin-bottom: 2px;
	text-transform: uppercase;
}

.yaraa-info-value {
	display: block;
	font-size: 14px;
	color: #1e293b;
	font-weight: 500;
	word-break: break-word;
}

/* Conversation History. */
.yaraa-conversation-history h4 {
	margin: 0 0 16px;
	font-size: 16px;
	color: #1e293b;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
}

/* Accordion. */
.yaraa-accordion-item {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin-bottom: 10px;
	overflow: hidden;
}

.yaraa-accordion-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: #f8fafc;
	cursor: pointer;
	transition: background 0.2s;
	gap: 12px;
}

.yaraa-accordion-header:hover {
	background: #f1f5f9;
}

.yaraa-accordion-header.active {
	background: transparent;
}

.yaraa-accordion-title {
	flex: 1;
}

.yaraa-accordion-title strong {
	display: block;
	font-size: 15px;
	color: #1e293b;
	margin-bottom: 6px;
}

.yaraa-accordion-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.yaraa-accordion-dates {
	text-align: right;
	font-size: 12px;
	color: #64748b;
}

.yaraa-accordion-arrow {
	color: #64748b;
	transition: transform 0.2s;
}

.yaraa-accordion-body {
	padding: 16px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
}

.yaraa-url-badge {
	color: #6366f1;
	cursor: help;
}

/* Chat Container. */
.yaraa-chat-container {
	max-height: 400px;
	overflow-y: auto;
	padding: 10px;
	background: #f5f7fb;
	border-radius: 8px;
}

.yaraa-chat-message {
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
}

.yaraa-chat-message.user {
	justify-content: flex-start;
}

.yaraa-chat-message.bot {
	justify-content: flex-end;
}

.yaraa-message-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #6366f1;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.yaraa-message-avatar.bot {
	background: #10b981;
}

.yaraa-message-avatar .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.yaraa-message-content {
	max-width: 70%;
}

.yaraa-message-header {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 4px;
	font-size: 12px;
}

.yaraa-message-header strong {
	color: #1e293b;
}

.yaraa-message-time {
	color: #94a3b8;
	font-size: 11px;
}

.yaraa-message-bubble {
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
}

.yaraa-chat-message.user .yaraa-message-bubble {
	background: #e3f2fd;
	border-bottom-left-radius: 4px;
}

.yaraa-chat-message.bot .yaraa-message-bubble {
	background: #fff;
	border-bottom-right-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.yaraa-chat-loading-inline {
	text-align: center;
	padding: 20px;
	color: #64748b;
}

.yaraa-no-messages,
.yaraa-no-conversations {
	text-align: center;
	padding: 20px;
	color: #64748b;
	font-style: italic;
}

.yaraa-error {
	color: #dc2626;
	text-align: center;
	padding: 20px;
}

/* AI Response HTML Formatting. */
.yaraa-ai-response ul,
.yaraa-ai-response ol {
	margin: 8px 0;
	padding-left: 20px;
}

.yaraa-ai-response ul {
	list-style-type: disc;
}

.yaraa-ai-response li {
	margin-bottom: 4px;
}

.yaraa-ai-response b,
.yaraa-ai-response strong {
	font-weight: 600;
}

/* Responsive. */
@media (max-width: 1200px) {
	.yaraa-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.yaraa-charts-row {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.yaraa-stats-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.yaraa-stat-card {
		padding: 16px;
	}

	.yaraa-stat-icon-box {
		width: 40px;
		height: 40px;
	}

	.yaraa-stat-card .yaraa-stat-value {
		font-size: 24px;
	}

	.yaraa-table {
		display: block;
		overflow-x: auto;
	}

	.yaraa-visitor-info-grid {
		grid-template-columns: 1fr 1fr;
	}

	.yaraa-visitor-card-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.yaraa-stats-grid {
		display: block;
	}

	.yaraa-stat-card {
		padding: 14px;
		margin-bottom: 10px;
	}

	.yaraa-stat-icon-box {
		width: 36px;
		height: 36px;
		margin-bottom: 10px;
	}

	.yaraa-stat-icon-box .dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}

	.yaraa-stat-card .yaraa-stat-label {
		font-size: 11px;
	}

	.yaraa-stat-card .yaraa-stat-value {
		font-size: 22px;
	}

	.yaraa-dashboard-actions {
		flex-direction: column;
	}

	.yaraa-accordion-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.yaraa-accordion-dates {
		text-align: left;
		margin-top: 8px;
	}

	.yaraa-message-content {
		max-width: 85%;
	}
}