/* Global Vars */
.pps_page {
	--primary-color: #626ea0;
	--accent-color: #fff;
}
/* Default overrides */
.pps_page *,
.pps_page *::before,
.pps_page *::after {
	padding: 0;
	margin: 0;
}
.pps_page *:empty {
	display: block;
}
.pps_page div[data-lastpass-icon-root],
.pps_page div[data-lastpass-root] {
	display: none;
}
.pps_page .pps_heading {
	margin-bottom: 10px;
}
.pps_page hr {
	margin-bottom: 10px;
}
.pps_page .pps_button,
.pps_page a.pps_button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 75px;
	background-color: var(--primary-color);
	color: #fff;
	border-width: 0;
	border-color: transparent;
	border-radius: 5px;
	padding: 12px 22px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1em;
	text-align: center;
	cursor: pointer;
	transition: all 300ms ease-in-out;
	opacity: 0.8;
}
.pps_page .pps_button.pps_button_small {
	padding: 8px 12px;
	font-size: 12px;
}
.pps_page .pps_button:hover,
.pps_page a.pps_button:hover {
	opacity: 1;
}
.pps_page .pps_button:disabled,
.pps_page a.pps_button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

/* Form field styles */
.pps_form_wrap {
	margin-bottom: 20px;
}
.pps_form_wrap .pps_form_field {
	width: 100%;
	max-width: 100%;
	display: grid;
	grid-template-columns: 1fr;
	column-gap: 0;
	row-gap: 5px;
	margin-bottom: 10px;
}
@media screen and (min-width: 768px) {
	.pps_form_wrap .pps_form_field {
		grid-template-columns: 1fr 1fr;
		column-gap: 20px;
		row-gap: 0;
		margin-bottom: 10px;
	}
	.pps_form_wrap .pps_form_field.pps_form_field_advance {
		grid-template-columns: 1fr;
		row-gap: 5px;
		margin-bottom: 10px;
	}
}
.pps_form_field input[type='text'],
.pps_form_field input[type='email'],
.pps_form_field input[type='number'],
.pps_form_field input[type='date'],
.pps_form_field textarea,
.pps_form_field select {
	padding: 8px 14px;
	border-radius: 5px;
	max-width: 260px;
}
/* Inline hint text under a field spans the full field width so it doesn't
   disrupt the label | input two-column grid. */
.pps_form_field > small {
	grid-column: 1 / -1;
	color: #666;
	font-size: 0.85em;
	line-height: 1.4;
}
.pps_form_field.pps_form_field_group {
	width: 100%;
	max-width: 100%;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	column-gap: 5px;
	max-width: unset;
}
.pps_form_field.pps_form_field_group input,
.pps_form_field.pps_form_field_group input[type='text'],
.pps_form_field.pps_form_field_group input[type='email'],
.pps_form_field.pps_form_field_group input[type='number'],
.pps_form_field.pps_form_field_group input[type='date'],
.pps_form_field.pps_form_field_group textarea,
.pps_form_field.pps_form_field_group select {
	flex-grow: 1;
	max-width: 100%;
}
.pps_patient_select_wrap {
	padding: 20px 0;
}
.pps_form_field.pps_form_hidden {
	display: none;
}
.pps_form_field input:disabled,
.pps_form_field input[type='text']:disabled,
.pps_form_field input[type='email']:disabled,
.pps_form_field input[type='number']:disabled,
.pps_form_field input[type='date']:disabled,
.pps_form_field textarea:disabled,
.pps_form_field select:disabled {
	cursor: not-allowed;
	background-color: #eee;
	opacity: 0.8;
}
.pps_form_field .pps_form_field_checkbox_label {
	display: flex;
	flex-direction: row;
	align-items: center;
	column-gap: 5px;
}

/* Toast Styles */
#pps_toast_wrap {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: end;
}
#pps_toast_wrap .pps_toast_item {
	padding: 10px 20px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	column-gap: 10px;
	background-color: #fff;
	border-radius: 10px;
	box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.05);
}
#pps_toast_wrap .pps_toast_item .pps_toast_close {
	border: none;
	padding: 0;
	background-color: transparent;
	font-weight: bold;
	cursor: pointer;
}

/* Invite form styles */
#pps_prescriber_invite_form {
	margin-bottom: 20px;
}

