/**
 * Boosty Contact Builder - Ticket View Styles
 *
 * Customer-facing ticket/conversation view styles.
 */

/* Container */
.boosty-ticket-view {
	max-width: 800px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: #1e1e1e;
}

/* Header */
.boosty-ticket-header {
	background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
	color: #fff;
	padding: 24px;
	border-radius: 12px 12px 0 0;
}

.boosty-ticket-title {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.boosty-ticket-title h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	color: #fff;
}

.boosty-ticket-status {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.boosty-ticket-status.status-unread {
	background: #ffc107;
	color: #000;
}

.boosty-ticket-status.status-read {
	background: #17a2b8;
	color: #fff;
}

.boosty-ticket-status.status-answered {
	background: #28a745;
	color: #fff;
}

.boosty-ticket-status.status-spam {
	background: #6c757d;
	color: #fff;
}

.boosty-ticket-meta {
	display: flex;
	gap: 20px;
	margin-top: 12px;
	font-size: 14px;
	opacity: 0.9;
	flex-wrap: wrap;
}

.boosty-ticket-meta span {
	display: flex;
	align-items: center;
	gap: 6px;
}

.boosty-ticket-meta svg {
	opacity: 0.8;
}

/* Messages Container */
.boosty-ticket-messages {
	background: #f8f9fa;
	padding: 24px;
	min-height: 300px;
	max-height: 600px;
	overflow-y: auto;
}

.boosty-no-messages {
	text-align: center;
	padding: 40px;
	color: #666;
}

/* Individual Message */
.boosty-message {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}

.boosty-message:last-child {
	margin-bottom: 0;
}

.boosty-message-avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e9ecef;
	color: #495057;
}

.boosty-message-customer .boosty-message-avatar {
	background: #e3f2fd;
	color: #1976d2;
}

.boosty-message-staff .boosty-message-avatar {
	background: #e8f5e9;
	color: #388e3c;
}

.boosty-message-bubble {
	flex: 1;
	background: #fff;
	border-radius: 12px;
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	max-width: calc(100% - 52px);
}

.boosty-message-customer .boosty-message-bubble {
	background: #e3f2fd;
	border: 1px solid #bbdefb;
}

.boosty-message-staff .boosty-message-bubble {
	background: #fff;
	border: 1px solid #e0e0e0;
}

.boosty-message-initial .boosty-message-bubble {
	background: #fff3e0;
	border: 1px solid #ffe0b2;
}

.boosty-message-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.boosty-message-sender {
	font-weight: 600;
	color: #333;
}

.boosty-message-tag {
	font-size: 11px;
	padding: 2px 8px;
	background: #ff9800;
	color: #fff;
	border-radius: 10px;
	font-weight: 500;
}

.boosty-message-time {
	font-size: 12px;
	color: #666;
	margin-left: auto;
}

.boosty-message-content {
	color: #333;
	word-wrap: break-word;
}

.boosty-message-content p {
	margin: 0 0 10px;
}

.boosty-message-content p:last-child {
	margin-bottom: 0;
}

.boosty-message-content strong {
	font-weight: 600;
}

/* Reply Form */
.boosty-ticket-reply {
	background: #fff;
	padding: 24px;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 12px 12px;
}

