/* Advanced Support Portal — frontend styles */

.asp-portal {
	max-width: 820px;
	margin: 0 auto;
	font-size: 15px;
	line-height: 1.6;
}

.asp-portal h2 {
	margin-top: 0;
}

/* Notices */
.asp-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 0 0 20px;
	border-left: 4px solid #888;
	background: #f4f4f5;
}
.asp-notice-success { border-color: #16a34a; background: #ecfdf5; }
.asp-notice-error   { border-color: #dc2626; background: #fef2f2; }
.asp-notice-warning { border-color: #d97706; background: #fffbeb; }
.asp-notice-info    { border-color: #2563eb; background: #eff6ff; }

/* Forms */
.asp-form .asp-field {
	margin-bottom: 16px;
}
.asp-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.asp-req { color: #dc2626; }
.asp-form input[type="text"],
.asp-form input[type="email"],
.asp-form input[type="search"],
.asp-form select,
.asp-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-sizing: border-box;
	font: inherit;
}
.asp-field-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.asp-field-row .asp-field { flex: 1; min-width: 200px; }

/* Buttons */
.asp-btn {
	display: inline-block;
	padding: 10px 20px;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
}
.asp-btn-primary { background: #2271b1; color: #fff; }
.asp-btn-primary:hover { background: #185a8c; color: #fff; }

/* Header row */
.asp-header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

/* Table */
.asp-table {
	width: 100%;
	border-collapse: collapse;
}
.asp-table th,
.asp-table td {
	text-align: left;
	padding: 12px;
	border-bottom: 1px solid #e5e7eb;
}
.asp-table th { font-size: 13px; text-transform: uppercase; color: #6b7280; }

/* Badges */
.asp-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}
.asp-status-open     { background: #dbeafe; color: #1e40af; }
.asp-status-pending  { background: #fef3c7; color: #92400e; }
.asp-status-on-hold  { background: #e5e7eb; color: #374151; }
.asp-status-resolved { background: #dcfce7; color: #166534; }
.asp-status-closed   { background: #f3f4f6; color: #6b7280; }
.asp-priority-low    { background: #f3f4f6; color: #6b7280; }
.asp-priority-medium { background: #dbeafe; color: #1e40af; }
.asp-priority-high   { background: #ffedd5; color: #9a3412; }
.asp-priority-urgent { background: #fee2e2; color: #991b1b; }

/* Conversation */
.asp-ticket-header { margin-bottom: 20px; }
.asp-ticket-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.asp-conversation { margin: 20px 0; }
.asp-message {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 14px;
	background: #fff;
}
.asp-message-original { border-left: 4px solid #2271b1; }
.asp-message-agent,
.asp-message-reply   { border-left: 4px solid #16a34a; background: #f7fef9; }
.asp-message-customer { border-left: 4px solid #9ca3af; }
.asp-message-internal { border-left: 4px solid #d97706; background: #fffbeb; }
.asp-message-head {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 8px;
	font-size: 14px;
}
.asp-message-date { color: #9ca3af; font-size: 13px; margin-left: auto; }
.asp-agent-tag,
.asp-internal-tag {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #dcfce7;
	color: #166534;
}
.asp-internal-tag { background: #fef3c7; color: #92400e; }
.asp-back { margin-bottom: 8px; }

/* KB */
.asp-kb-search { display: flex; gap: 10px; margin-bottom: 24px; }
.asp-kb-search input[type="search"] {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font: inherit;
}
.asp-kb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 18px;
}
.asp-kb-card {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 18px;
}
.asp-kb-card h3 { margin: 0 0 8px; }
.asp-kb-readmore { font-weight: 600; text-decoration: none; }
.asp-pagination ul { display: flex; gap: 6px; list-style: none; padding: 0; margin: 24px 0 0; }
.asp-pagination a, .asp-pagination span {
	padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; text-decoration: none;
}
.asp-empty { color: #6b7280; }

/* Auth box (login + register) */
.asp-auth-intro { color: #6b7280; margin-bottom: 18px; }

/* Google login */
.asp-social-login { max-width: 360px; margin: 0 auto 8px; }
.asp-google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 11px 16px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #1f2937;
	font-weight: 600;
	text-decoration: none;
	box-sizing: border-box;
}
.asp-google-btn:hover { background: #f9fafb; color: #1f2937; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.asp-auth-divider {
	text-align: center;
	position: relative;
	margin: 18px 0;
	color: #9ca3af;
	font-size: 13px;
}
.asp-auth-divider::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #e5e7eb;
}
.asp-auth-divider span { background: #fff; padding: 0 12px; position: relative; }
.asp-redirect-uri { display: inline-block; padding: 4px 8px; background: #f3f4f6; border-radius: 4px; }
.asp-auth-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
}
.asp-auth-col {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 22px;
}
.asp-auth-col h3 { margin-top: 0; }
.asp-auth-col .login-username label,
.asp-auth-col .login-password label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.asp-auth-col .login input[type="text"],
.asp-auth-col .login input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-sizing: border-box;
	font: inherit;
	margin-bottom: 14px;
}
.asp-auth-col .login-submit .button,
.asp-auth-col .login-submit input[type="submit"] {
	background: #2271b1;
	color: #fff;
	border: 0;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
}
.asp-auth-col .login-remember { margin-bottom: 12px; font-size: 14px; }
.asp-auth-lost { margin-top: 12px; font-size: 14px; }
.asp-hint { display: block; color: #9ca3af; font-size: 13px; margin-top: 4px; }

@media (max-width: 600px) {
	.asp-auth-cols { grid-template-columns: 1fr; }
}

/* Rating / CSAT */
.asp-rating-block {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	background: #fffdf5;
}
.asp-rating-block h3 { margin-top: 0; }
.asp-stars-static .asp-star { color: #d1d5db; font-size: 22px; }
.asp-stars-static .asp-star.is-filled { color: #eab308; }
.asp-rating-feedback { font-style: italic; color: #4b5563; }
.asp-rating-thanks { color: #16a34a; font-weight: 600; }

/* Interactive star rating (CSS-only, reversed row for hover fill) */
.asp-stars-input {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 4px;
	margin-bottom: 14px;
}
.asp-stars-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.asp-stars-input label {
	font-size: 30px;
	color: #d1d5db;
	cursor: pointer;
	transition: color .12s ease;
	line-height: 1;
}
.asp-stars-input label:hover,
.asp-stars-input label:hover ~ label,
.asp-stars-input input:checked ~ label {
	color: #eab308;
}

/* Responsive table -> cards */
@media (max-width: 600px) {
	.asp-table thead { display: none; }
	.asp-table, .asp-table tbody, .asp-table tr, .asp-table td { display: block; width: 100%; }
	.asp-table tr { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 12px; padding: 6px; }
	.asp-table td { border: 0; display: flex; justify-content: space-between; }
	.asp-table td::before { content: attr(data-label); font-weight: 600; color: #6b7280; }
}