/* error message styles */
.pps-error-message-wrapper {
	width: 100%;
	max-width: 100%;
	padding: 20px 10px;
	display: flex;
	flex-direction: column;
}
.pps-error-message-wrapper .pps-error-title,
.pps-error-message-wrapper .pps-error-body {
	color: rgb(202, 83, 83);
	font-weight: bold;
	line-height: 1em;
	text-align: center;
}

/* select2 styles overrides */
.pps_page .select2-container {
	width: 100% !important;
	display: table;
	table-layout: fixed;
}
.pps_page .select2-container .selection {
	flex-grow: 1;
	display: flex;
}
.pps_page .select2-container .selection .select2-selection--single {
	width: 100%;
	flex-grow: 1;
	height: unset;
	display: flex;
	align-items: center;
	margin-bottom: 0;
}
.pps_page .select2-container .selection .select2-selection--single .select2-selection__rendered {
	flex-grow: 1;
	display: flex;
	align-items: center;
	padding-top: 6px;
	padding-bottom: 6px;
}
.pps_page .select2-container .selection .select2-selection--single .select2-selection__arrow {
	flex-grow: 1;
	display: flex;
	align-items: center;
	top: 50%;
	transform: translateY(-50%);
}
@media screen and (max-width: 767px) {
	.pps_form_field input[type='text'],
	.pps_form_field input[type='email'],
	.pps_form_field input[type='number'],
	.pps_form_field input[type='date'],
	.pps_form_field textarea,
	.pps_form_field select {
		max-width: 100%;
	}
}

.pps-loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.pps-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.pps-loading-text {
    color: #666;
    font-style: italic;
}

/* Multi-Prescription Cart UI - Phase 3 */
.pps_multi_prescription_cart {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pps_multi_prescription_cart h3 {
    margin-top: 0;
    color: #333;
}

.pps_instruction {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.pps_cart_prescriptions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pps_cart_item_prescription {
    border: 2px solid #ddd;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pps_cart_item_prescription.pps_grouped {
    border-left: 5px solid #2ecc71;
    background: #f0fff4;
}

.pps_cart_item_prescription.pps_incomplete {
    border-left: 5px solid #e74c3c;
}

.pps_cart_item_info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.pps_cart_item_info strong {
    color: #333;
    font-size: 16px;
}

.pps_quantity {
    background: #e8e8e8;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.pps_checkout_fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .pps_checkout_fields {
        grid-template-columns: 1fr;
    }
}

.pps_form_field_group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pps_form_field_group label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.pps_form_field_group select {
    flex: 1;
    min-width: 200px;
}

.pps_form_field_group a.pps_button {
    margin-top: 5px;
    text-align: center;
}

.pps_prescription_preview {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    border: 2px solid #4caf50;
}

.pps_prescription_preview h4 {
    margin-top: 0;
    color: #2e7d32;
}

#pps_grouped_prescriptions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pps_prescription_group {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
}

.pps_prescription_group strong {
    color: #2e7d32;
    display: block;
    margin-bottom: 8px;
}

.pps_prescription_group ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.pps_prescription_group li {
    color: #555;
    margin: 3px 0;
}

/* Update button when prescriptions are ready */
.checkout-button.pps_ready {
    background: #4caf50 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Prescription list badges */
.pps_badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 5px;
}

.pps_badge_new {
    background: #4caf50;
    color: white;
}

.pps_badge_old {
    background: #9e9e9e;
    color: white;
}

.pps_status_badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.pps_status_pending {
    background: #fff3cd;
    color: #856404;
}

.pps_status_approved {
    background: #d4edda;
    color: #155724;
}

.pps_status_rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Mobile-responsive prescription table */
.pps_table_wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 768px) {
    #pps-prescription-table {
        font-size: 14px;
    }
    
    #pps-prescription-table th,
    #pps-prescription-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    /* Ensure patient and action columns are always visible */
    #pps-prescription-table th:nth-child(1),
    #pps-prescription-table td:nth-child(1),
    #pps-prescription-table th:nth-child(2),
    #pps-prescription-table td:nth-child(2) {
        position: sticky;
        background: #fff;
        z-index: 1;
    }
    
    #pps-prescription-table th:nth-child(1),
    #pps-prescription-table td:nth-child(1) {
        left: 0;
    }
    
    #pps-prescription-table th:nth-child(2),
    #pps-prescription-table td:nth-child(2) {
        left: auto;
    }
    
    .pps_table_wrapper::after {
        content: "← Scroll for more →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #666;
        padding: 8px;
        font-style: italic;
    }
}