/**
 * Medication Advisor - Public Styles
 *
 * Mobile-first responsive styles for the medication advisor interface.
 *
 * @package MedicationAdvisor
 * @since 1.0.0
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.mfa-advisor-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mfa-advisor-title {
	font-size: 28px;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 20px;
	text-align: center;
}

.mfa-advisor-intro {
	font-size: 16px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 25px;
	text-align: center;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.mfa-search-wrapper {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 30px;
	margin-bottom: 30px;
}

.mfa-search-form {
	position: relative;
}

.mfa-search-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.mfa-search-input {
	width: 100%;
	padding: 15px 50px 15px 20px;
	font-size: 16px;
	border: 2px solid #ddd;
	border-radius: 8px;
	transition: all 0.3s ease;
	background: #fff;
}

.mfa-search-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mfa-search-icon {
	position: absolute;
	right: 20px;
	color: #999;
	pointer-events: none;
}

.mfa-loading-spinner {
	position: absolute;
	right: 20px;
	display: flex;
	align-items: center;
}

.mfa-spinner {
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: mfa-spin 1s linear infinite;
}

@keyframes mfa-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Autocomplete Results
   ========================================================================== */

.mfa-autocomplete-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 5px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	max-height: 400px;
	overflow-y: auto;
	z-index: 1000;
}

.mfa-autocomplete-item {
	padding: 15px 20px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	transition: background-color 0.2s ease;
}

.mfa-autocomplete-item:last-child {
	border-bottom: none;
}

.mfa-autocomplete-item:hover,
.mfa-autocomplete-item.mfa-focused {
	background-color: #f5f5f5;
}

.mfa-autocomplete-item .mfa-med-name {
	display: block;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 4px;
}

.mfa-autocomplete-item .mfa-med-generic {
	display: block;
	font-size: 14px;
	color: #666;
	margin-bottom: 4px;
}

.mfa-autocomplete-item .mfa-med-class {
	display: inline-block;
	font-size: 12px;
	color: #0073aa;
	background: #e7f5fe;
	padding: 3px 8px;
	border-radius: 4px;
}

.mfa-no-results {
	padding: 20px;
	text-align: center;
	color: #999;
}

/* ==========================================================================
   Results Container
   ========================================================================== */

.mfa-results-container {
	animation: mfa-fade-in 0.4s ease;
}

@keyframes mfa-fade-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.mfa-results-content {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 30px;
}

/* ==========================================================================
   Medication Information
   ========================================================================== */

.mfa-medication-info {
	margin-bottom: 30px;
	padding-bottom: 25px;
	border-bottom: 2px solid #f0f0f0;
}

.mfa-medication-name {
	font-size: 24px;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 15px;
}

.mfa-medication-generic {
	font-size: 18px;
	font-weight: 400;
	color: #666;
}

.mfa-drug-class {
	font-size: 15px;
	color: #555;
	margin-bottom: 15px;
}

.mfa-drug-class strong {
	color: #2c3e50;
}

.mfa-dryness-reason {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 6px;
	margin: 15px 0;
}

.mfa-dryness-reason h4 {
	font-size: 16px;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 10px;
}

.mfa-dryness-reason p {
	font-size: 15px;
	line-height: 1.6;
	color: #555;
	margin: 0;
}

.mfa-recommended-category {
	font-size: 15px;
	color: #555;
	margin-top: 15px;
}

.mfa-recommended-category strong {
	color: #2c3e50;
}

/* ==========================================================================
   FDA Verification Badge
   ========================================================================== */

.mfa-fda-verification {
	background: #f0f6fc;
	border: 1px solid #c8dff0;
	border-radius: 6px;
	padding: 15px;
	margin: 15px 0;
}

.mfa-fda-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 8px;
}

.mfa-fda-badge svg {
	width: 16px;
	height: 16px;
}

