/* ==========================================================================
   Dope Premium Widget Styling (WooCommerce Product Verification)
   ========================================================================== */

.dpv-widget-container {
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 20px 0;
	box-sizing: border-box;
}

.dpv-widget-card {
	width: 100%;
	max-width: 650px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 40px;
	position: relative;
	overflow: hidden;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
	box-sizing: border-box;
}

/* Gray badge curve in top right corner */
.dpv-badge-circle {
	position: absolute;
	top: -40px;
	right: -40px;
	width: 120px;
	height: 120px;
	background: #f1f5f9;
	border-radius: 50%;
	z-index: 1;
}

.dpv-widget-content {
	position: relative;
	z-index: 2;
}

.dpv-title {
	font-family: inherit;
	font-size: 28px;
	font-weight: 700;
	color: #09152b;
	text-align: center;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}

.dpv-description {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.6;
	color: #475569;
	text-align: center;
	margin: 0 0 32px;
}

.dpv-verification-form {
	margin-bottom: 0;
}

.dpv-field-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 20px;
	text-align: left;
}

.dpv-field-row label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #09152b;
	margin: 0;
	display: block;
}

.dpv-input-field {
	width: 100%;
	height: 48px;
	background: #f4f5fa;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 0 16px;
	font-family: monospace;
	font-size: 15px;
	color: #0f172a;
	transition: all 0.25s ease;
	box-sizing: border-box;
}

.dpv-input-field::placeholder {
	color: #94a3b8;
}

.dpv-input-field:focus {
	border-color: #3b82f6;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
	outline: none;
}

/* Verify Button */
.dpv-submit-btn {
	width: 100%;
	height: 48px;
	background: #09152b;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	transition: all 0.25s ease;
	box-sizing: border-box;
}

.dpv-submit-btn:hover {
	background: #1e293b;
	transform: translateY(-1px);
}

.dpv-submit-btn:active {
	transform: translateY(0);
}

/* Spinner Icon */
.dpv-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top: 2px solid #ffffff;
	border-radius: 50%;
	animation: dpv-spin 0.8s linear infinite;
}

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

/* Response Cards styling */
.dpv-response-container {
	margin-top: 24px;
	animation: dpv-fade-in 0.3s ease;
}

.dpv-result-card {
	padding: 20px;
	border-radius: 8px;
	text-align: left;
	display: flex;
	gap: 16px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	align-items: flex-start;
}

/* Success Card */
.dpv-result-success {
	background: #f0fdf4;
	border-left: 4px solid #22c55e;
	border-top: 1px solid #dcfce7;
	border-right: 1px solid #dcfce7;
	border-bottom: 1px solid #dcfce7;
}

/* Warning Card */
.dpv-result-warning {
	background: #fffbeb;
	border-left: 4px solid #f59e0b;
	border-top: 1px solid #fef9c3;
	border-right: 1px solid #fef9c3;
	border-bottom: 1px solid #fef9c3;
}

/* Error Card */
.dpv-result-error {
	background: #fef2f2;
	border-left: 4px solid #ef4444;
	border-top: 1px solid #fee2e2;
	border-right: 1px solid #fee2e2;
	border-bottom: 1px solid #fee2e2;
	color: #991b1b;
}

.dpv-result-error-content {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	font-size: 14px;
}

.dpv-result-error-content .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #ef4444;
}

/* Response Inner Grid Layout */
.dpv-result-image {
	width: 60px;
	height: 60px;
	border-radius: 6px;
	border: 1px solid #cbd5e1;
	object-fit: cover;
	flex-shrink: 0;
}

.dpv-result-info {
	flex-grow: 1;
}

.dpv-result-status-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.dpv-result-success .dpv-result-status-title {
	color: #166534;
}

.dpv-result-warning .dpv-result-status-title {
	color: #92400e;
}

.dpv-result-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 10px;
	margin-top: 12px;
	font-size: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
	padding-top: 12px;
}

.dpv-result-grid-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dpv-result-grid-item span {
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 0.03em;
}

.dpv-result-grid-item strong {
	color: #1e293b;
	font-size: 13px;
}

.dpv-result-warning-message {
	margin-top: 12px;
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
	color: #b45309;
	background: rgba(245, 158, 11, 0.08);
	padding: 10px 14px;
	border-radius: 6px;
	border: 1px solid rgba(245, 158, 11, 0.15);
}

