/**
 * Dokan Vendor Chat - Styles
 * Bitcoin-themed dark design matching unified-auth-connector
 */

/* === Main Container === */
.dokan-vendor-chat-dashboard {
	color: #ffffff;
	padding: 20px;
}

/* === Dashboard Header === */
.dokan-vendor-chat-dashboard .dokan-dashboard-header {
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid #f7931a;
}

.dokan-vendor-chat-dashboard .dokan-dashboard-header .entry-title {
	color: #ffffff;
	font-weight: 600;
	font-size: 28px;
}

.dvc-chat-container {
	display: grid;
	grid-template-columns: 350px 1fr;
	gap: 1rem;
	min-height: 600px;
	max-height: 75vh;
}

@media (max-width: 992px) {
	.dvc-chat-container {
		grid-template-columns: 1fr;
		max-height: none;
		min-height: auto;
	}
	.dvc-chat-sidebar {
		max-height: 400px;
	}
	.dvc-chat-window {
		min-height: 500px;
	}
}

/* === Chat Sidebar ======================================================= */
.dvc-chat-sidebar {
	background: #181e27;
	border: 1px solid #2b3240;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Tabs =============================================================== */
.dvc-chat-tabs {
	display: flex;
	background: #181e27;
	border-bottom: 1px solid #2b3240;
}

.dvc-tab-btn {
	flex: 1;
	padding: 1rem;
	border: none;
	background: transparent;
	color: #9aa4b2;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 13px;
}

.dvc-tab-btn:hover {
	background: rgba(247, 147, 26, 0.1);
	color: #f7931a;
}

.dvc-tab-btn.active {
	background: #181e27;
	color: #f7931a;
	border-bottom: 2px solid #f7931a;
}

.dvc-tab-btn .dvc-count {
	color: #9aa4b2;
	font-size: 0.85rem;
	margin-left: 0.25rem;
}

/* === Chat List ========================================================== */
.dvc-chat-list {
	overflow-y: auto;
	flex: 1;
	padding: 0.5rem;
}

.dvc-chat-list::-webkit-scrollbar {
	width: 8px;
}

.dvc-chat-list::-webkit-scrollbar-track {
	background: #181e27;
}

.dvc-chat-list::-webkit-scrollbar-thumb {
	background: #2b3240;
	border-radius: 4px;
}

.dvc-chat-list::-webkit-scrollbar-thumb:hover {
	background: #f7931a;
}

/* === Chat Item ========================================================== */
.dvc-chat-item {
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	margin-bottom: 0.5rem;
	border: 1px solid transparent;
	position: relative;
}

.dvc-chat-item:hover {
	background: #2b3240;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(247, 147, 26, 0.15);
}

.dvc-chat-item.active {
	background: #2b3240;
	border-color: #f7931a;
}

.dvc-chat-item.unread {
	background: rgba(247, 147, 26, 0.05);
}

.dvc-chat-item-avatar {
	flex-shrink: 0;
}

.dvc-chat-item-avatar img {
	border-radius: 50%;
	width: 40px;
	height: 40px;
}

.dvc-chat-item-content {
	flex: 1;
	overflow: hidden;
}

.dvc-chat-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.25rem;
}

.dvc-chat-item-header strong {
	color: #ffffff;
	font-size: 0.95rem;
	font-weight: 600;
}

.dvc-chat-time {
	font-size: 0.75rem;
	color: #9aa4b2;
}

.dvc-chat-item-product {
	margin-bottom: 0.25rem;
}

.dvc-chat-item-product small {
	color: #f7931a;
	font-size: 0.8rem;
}

.dvc-chat-item-preview {
	font-size: 0.85rem;
	color: #9aa4b2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.6;
}

.dvc-unread-indicator {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	transform: translateY(-50%);
	width: 10px;
	height: 10px;
	background: #f7931a;
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

/* === Empty State ======================================================== */
.dvc-empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: #9aa4b2;
}

.dvc-empty-state i {
	font-size: 3rem;
	color: #2b3240;
	margin-bottom: 1rem;
	display: block;
}

.dvc-empty-state p {
	margin-bottom: 0.5rem;
	font-size: 1rem;
	color: #cfd6df;
}

.dvc-empty-state small {
	color: #9aa4b2;
	font-size: 0.85rem;
}

/* === Chat Window ======================================================== */
.dvc-chat-window {
	background: #181e27;
	border: 1px solid #2b3240;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dvc-no-chat-selected {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #9aa4b2;
	padding: 2rem;
	text-align: center;
}