.mfa-fda-badge.mfa-verified {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.mfa-fda-badge.mfa-partial {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeaa7;
}

.mfa-fda-badge.mfa-no-data {
	background: #e2e3e5;
	color: #383d41;
	border: 1px solid #d6d8db;
}

.mfa-verification-text {
	font-size: 13px;
	line-height: 1.5;
	color: #555;
	margin: 8px 0 0 0;
}

.mfa-recommended-category strong {
	color: #2c3e50;
}

/* ==========================================================================
   Products Section
   ========================================================================== */

.mfa-products-section {
	margin-bottom: 30px;
}

.mfa-products-title {
	font-size: 20px;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 20px;
}

.mfa-products-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.mfa-product-card {
	position: relative;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
	transition: box-shadow 0.3s ease;
	overflow: visible;
}

.mfa-product-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Best Seller Badge */
.mfa-best-seller-badge {
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	border-left: 80px solid #d32f2f;
	border-bottom: 80px solid transparent;
	z-index: 10;
	border-top-left-radius: 12px;
}

.mfa-best-seller-badge span {
	position: absolute;
	top: 10px;
	left: -70px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1.2;
	width: 50px;
	text-align: center;
}

.mfa-product-image {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0;
}

.mfa-product-image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
}

.mfa-product-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-align: left;
}

.mfa-product-category {
	font-size: 14px;
	color: #666;
	font-weight: 500;
	margin: 0;
}

