/**
 * Karma Support Center Pro - Customer Portal Stylesheet (RTL)
 */

.ksp-customer-app,
.ket {
	font-family: inherit;
	color: #1e293b;
	direction: rtl;
	text-align: right;
}

/* Header & Nav */
.ksp-cust-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
}

.ksp-cust-title {
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
}

.ksp-btn-primary {
	background: #04b4dc !important;
	color: #ffffff !important;
	border: none !important;
	padding: 8px 18px !important;
	border-radius: 12px !important;
	font-size: 12.5px !important;
	font-weight: 700 !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: background 0.2s;
	box-shadow: 0 1px 2px rgba(4, 180, 220, 0.2);
}

.ksp-btn-primary:hover {
	background: #0284c7 !important;
}

.ksp-btn-secondary {
	background: #f1f5f9 !important;
	color: #475569 !important;
	border: 1px solid #e2e8f0 !important;
	padding: 8px 16px !important;
	border-radius: 12px !important;
	font-size: 12.5px !important;
	font-weight: 700 !important;
	cursor: pointer;
	transition: all 0.2s;
}

.ksp-btn-secondary:hover {
	background: #e2e8f0 !important;
	color: #0f172a !important;
}

/* Spinner */
.ksp-spinner {
	display: inline-block;
	width: 28px;
	height: 28px;
	border: 3px solid rgba(4, 180, 220, 0.2);
	border-radius: 50%;
	border-top-color: #04b4dc;
	animation: ksp-spin 0.8s linear infinite;
	margin-bottom: 8px;
}

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

.ket-loading {
	text-align: center;
	padding: 40px 10px;
	color: #64748b;
	font-size: 13px;
	font-weight: 600;
}

/* Cards & Forms */
.ksp-cust-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 16px;
}

.ksp-form-row {
	margin-bottom: 16px;
}

.ksp-form-row label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 6px;
}

.ksp-form-row input[type="text"],
.ksp-form-row select,
.ksp-form-row textarea {
	width: 100%;
	border-radius: 10px;
	border: 1px solid #cbd5e1;
	padding: 10px 14px;
	font-size: 13px;
	font-family: inherit;
	background: #ffffff;
	box-shadow: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.ksp-form-row input:focus,
.ksp-form-row select:focus,
.ksp-form-row textarea:focus {
	border-color: #04b4dc;
	outline: none;
	box-shadow: 0 0 0 3px rgba(4, 180, 220, 0.15);
}

.ksp-grid-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 640px) {
	.ksp-grid-form {
		grid-template-columns: 1fr;
	}
}

/* Ticket List Item */
.ksp-ticket-item {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 16px 18px;
	margin-bottom: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.ksp-ticket-item:hover {
	border-color: #04b4dc;
	box-shadow: 0 4px 12px rgba(4, 180, 220, 0.08);
	transform: translateY(-1px);
}

.ksp-ticket-subj {
	font-size: 14px;
	font-weight: 800;
	color: #0f172a;
	margin-bottom: 4px;
}

.ksp-ticket-meta {
	font-size: 12px;
	color: #64748b;
}

.ksp-pill {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
}

.ksp-pill-open { background: #e0f2fe; color: #0284c7; }
.ksp-pill-progress { background: #fef3c7; color: #d97706; }
.ksp-pill-answered { background: #dcfce7; color: #15803d; }
.ksp-pill-closed { background: #f1f5f9; color: #64748b; }

/* Conversation Thread */
.ksp-thread-view {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ksp-thread-head-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	background: #f8fafc;
	padding: 14px 18px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
}

.ksp-chat-stream {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 10px 0;
	max-height: 500px;
	overflow-y: auto;
	padding-right: 4px;
}

.ksp-bubble {
	max-width: 85%;
	padding: 12px 16px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.6;
}

.ksp-bubble-user {
	align-self: flex-start;
	background: #f1f5f9;
	color: #1e293b;
	border-bottom-right-radius: 2px;
}

.ksp-bubble-staff {
	align-self: flex-end;
	background: #ecfeff;
	border: 1px solid #cffafe;
	color: #0e7490;
	border-bottom-left-radius: 2px;
}

.ksp-bubble-system {
	align-self: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #64748b;
	font-size: 11.5px;
	padding: 4px 14px;
	border-radius: 20px;
}

.ksp-bubble-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11.5px;
	font-weight: 700;
	margin-bottom: 6px;
	opacity: 0.85;
}

.ksp-bubble-body {
	white-space: pre-wrap;
	word-break: break-word;
}

.ksp-bubble-files {
	margin-top: 8px;
	padding-top: 6px;
	border-top: 1px dashed rgba(0, 0, 0, 0.1);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ksp-attach-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11.5px;
	color: inherit;
	text-decoration: none;
}

.ksp-attach-chip:hover {
	border-color: #04b4dc;
}

/* Reply & Rating */
.ksp-cust-reply-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 16px;
	margin-top: 10px;
}

.ksp-rating-box {
	background: #fffbeb;
	border: 1px solid #fef3c7;
	border-radius: 14px;
	padding: 16px;
	text-align: center;
	color: #92400e;
	margin-top: 10px;
}

.ksp-stars-row {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 8px;
	font-size: 22px;
	cursor: pointer;
}

.ksp-star {
	transition: transform 0.15s;
}

.ksp-star:hover {
	transform: scale(1.25);
}

/* Customer Filter Bar */
.ksp-cust-filter-bar {
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.ksp-cust-filter-bar input,
.ksp-cust-filter-bar select {
	padding: 8px 12px;
	border-radius: 10px;
	border: 1px solid #cbd5e1;
	font-size: 12.5px;
	background: #ffffff;
}
.ksp-cust-filter-bar input {
	flex: 1;
	min-width: 180px;
}

/* Image Thumbnails in Chat */
.ksp-img-preview-wrap {
	display: inline-block;
	max-width: 220px;
	margin-top: 6px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.1);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	transition: transform 0.2s;
	cursor: zoom-in;
}
.ksp-img-preview-wrap:hover {
	transform: scale(1.02);
}
.ksp-img-preview-wrap img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Audio Player in Chat */
.ksp-audio-wrap {
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ksp-audio-wrap audio {
	height: 36px;
	max-width: 260px;
	border-radius: 20px;
}

/* Lightbox Modal */
.ksp-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	cursor: zoom-out;
}
.ksp-lightbox-overlay img {
	max-width: 90vw;
	max-height: 90vh;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}