/* COA Button */
.dpv-coa-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	background: #3b82f6;
	color: #ffffff !important;
	border-radius: 6px;
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.dpv-coa-btn:hover {
	background: #2563eb;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

.dpv-coa-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

@keyframes dpv-fade-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Dope Premium Widget Styling (COA Hub)
   ========================================================================== */

.dpv-coa-hub-container {
	width: 100%;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	padding: 24px;
	box-sizing: border-box;
}

.dpv-coa-hub-inner {
	display: flex;
	gap: 32px;
}

/* Sidebar Columns */
.dpv-coa-hub-sidebar {
	width: 240px;
	flex-shrink: 0;
	border-right: 1px solid #f1f5f9;
	padding-right: 20px;
}

.dpv-coa-hub-sidebar-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #64748b;
	margin: 0 0 16px;
	border-bottom: 1px solid #f1f5f9;
	padding-bottom: 8px;
}

.dpv-coa-hub-tabs {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.dpv-coa-hub-tab-btn {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	background: transparent;
	border: none;
	border-left: 3px solid transparent;
	padding: 10px 14px;
	text-align: left;
	font-size: 14px;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	transition: all 0.2s ease;
	border-radius: 0 6px 6px 0;
}

.dpv-coa-hub-tab-btn:hover {
	background: #f8fafc;
	color: #0f172a;
}

.dpv-coa-hub-tab-btn.dpv-active {
	background: rgba(59, 130, 246, 0.06);
	color: #3b82f6;
	border-left-color: #3b82f6;
}

.dpv-tab-count {
	font-size: 10px;
	background: #f1f5f9;
	color: #475569;
	padding: 2px 6px;
	border-radius: 12px;
	font-weight: 700;
}

.dpv-coa-hub-tab-btn.dpv-active .dpv-tab-count {
	background: #3b82f6;
	color: #ffffff;
}

/* Content Area */
.dpv-coa-hub-content {
	flex-grow: 1;
	min-width: 0;
}

.dpv-coa-hub-panel {
	animation: dpv-fade-in 0.25s ease;
}

/* Empty states */
.dpv-coa-hub-empty-state {
	text-align: center;
	padding: 40px 20px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	color: #64748b;
}

.dpv-coa-hub-empty-state .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	margin-bottom: 12px;
}

.dpv-coa-panel-empty {
	padding: 20px;
	background: #f8fafc;
	border-radius: 8px;
	color: #64748b;
	text-align: center;
}

/* Sub-tabs for products in sidebar (desktop) */
.dpv-coa-hub-subtabs {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px 0 10px 16px;
	border-left: 1px dashed #cbd5e1;
	margin: 6px 0 6px 14px;
	box-sizing: border-box;
}

.dpv-coa-hub-subtab-btn {
	display: flex;
	align-items: center;
	width: 100%;
	background: transparent;
	border: none;
	padding: 8px 12px;
	text-align: left;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s ease;
	border-radius: 6px;
	box-sizing: border-box;
}

.dpv-coa-hub-subtab-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	margin-right: 8px;
	color: #94a3b8;
	transition: color 0.2s ease;
}

.dpv-coa-hub-subtab-btn:hover {
	background: #f8fafc;
	color: #0f172a;
}

.dpv-coa-hub-subtab-btn:hover .dashicons {
	color: #475569;
}

.dpv-coa-hub-subtab-btn.dpv-active {
	background: rgba(59, 130, 246, 0.05);
	color: #3b82f6;
	font-weight: 600;
}

.dpv-coa-hub-subtab-btn.dpv-active .dashicons {
	color: #ef4444; /* PDF red brand color */
}

/* PDF Embedded Viewer */
.dpv-coa-hub-pdf-viewer {
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	overflow: hidden;
	background: #f8fafc;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.dpv-coa-hub-pdf-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 20px;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	gap: 16px;
}

.dpv-coa-hub-pdf-info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.dpv-coa-hub-pdf-info .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #3b82f6;
	flex-shrink: 0;
}

.dpv-p-details {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dpv-p-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dpv-p-sku {
	font-size: 11px;
	color: #64748b;
	margin-top: 2px;
}

.dpv-coa-hub-pdf-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.dpv-coa-hub-pdf-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none !important;
	transition: all 0.2s ease;
	cursor: pointer;
}

.dpv-coa-hub-pdf-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.dpv-coa-hub-pdf-btn-secondary {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: #475569 !important;
}