.mfa-product-name {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.mfa-product-name a {
	color: #2c3e50;
	text-decoration: none;
	transition: color 0.2s ease;
}

.mfa-product-name a:hover {
	color: #0073aa;
}

.mfa-product-description {
	display: none;
}

.mfa-product-price {
	font-size: 20px;
	font-weight: 700;
	color: #2c3e50;
	margin: 0;
}

.mfa-product-price del {
	color: #999;
	font-size: 16px;
	margin-right: 8px;
}

.mfa-product-quantity {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mfa-quantity-label {
	font-size: 14px;
	color: #666;
	font-weight: 500;
}

.mfa-quantity-controls {
	display: flex;
	align-items: center;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

.mfa-qty-btn {
	background: #fff;
	border: none;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 600;
	color: #2c3e50;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.mfa-qty-btn:hover {
	background: #f5f5f5;
}

.mfa-qty-input {
	width: 60px;
	height: 40px;
	border: none;
	border-left: 1px solid #e0e0e0;
	border-right: 1px solid #e0e0e0;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	color: #2c3e50;
}

.mfa-product-actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	margin-top: 4px;
}

.mfa-add-to-cart {
	background: #7c4dff;
	color: #fff;
	padding: 12px 28px;
	border-radius: 8px;
	text-decoration: none;
	text-align: center;
	font-weight: 600;
	font-size: 15px;
	transition: background-color 0.3s ease;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.mfa-add-to-cart:hover {
	background: #6a3de8;
	color: #fff;
}

.mfa-add-to-cart svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.mfa-view-product {
	color: #0073aa;
	text-decoration: none;
	text-align: center;
	padding: 10px 16px;
	font-weight: 500;
	font-size: 14px;
	transition: color 0.2s ease;
}

.mfa-view-product:hover {
	color: #005a87;
	text-decoration: underline;
}

.mfa-no-products {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 6px;
	padding: 20px;
	text-align: center;
	color: #856404;
    margin-bottom: 10px;
}

/* ==========================================================================
   Disclaimer
   ========================================================================== */

.mfa-disclaimer {
	background: #f0f4f8;
	border-left: 4px solid #0073aa;
	padding: 20px;
	border-radius: 6px;
	margin-bottom: 20px;
}

.mfa-disclaimer p {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 10px 0;
}

.mfa-disclaimer p:last-child {
	margin-bottom: 0;
}

.mfa-disclaimer strong {
	color: #2c3e50;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.mfa-result-actions {
	text-align: center;
	margin-top: 20px;
}

.mfa-new-search {
	background: #f0f0f0;
	color: #2c3e50;
	padding: 12px 30px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.mfa-new-search:hover {
	background: #e0e0e0;
}

.mfa-download-pdf {
	background: #fff;
	color: #0073aa;
	padding: 12px 30px;
	border: 2px solid #0073aa;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
	margin-left: 10px;
}

.mfa-download-pdf:hover {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.mfa-loading-message {
	text-align: center;
	padding: 60px 20px;
}

.mfa-loading-message .mfa-spinner {
	width: 40px;
	height: 40px;
	border-width: 4px;
	margin: 0 auto 20px;
}

.mfa-loading-message p {
	font-size: 16px;
	color: #666;
}

.mfa-error-message {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 8px;
	padding: 30px;
	text-align: center;
}

.mfa-error-message p {
	color: #721c24;
	font-size: 16px;
	margin-bottom: 20px;
}

/* ==========================================================================
   Tablet Styles (768px and up)
   ========================================================================== */

@media screen and (min-width: 768px) {
	.mfa-advisor-container {
		padding: 30px;
	}

	.mfa-advisor-title {
		font-size: 32px;
	}

	.mfa-products-grid {
		grid-template-columns: 1fr;
	}

	.mfa-product-image {
		width: 150px;
		height: 150px;
	}
}

/* ==========================================================================
   Desktop Styles (1024px and up)
   ========================================================================== */

@media screen and (min-width: 1024px) {
	.mfa-advisor-container {
		max-width: 900px;
		padding: 40px;
	}

	.mfa-search-wrapper {
		padding: 40px;
	}

	.mfa-results-content {
		padding: 40px;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	/* Hide interactive elements */
	.mfa-search-wrapper,
	.mfa-result-actions,
	.mfa-add-to-cart,
	.mfa-view-product {
		display: none !important;
	}

	/* Reset container */
	.mfa-advisor-container {
		max-width: 100%;
		padding: 15px;
	}

	.mfa-results-content {
		padding: 0;
		border: none;
		box-shadow: none;
	}

	/* Optimize medication info section */
	.mfa-medication-info {
		margin-bottom: 15px;
		padding-bottom: 15px;
	}

	.mfa-medication-name {
		font-size: 20px;
		margin-bottom: 10px;
		page-break-after: avoid;
	}

	.mfa-medication-generic {
		font-size: 14px;
	}

	.mfa-drug-class {
		font-size: 13px;
		margin-bottom: 10px;
	}

	.mfa-dryness-reason {
		padding: 12px;
		margin: 10px 0;
		page-break-inside: avoid;
	}

	.mfa-dryness-reason h4 {
		font-size: 14px;
		margin-bottom: 6px;
	}

	.mfa-dryness-reason p {
		font-size: 13px;
		line-height: 1.4;
	}

	.mfa-recommended-category {
		font-size: 13px;
		margin-top: 10px;
	}

	/* FDA verification - compact */
	.mfa-fda-verification {
		padding: 10px;
		margin: 10px 0;
		page-break-inside: avoid;
	}

	.mfa-fda-badge {
		font-size: 11px;
		padding: 4px 8px;
	}

	.mfa-verification-text {
		font-size: 11px;
	}

	/* Products section - compact grid */
	.mfa-products-section {
		margin-bottom: 15px;
	}

	.mfa-products-title {
		font-size: 16px;
		margin-bottom: 12px;
		page-break-after: avoid;
	}

	.mfa-products-grid {
		display: grid;
		grid-template-columns: 1fr;
		gap: 12px;
		page-break-inside: avoid;
	}

	.mfa-product-card {
		padding: 10px;
		page-break-inside: avoid;
		border: 1px solid #ddd;
		display: flex;
		flex-direction: row;
		gap: 10px;
	}

	.mfa-best-seller-badge {
		display: none;
	}

	.mfa-product-image {
		width: 80px;
		height: 80px;
		margin-bottom: 0;
	}

	.mfa-product-image img {
		max-width: 100%;
		max-height: 80px;
		width: auto;
		height: auto;
		object-fit: contain;
	}

	.mfa-product-category {
		font-size: 11px;
	}

	.mfa-product-name {
		font-size: 13px;
		margin-bottom: 4px;
	}

	.mfa-product-price {
		font-size: 14px;
		margin-bottom: 0;
	}

	.mfa-product-quantity,
	.mfa-product-actions {
		display: none;
	}

	.mfa-product-description {
		display: none;
	}

	/* Disclaimer - compact */
	.mfa-disclaimer {
		padding: 12px;
		margin-bottom: 0;
		page-break-inside: avoid;
		background: #f9f9f9 !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.mfa-disclaimer p {
		font-size: 11px;
		line-height: 1.4;
		margin: 0 0 6px 0;
	}

	/* General print optimizations */
	body {
		background: #fff;
		color: #000;
	}

	* {
		box-shadow: none !important;
	}

	/* Ensure single page */
	@page {
		margin: 0.5in;
		size: letter;
	}
}
