/**
 * Dashboard styles for Asystio plugin
 */

/* Login and Register Forms */
.asystio-login-form,
.asystio-register-form,
.asystio-forgot-password-form,
.asystio-reset-password-form {
	max-width: 450px;
	margin: 2rem auto;
	padding: 2rem;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.asystio-reset-password-form h2 {
	margin-top: 0;
	color: #333;
}

/* Auth feedback messages */
.asystio-auth-message,
.asystio-auth-success {
	background: #f0fdf4;
	border-left: 4px solid #22c55e;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	color: #166534;
	border-radius: 0 4px 4px 0;
}

.asystio-auth-error {
	background: #fef2f2;
	border-left: 4px solid #ef4444;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	color: #991b1b;
	border-radius: 0 4px 4px 0;
}

/* Reset form welcome message */
.asystio-welcome-message {
	background: #f0f8ff;
	border-left: 4px solid #667eea;
	padding: 0.75rem 1rem;
	margin-bottom: 1.5rem;
	border-radius: 0 4px 4px 0;
}

.asystio-welcome-message p {
	margin: 0.25rem 0;
}

.asystio-checkbox-label {
	font-weight: normal !important;
}

.asystio-form-links {
	text-align: center;
	margin-top: 1rem;
	font-size: 14px;
}

.asystio-field small {
	display: block;
	margin-top: 0.25rem;
	color: #666;
	font-size: 13px;
}

/* Dashboard Layout */
.asystio-dashboard {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

/* Welcome Banner */
.asystio-welcome-banner {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 2rem;
	border-radius: 8px;
	margin-bottom: 2rem;
}

.asystio-welcome-banner h2 {
	margin: 0 0 1rem;
	color: #fff;
}

.asystio-account-status {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.asystio-verified-badge {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	font-weight: 600;
	font-size: 14px;
}

.asystio-pending-badge {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: rgba(255, 183, 77, 0.3);
	border-radius: 20px;
	font-weight: 600;
	font-size: 14px;
}

.asystio-verification-note {
	margin: 0.5rem 0 0;
	font-size: 14px;
	opacity: 0.9;
}

/* Statistics Cards */
.asystio-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.asystio-stat-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	text-align: center;
}

.asystio-stat-card h3 {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
	color: #667eea;
}

.asystio-stat-card p {
	margin: 0.5rem 0 0;
	color: #6b7280;
	font-size: 14px;
}

/* Dashboard Actions */
.asystio-dashboard-actions {
	display: flex;
	gap: 1rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.asystio-button-primary {
	background: #667eea;
	color: #fff;
}

.asystio-button-primary:hover {
	background: #5568d3;
	color: #fff;
}

.asystio-button-secondary {
	background: #6b7280;
	color: #fff;
}

.asystio-button-secondary:hover {
	background: #4b5563;
	color: #fff;
}

/* Filter Tabs */
.asystio-filter-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
	border-bottom: 2px solid #e5e7eb;
}

.asystio-filter-tab {
	padding: 0.75rem 1.5rem;
	text-decoration: none;
	color: #6b7280;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s;
}

.asystio-filter-tab:hover {
	color: #667eea;
}

.asystio-filter-tab.active {
	color: #667eea;
	border-bottom-color: #667eea;
	font-weight: 600;
}

/* Ticket Table */
.asystio-ticket-table {
	width: 100%;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	border-collapse: collapse;
}

.asystio-ticket-table thead {
	background: #f9fafb;
}

.asystio-ticket-table th,
.asystio-ticket-table td {
	padding: 1rem;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.asystio-ticket-table th {
	font-weight: 600;
	color: #374151;
	font-size: 14px;
}

.asystio-ticket-table tbody tr:hover {
	background: #f9fafb;
}

.asystio-ticket-table a {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
}

.asystio-ticket-table a:hover {
	text-decoration: underline;
}

/* Status Badges */
.asystio-status-open {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	background: #d1fae5;
	color: #065f46;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
}

.asystio-status-closed {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	background: #e5e7eb;
	color: #374151;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
}

.asystio-no-tickets {
	text-align: center;
	padding: 2rem;
	color: #6b7280;
}

/* Pagination */
.asystio-pagination {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 1.5rem;
}

.asystio-page-link {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	text-decoration: none;
	color: #374151;
	transition: all 0.2s;
}

.asystio-page-link:hover {
	background: #f9fafb;
	border-color: #667eea;
	color: #667eea;
}

.asystio-page-link.active {
	background: #667eea;
	border-color: #667eea;
	color: #fff;
}

/* Ticket View */
.asystio-ticket-view {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.asystio-back-link {
	margin-bottom: 1.5rem;
}

.asystio-back-link a {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
}

.asystio-back-link a:hover {
	text-decoration: underline;
}

.asystio-ticket-header {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.asystio-ticket-header h2 {
	margin: 0 0 1rem;
}

.asystio-ticket-meta {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	font-size: 14px;
	color: #6b7280;
}

.asystio-ticket-number {
	font-weight: 600;
	color: #374151;
}

/* Original Message */
.asystio-ticket-original-message {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.asystio-message-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.asystio-message-date {
	color: #6b7280;
	font-size: 14px;
}

.asystio-message-content {
	color: #374151;
	line-height: 1.6;
}

/* Conversation Thread */
.asystio-conversation-thread {
	margin-bottom: 2rem;
}

.asystio-reply {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1rem;
}

.asystio-reply-customer {
	border-left: 3px solid #667eea;
}

.asystio-reply-admin {
	background: #eff6ff;
	border-left: 3px solid #3b82f6;
}

.asystio-reply-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.asystio-reply-author {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.asystio-admin-badge {
	display: inline-block;
	padding: 0.25rem 0.5rem;
	background: #3b82f6;
	color: #fff;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.asystio-reply-date {
	color: #6b7280;
	font-size: 14px;
}

.asystio-reply-content {
	color: #374151;
	line-height: 1.6;
}

.asystio-no-replies {
	text-align: center;
	padding: 2rem;
	color: #6b7280;
	background: #f9fafb;
	border-radius: 8px;
}

/* Reply Form */
.asystio-reply-form {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
}

.asystio-reply-form h3 {
	margin-top: 0;
}

.asystio-notice {
	padding: 1rem;
	background: #fef3c7;
	border: 1px solid #fbbf24;
	border-radius: 4px;
	color: #92400e;
	margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
	.asystio-stats {
		grid-template-columns: 1fr;
	}

	.asystio-ticket-table {
		display: block;
		overflow-x: auto;
	}

	.asystio-ticket-meta,
	.asystio-message-header,
	.asystio-reply-header {
		flex-direction: column;
		gap: 0.5rem;
	}

	.asystio-dashboard-actions {
		flex-direction: column;
	}

	.asystio-button {
		width: 100%;
		text-align: center;
	}

	.asystio-filter-tabs {
		overflow-x: auto;
	}
}


/* Ticket Filters layout */
.asystio-ticket-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.asystio-ticket-filters .asystio-input {
    min-width: 160px;
}

.asystio-ticket-filters .asystio-button {
    align-self: flex-start;
}

/* Scroll wrapper for ticket table on smaller screens */
.asystio-ticket-table-wrapper {
    margin-top: 1rem;
    overflow-x: auto;
}

/* Product badge styling */
.asystio-product-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    margin: 0 0.25rem 0.25rem 0;
    white-space: nowrap;
}

/* Enhanced empty state */
.asystio-no-tickets {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #6b7280;
}

.asystio-no-tickets p {
    margin-bottom: 1rem;
    font-size: 15px;
}

.asystio-no-tickets .asystio-button-primary {
    margin-top: 0.5rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .asystio-ticket-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .asystio-ticket-filters .asystio-input,
    .asystio-ticket-filters .asystio-button {
        width: 100%;
    }
}


/* ================================
 * Multi-License Display Styles
 * ================================ */

.asystio-primary-license {
	margin-bottom: 2rem;
}

.asystio-primary-license h3 {
	margin-top: 0;
	font-size: 18px;
	font-weight: 600;
	color: #111827;
}

.asystio-primary-license .license-card {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 20px;
}

.asystio-primary-license .license-card p {
	margin: 8px 0;
}

.asystio-primary-license .license-card code {
	background: #fff;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 13px;
}

.asystio-all-licenses {
	margin-bottom: 2rem;
}

.asystio-all-licenses h3 {
	margin-top: 0;
	font-size: 18px;
	font-weight: 600;
	color: #111827;
	margin-bottom: 1rem;
}

.asystio-licenses-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}

.asystio-licenses-table th,
.asystio-licenses-table td {
	padding: 10px;
	border: 1px solid #ddd;
	text-align: left;
}

.asystio-licenses-table th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	font-size: 14px;
}

.asystio-licenses-table tbody tr:hover {
	background: #f9fafb;
}

.asystio-licenses-table tr.primary-license {
	background-color: #e8f5e9;
}

.asystio-licenses-table tr.primary-license:hover {
	background-color: #d7f0d9;
}

.asystio-licenses-table code {
	background: #f3f4f6;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.status-active {
	color: #4caf50;
	font-weight: bold;
}

.status-expired {
	color: #f44336;
	font-weight: bold;
}

.badge {
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	display: inline-block;
}

.badge-primary {
	background-color: #4caf50;
	color: white;
}

.badge-secondary {
	background-color: #999;
	color: white;
}

.asystio-licenses-table .button-small {
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.4;
}

.asystio-notice {
	padding: 1rem;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	margin-bottom: 1.5rem;
}

.asystio-notice.notice-warning {
	background: #fff3cd;
	border-color: #ffc107;
	color: #856404;
}

.asystio-notice p {
	margin: 0.5rem 0;
}

.asystio-notice ul {
	margin: 0.75rem 0;
	padding-left: 1.5rem;
}

.asystio-notice li {
	margin: 0.5rem 0;
	line-height: 1.6;
}

.asystio-notice form {
	margin-left: 0.5rem;
}

/* Responsive for license tables */
@media (max-width: 768px) {
	.asystio-licenses-table {
		display: block;
		overflow-x: auto;
	}

	.asystio-licenses-table thead {
		display: none;
	}

	.asystio-licenses-table tbody,
	.asystio-licenses-table tr,
	.asystio-licenses-table td {
		display: block;
	}

	.asystio-licenses-table tr {
		margin-bottom: 1rem;
		border: 1px solid #ddd;
		border-radius: 4px;
		padding: 0.5rem;
	}

	.asystio-licenses-table td {
		border: none;
		padding: 0.5rem;
		text-align: left;
	}

	.asystio-licenses-table td:before {
		content: attr(data-label);
		font-weight: 600;
		display: inline-block;
		width: 120px;
	}
}


/* ================================
 * License & Support Panel (Phase 1 Hardening UI + polish)
 * ================================ */

.asystio-license-panel {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px; /* matches .asystio-stat-card */
	padding: 1.5rem;   /* matches .asystio-stat-card */
	margin: 0 0 2rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.asystio-license-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.asystio-license-panel__header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #111827;
}

.asystio-license-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
	color: #374151;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	font-size: 12px;
	cursor: pointer;
}

.asystio-license-toggle:hover {
	background: #f3f4f6;
}

.asystio-license-toggle__chevron {
	width: 10px;
	height: 10px;
	display: inline-block;
	border-right: 2px solid #6b7280;
	border-bottom: 2px solid #6b7280;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.asystio-license-toggle[aria-expanded="false"] .asystio-license-toggle__chevron {
	transform: rotate(-135deg);
}

.asystio-license-panel__body.is-collapsed {
	display: none;
}

/* Rows */
.asystio-license-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-top: 1px solid #f1f5f9;
	font-size: 14px;
	color: #374151;
}

.asystio-license-row:first-child {
	border-top: none;
	padding-top: 0;
}

.asystio-license-row strong {
	font-weight: 600;
	color: #111827;
}

.asystio-license-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 12px;
}

/* Badges */
.asystio-license-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.asystio-license-badge.active {
	background: #ecfdf5;
	color: #047857;
}

.asystio-license-badge.expired {
	background: #fef2f2;
	color: #b91c1c;
}

.asystio-license-badge.warning {
	background: #fffbeb;
	color: #b45309;
}

.asystio-license-badge.asystio-pulse {
	animation: asystioBadgePulse 0.6s ease-in-out 1;
}

@keyframes asystioBadgePulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.06); }
	100% { transform: scale(1); }
}

/* Meta */
.asystio-license-meta {
	margin-top: 0.75rem;
	font-size: 12px;
	color: #6b7280;
	display: grid;
	gap: 0.25rem;
}

/* Refresh button polish (spinner, disabled state) */
.asystio-refresh-license {
	margin-top: 1rem;
}

.asystio-license-panel .asystio-refresh-license__button {
	border: none;
	padding: 0.6rem 0.9rem;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.asystio-license-panel .asystio-refresh-license__button:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}

.asystio-license-panel .asystio-refresh-license__button.is-loading::after {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.55);
	border-top-color: rgba(255,255,255,1);
	border-radius: 999px;
	display: inline-block;
	animation: asystioSpin 0.8s linear infinite;
}

@keyframes asystioSpin {
	to { transform: rotate(360deg); }
}

/* Mobile: make it feel native and compact */
@media (max-width: 768px) {
	.asystio-license-panel {
		padding: 1rem;
	}

	.asystio-license-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.asystio-license-toggle__label {
		display: none; /* icon-only on mobile */
	}
}