.dpv-coa-hub-pdf-btn-secondary:hover {
	background: #f1f5f9;
	color: #0f172a !important;
}

.dpv-coa-hub-pdf-btn-primary {
	background: #3b82f6;
	border: 1px solid transparent;
	color: #ffffff !important;
}

.dpv-coa-hub-pdf-btn-primary:hover {
	background: #2563eb;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

.dpv-coa-hub-pdf-frame-wrapper {
	position: relative;
	width: 100%;
	background: #f1f5f9;
}

.dpv-coa-hub-pdf-frame {
	background: #ffffff;
	display: block;
	transition: opacity 0.2s ease;
}

/* Fallback Document Screen (primarily on mobile/tablet) */
.dpv-coa-hub-pdf-fallback {
	display: none;
	padding: 48px 24px;
	text-align: center;
	background: #ffffff;
}

.dpv-coa-hub-pdf-fallback > .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: #ef4444;
	margin-bottom: 16px;
}

.dpv-coa-hub-pdf-fallback h4 {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 8px;
}

.dpv-coa-hub-pdf-fallback p {
	font-size: 13px;
	color: #64748b;
	max-width: 400px;
	margin: 0 auto 24px;
	line-height: 1.5;
}

.dpv-fallback-actions {
	display: flex;
	justify-content: center;
	gap: 10px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
	.dpv-coa-hub-container {
		padding: 16px;
	}

	.dpv-coa-hub-inner {
		flex-direction: column;
		gap: 20px;
	}

	.dpv-coa-hub-sidebar {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #f1f5f9;
		padding-right: 0;
		padding-bottom: 16px;
	}

	.dpv-coa-hub-tabs {
		flex-direction: column;
		gap: 10px;
	}

	.dpv-coa-hub-tab-btn {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-left: 3px solid transparent;
		border-bottom: none;
		border-radius: 6px;
		margin-right: 0;
		padding: 12px 16px;
		background: #f8fafc;
	}

	.dpv-coa-hub-tab-btn.dpv-active {
		border-left-color: #3b82f6;
		border-bottom-color: transparent;
		background: rgba(59, 130, 246, 0.06);
		color: #3b82f6;
	}

	/* Sub-tabs strip on mobile: layouts horizontally below horizontal tabs */
	.dpv-coa-hub-subtabs {
		display: flex !important; /* Force display flex for mobile strip layout */
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 8px;
		padding: 8px 0;
		margin: 8px 0 12px 0;
		border-left: none;
		border-top: 1px dashed #cbd5e1;
		width: 100%;
	}

	/* Hide subtabs of inactive categories on mobile */
	.dpv-coa-hub-category-group:not(.dpv-active-group) .dpv-coa-hub-subtabs {
		display: none !important;
	}

	.dpv-coa-hub-subtabs::-webkit-scrollbar {
		height: 3px;
	}
	.dpv-coa-hub-subtabs::-webkit-scrollbar-thumb {
		background: #cbd5e1;
		border-radius: 3px;
	}

	.dpv-coa-hub-subtab-btn {
		width: auto;
		flex-shrink: 0;
		white-space: nowrap;
		background: #ffffff;
		border: 1px solid #cbd5e1;
		border-radius: 16px;
		padding: 6px 12px;
	}

	.dpv-coa-hub-subtab-btn.dpv-active {
		background: rgba(59, 130, 246, 0.05);
		border-color: #3b82f6;
		color: #3b82f6;
	}

	.dpv-coa-hub-pdf-toolbar {
		flex-direction: column;
		align-items: flex-start;
		padding: 14px 16px;
		gap: 12px;
	}

	.dpv-coa-hub-pdf-actions {
		width: 100%;
		flex-direction: column;
		gap: 8px;
	}

	.dpv-coa-hub-pdf-btn {
		width: 100%;
		justify-content: center;
		padding: 10px 16px;
		box-sizing: border-box;
	}

	/* Hide iframe and show fallback downloader on mobile devices */
	.dpv-coa-hub-pdf-frame {
		display: none !important;
	}

	.dpv-coa-hub-pdf-fallback {
		display: block !important;
	}

	.dpv-fallback-actions {
		flex-direction: column;
		align-items: center;
		gap: 8px;
		width: 100%;
	}

	.dpv-fallback-actions .dpv-coa-hub-pdf-btn {
		width: 100%;
		max-width: 280px;
		justify-content: center;
		box-sizing: border-box;
	}
}