.dvc-no-chat-selected i {
	font-size: 4rem;
	color: #2b3240;
	margin-bottom: 1.5rem;
}

.dvc-no-chat-selected h3 {
	color: #ffffff;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.dvc-no-chat-selected p {
	color: #cfd6df;
}

/* === Chat Header ======================================================== */
.dvc-chat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	background: #181e27;
	border-bottom: 1px solid #2b3240;
}

.dvc-chat-header-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.dvc-chat-header-info img {
	border-radius: 50%;
	width: 40px;
	height: 40px;
}

.dvc-chat-header-info strong {
	color: #ffffff;
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
	font-size: 18px;
}

.dvc-chat-product-link {
	font-size: 0.85rem;
}

.dvc-chat-product-link a {
	color: #f7931a;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	transition: color 0.2s ease;
}

.dvc-chat-product-link a:hover {
	color: #d97e10;
	text-decoration: underline;
}

.dvc-chat-actions {
	display: flex;
	gap: 0.5rem;
}

.dvc-action-btn {
	background: transparent;
	border: 1px solid #2b3240;
	color: #9aa4b2;
	padding: 8px 14px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-weight: 600;
}

.dvc-action-btn:hover {
	background: #2b3240;
	border-color: #f7931a;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(247, 147, 26, 0.2);
}