.boosty-ticket-reply h3 {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.boosty-reply-notice {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
}

.boosty-reply-notice.notice-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.boosty-reply-notice.notice-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.boosty-reply-textarea-wrap {
	margin-bottom: 16px;
}

.boosty-reply-textarea-wrap textarea {
	width: 100%;
	padding: 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	resize: vertical;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.boosty-reply-textarea-wrap textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.boosty-reply-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.boosty-rate-limit-info {
	margin: 0;
	font-size: 13px;
	color: #666;
}

.boosty-submit-reply {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.boosty-submit-reply:hover {
	background: #005a87;
}

.boosty-submit-reply:active {
	transform: scale(0.98);
}

.boosty-submit-reply:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.boosty-submit-reply svg {
	flex-shrink: 0;
}

/* Closed Ticket */
.boosty-ticket-closed {
	background: #f8f9fa;
	padding: 24px;
	text-align: center;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 12px 12px;
	color: #666;
}

/* Error State */
.boosty-ticket-error {
	max-width: 600px;
	margin: 40px auto;
	padding: 40px;
	background: #fff3f3;
	border: 1px solid #ffcdd2;
	border-radius: 12px;
	text-align: center;
}

.boosty-ticket-error p {
	margin: 0;
	color: #c62828;
	font-size: 16px;
}

/* Accept/Reject Section */
.boosty-accept-reject-section {
	padding: 20px 24px;
	background: #f0f7ff;
	border: 1px solid #e0e0e0;
	border-top: none;
	text-align: center;
}

.boosty-accept-reject-prompt {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 500;
	color: #333;
}

.boosty-accept-reject-buttons {
	display: flex;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
}

.boosty-btn-accept,
.boosty-btn-reject {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.boosty-btn-accept {
	background: #28a745;
	color: #fff;
}

.boosty-btn-accept:hover {
	background: #218838;
	box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.boosty-btn-reject {
	background: #dc3545;
	color: #fff;
}

.boosty-btn-reject:hover {
	background: #c82333;
	box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.boosty-btn-accept:disabled,
.boosty-btn-reject:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.boosty-respond-confirmation {
	padding: 16px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 15px;
}

.boosty-respond-confirmation p {
	margin: 0;
}

.boosty-respond-accepted {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.boosty-respond-rejected {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* OTP Verification Screen */
.boosty-verify-content {
	background: #fff;
	padding: 48px 32px;
	text-align: center;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 12px 12px;
}

.boosty-verify-step {
	max-width: 400px;
	margin: 0 auto;
}

.boosty-verify-icon {
	color: #0073aa;
	margin-bottom: 20px;
}

.boosty-verify-icon svg {
	width: 48px;
	height: 48px;
}

.boosty-verify-description {
	font-size: 15px;
	color: #555;
	margin: 0 0 20px;
	line-height: 1.6;
}

.boosty-verify-email-label {
	font-size: 14px;
	color: #666;
	margin: 0 0 6px;
}

.boosty-verify-email {
	font-size: 17px;
	font-weight: 600;
	color: #1e1e1e;
	margin: 0 0 24px;
	letter-spacing: 0.3px;
}

.boosty-verify-send-btn,
.boosty-verify-submit-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.boosty-verify-send-btn:hover,
.boosty-verify-submit-btn:hover {
	background: #005a87;
}

.boosty-verify-send-btn:active,
.boosty-verify-submit-btn:active {
	transform: scale(0.98);
}

.boosty-verify-send-btn:disabled,
.boosty-verify-submit-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.boosty-verify-send-btn svg,
.boosty-verify-submit-btn svg {
	flex-shrink: 0;
}

.boosty-verify-code-input-wrap {
	margin-bottom: 20px;
}

.boosty-verify-code-input-wrap input {
	width: 200px;
	padding: 14px 16px;
	border: 2px solid #ddd;
	border-radius: 8px;
	font-size: 24px;
	font-family: 'Courier New', Courier, monospace;
	letter-spacing: 8px;
	text-align: center;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.boosty-verify-code-input-wrap input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.boosty-verify-resend-btn {
	display: inline-block;
	margin-top: 20px;
	padding: 8px 16px;
	background: none;
	border: none;
	color: #0073aa;
	font-size: 14px;
	cursor: pointer;
	text-decoration: underline;
	transition: color 0.2s;
}

.boosty-verify-resend-btn:hover {
	color: #005a87;
}

.boosty-verify-resend-btn:disabled {
	color: #999;
	cursor: not-allowed;
	text-decoration: none;
}

.boosty-verify-notice {
	max-width: 400px;
	margin: 20px auto 0;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
}

.boosty-verify-notice-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.boosty-verify-notice-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 600px) {
	.boosty-ticket-header {
		padding: 16px;
	}

	.boosty-ticket-title h2 {
		font-size: 20px;
	}

	.boosty-ticket-meta {
		flex-direction: column;
		gap: 8px;
	}

	.boosty-ticket-messages {
		padding: 16px;
	}

	.boosty-message {
		flex-direction: column;
		gap: 8px;
	}

	.boosty-message-avatar {
		width: 32px;
		height: 32px;
	}

	.boosty-message-avatar svg {
		width: 18px;
		height: 18px;
	}

	.boosty-message-bubble {
		max-width: 100%;
	}

	.boosty-message-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.boosty-message-time {
		margin-left: 0;
	}

	.boosty-ticket-reply {
		padding: 16px;
	}

	.boosty-reply-footer {
		flex-direction: column;
		align-items: stretch;
	}

	.boosty-submit-reply {
		justify-content: center;
	}

	.boosty-verify-content {
		padding: 32px 16px;
	}

	.boosty-verify-code-input-wrap input {
		width: 100%;
		max-width: 200px;
		font-size: 20px;
		letter-spacing: 6px;
	}

	.boosty-verify-send-btn,
	.boosty-verify-submit-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Animation for new messages */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.boosty-message.new-message {
	animation: slideIn 0.3s ease-out;
}