.dvc-action-btn.dvc-delete-btn:hover {
	background: #d32f2f;
	border-color: #d32f2f;
	color: #ffffff;
	box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

/* === Messages Area ====================================================== */
.dvc-messages-area {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.dvc-messages-area::-webkit-scrollbar {
	width: 8px;
}

.dvc-messages-area::-webkit-scrollbar-track {
	background: #181e27;
}

.dvc-messages-area::-webkit-scrollbar-thumb {
	background: #2b3240;
	border-radius: 4px;
}

.dvc-messages-area::-webkit-scrollbar-thumb:hover {
	background: #f7931a;
}

.dvc-empty-chat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #9aa4b2;
}

.dvc-empty-chat i {
	font-size: 3rem;
	color: #2b3240;
	margin-bottom: 1rem;
}

.dvc-empty-chat p {
	color: #cfd6df;
}

/* === Messages =========================================================== */
.dvc-message {
	display: flex;
	gap: 0.75rem;
	max-width: 75%;
}

.dvc-message.own {
	margin-left: auto;
	flex-direction: row-reverse;
}

.dvc-message-avatar img {
	border-radius: 50%;
	width: 32px;
	height: 32px;
}

.dvc-message-content {
	flex: 1;
}

.dvc-message-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

.dvc-message.own .dvc-message-header {
	flex-direction: row-reverse;
}

.dvc-message-header strong {
	color: #ffffff;
	font-size: 0.85rem;
	font-weight: 600;
}

.dvc-message-time {
	font-size: 0.75rem;
	color: #9aa4b2;
}

.dvc-message-text {
	background: #181e27;
	border: 1px solid #2b3240;
	padding: 0.75rem 1rem;
	border-radius: 10px;
	color: #cfd6df;
	line-height: 1.7;
	word-wrap: break-word;
}

.dvc-message.own .dvc-message-text {
	background: rgba(247, 147, 26, 0.15);
	border: 1px solid rgba(247, 147, 26, 0.3);
	color: #ffffff;
}

/* === Message Input ====================================================== */
.dvc-message-input-area {
	padding: 1.5rem;
	background: #181e27;
	border-top: 1px solid #2b3240;
}

.dvc-send-message-form {
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
}

.dvc-message-input {
	flex: 1;
	background: #181e27 !important;
	border: 1px solid #2b3240 !important;
	color: #ffffff !important;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	resize: vertical;
	min-height: 60px;
	font-family: inherit;
	line-height: 1.6;
}

.dvc-message-input::placeholder {
	color: #9aa4b2;
}

.dvc-message-input:focus {
	outline: 2px solid #f7931a;
	outline-offset: 2px;
	border-color: #f7931a !important;
}

.dvc-send-btn {
	background: #f7931a !important;
	border: 1px solid #f7931a !important;
	color: #ffffff !important;
	font-weight: 700;
	padding: 12px 24px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 13px;
}

.dvc-send-btn:hover {
	background: #d97e10 !important;
	border-color: #d97e10 !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(247, 147, 26, 0.4);
}

.dvc-send-btn:disabled {
	background: #2b3240 !important;
	border-color: #2b3240 !important;
	color: #9aa4b2 !important;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* === Product Page Chat Icon ============================================ */
/* Chat icon follows the same styling as contact icons from add-contact-details plugin */
/* Bitcoin orange background to make it stand out */
.dkp-contact-icon--chat {
	border-radius: 8px;
	background: #f7931a !important;
}

.dkp-contact-icon--chat i {
	font-size: 16px !important;
}

.dkp-contact-icon--chat:hover,
.dkp-contact-icon--chat:focus {
	background: #d97e10 !important;
	transform: translateY(-1px);
}

/* === Modal ============================================================== */
.dvc-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.dvc-modal-content {
	background: #181e27;
	border: 1px solid #2b3240;
	border-radius: 12px;
	width: 90%;
	max-width: 500px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dvc-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem;
	border-bottom: 1px solid #2b3240;
}

.dvc-modal-header h3 {
	color: #ffffff;
	margin: 0;
	font-weight: 600;
	font-size: 20px;
}

.dvc-modal-close {
	background: transparent;
	border: none;
	color: #9aa4b2;
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dvc-modal-close:hover {
	background: #2b3240;
	color: #ffffff;
}

.dvc-modal-body {
	padding: 1.5rem;
}

.dvc-form-group {
	margin-bottom: 1rem;
}

.dvc-form-group label {
	display: block;
	color: #cfd6df;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 15px;
}

.dvc-form-group textarea {
	width: 100%;
	background: #181e27 !important;
	border: 1px solid #2b3240 !important;
	color: #ffffff !important;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-family: inherit;
	resize: vertical;
	line-height: 1.6;
}

.dvc-form-group textarea::placeholder {
	color: #9aa4b2;
}

.dvc-form-group textarea:focus {
	outline: 2px solid #f7931a;
	outline-offset: 2px;
	border-color: #f7931a !important;
}

.dvc-modal-actions {
	display: flex;
	gap: 1rem;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.dvc-btn-primary {
	background: #f7931a !important;
	border: 1px solid #f7931a !important;
	color: #ffffff !important;
	font-weight: 700;
	padding: 12px 24px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 13px;
}

.dvc-btn-primary:hover {
	background: #d97e10 !important;
	border-color: #d97e10 !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(247, 147, 26, 0.4);
}

.dvc-btn-primary:focus {
	outline: 2px solid #f7931a;
	outline-offset: 2px;
}

.dvc-btn-secondary {
	background: #2b3240;
	border: 1px solid #2b3240;
	color: #ffffff;
	font-weight: 700;
	padding: 12px 24px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 13px;
}

.dvc-btn-secondary:hover {
	background: #3b4250;
	border-color: #3b4250;
	transform: translateY(-1px);
}

.dvc-btn-secondary:focus {
	outline: 2px solid #f7931a;
	outline-offset: 2px;
}

/* === Notification Badge ================================================= */
.dvc-notification-badge {
	background: #d32f2f;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 9999px;
	margin-left: 0.5rem;
	display: inline-block;
	min-width: 20px;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

/* === Loading State ====================================================== */
.dvc-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.dvc-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 24px;
	height: 24px;
	margin: -12px 0 0 -12px;
	border: 3px solid #2b3240;
	border-top: 3px solid #f7931a;
	border-radius: 50%;
	animation: dvc-spin 0.8s linear infinite;
}

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

/* === Success/Error Messages ============================================= */
.dvc-message-success {
	background: rgba(76, 175, 80, 0.15);
	color: #81c784;
	border: 1px solid rgba(76, 175, 80, 0.3);
	padding: 14px 18px;
	border-radius: 8px;
	margin-bottom: 1rem;
	font-size: 14px;
	line-height: 1.6;
}

.dvc-message-error {
	background: rgba(244, 67, 54, 0.15);
	color: #ef5350;
	border: 1px solid rgba(244, 67, 54, 0.3);
	padding: 14px 18px;
	border-radius: 8px;
	margin-bottom: 1rem;
	font-size: 14px;
	line-height: 1.6;
}

.dvc-message-info {
	background: rgba(247, 147, 26, 0.15);
	color: #f7931a;
	border: 1px solid rgba(247, 147, 26, 0.3);
	padding: 14px 18px;
	border-radius: 8px;
	margin-bottom: 1rem;
	font-size: 14px;
	line-height: 1.6;
}
