/**
 * Errand System Order Form Styles
 */

/* =============================================================================
   Order Form Container
   ============================================================================= */

.errand-order-form-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* =============================================================================
   Form Sections
   ============================================================================= */

.errand-form-section {
	margin-bottom: 30px;
	padding: 20px;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	background: #fafbfc;
	transition: all 0.3s ease;
}

.errand-form-section:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.errand-form-section .section-title {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.5rem;
	color: #0073aa;
	border-bottom: 2px solid #e1e8ed;
	padding-bottom: 10px;
}

/* =============================================================================
   Form Rows
   ============================================================================= */

.errand-form-row {
	margin-bottom: 20px;
}

.errand-form-row label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.errand-form-row input,
.errand-form-row textarea,
.errand-form-row select {
	width: 100%;
	padding: 12px;
	border: 1px solid #e1e8ed;
	border-radius: 6px;
	font-size: 16px;
	transition: border-color 0.3s ease;
	box-sizing: border-box;
}

.errand-form-row input:focus,
.errand-form-row textarea:focus,
.errand-form-row select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.errand-form-row .required {
	color: #dc3545;
}

/* =============================================================================
   Contact Methods
   ============================================================================= */

.contact-methods-row label {
	margin-bottom: 15px;
}

.contact-methods {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
}

.contact-methods .errand-form-row {
	margin-bottom: 0;
}

/* =============================================================================
   Extended Information Tabs
   ============================================================================= */

.extended-info-tabs {
	margin-top: 15px;
}

.extended-info-tabs-nav {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 0;
}

.extended-info-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px 12px;
	background: rgba(0, 115, 170, 0.05);
	border: 2px solid rgba(0, 115, 170, 0.1);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	min-height: 100px;
	position: relative;
	overflow: hidden;
}

.extended-info-tab::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, transparent, rgba(0, 115, 170, 0.6), transparent);
	transition: left 0.6s ease-out;
}

.extended-info-tab:hover:not(.disabled) {
	background: rgba(0, 115, 170, 0.08);
	border-color: rgba(0, 115, 170, 0.2);
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 115, 170, 0.15);
}

.extended-info-tab:hover:not(.disabled)::before {
	left: 100%;
}

.extended-info-tab.active {
	background: rgba(40, 167, 69, 0.1);
	border-color: rgba(40, 167, 69, 0.3);
	cursor: not-allowed;
}

.extended-info-tab.active .extended-info-tab-icon {
	color: #28a745;
}

.extended-info-tab.active .extended-info-tab-title {
	color: #28a745;
	font-weight: 600;
}

.extended-info-tab.active::after {
	content: '✓';
	position: absolute;
	top: 8px;
	right: 8px;
	width: 20px;
	height: 20px;
	background: #28a745;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: bold;
}

.extended-info-tab-icon {
	font-size: 24px;
	color: #0073aa;
	margin-bottom: 8px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
}

.extended-info-tab-icon i,
.extended-info-tab-icon span {
	font-size: inherit;
}

.extended-info-tab-title {
	font-size: 13px;
	font-weight: 500;
	color: #333;
	line-height: 1.3;
	transition: all 0.3s ease;
	text-align: center;
}

/* Responsive design for tabs */
@media (max-width: 768px) {
	.extended-info-tabs-nav {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	
	.extended-info-tab {
		padding: 16px 8px;
		min-height: 85px;
	}
	
	.extended-info-tab-icon {
		font-size: 20px;
		width: 32px;
		height: 32px;
		margin-bottom: 6px;
	}
	
	.extended-info-tab-title {
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	.extended-info-tabs-nav {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	
	.extended-info-tab {
		flex-direction: row;
		text-align: left;
		padding: 12px 16px;
		min-height: 60px;
	}
	
	.extended-info-tab-icon {
		margin-bottom: 0;
		margin-right: 12px;
		width: 28px;
		height: 28px;
		font-size: 18px;
	}
	
	.extended-info-tab-title {
		flex: 1;
		text-align: left;
	}
}

/* =============================================================================
   Extended Info Sections
   ============================================================================= */

.extended-info-section {
	background: #fff;
	border: 1px solid #e1e8ed;
	position: relative;
	overflow: hidden;
}

/* Animation states for extended info sections */
.extended-info-section.errand-section-entering {
	transform-origin: center top;
}

.extended-info-section.errand-section-exiting {
	transform-origin: center top;
}

.extended-info-section.errand-section-highlight {
	animation: errandSectionHighlight 1.5s ease-out;
}

@keyframes errandSectionHighlight {
	0% {
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	}
	15% {
		box-shadow: 0 4px 20px rgba(0, 115, 170, 0.15);
		border-color: rgba(0, 115, 170, 0.3);
	}
	100% {
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
		border-color: #e1e8ed;
	}
}

/* Subtle entrance animation for better visual feedback */
.extended-info-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, transparent, rgba(0, 115, 170, 0.6), transparent);
	transition: left 0.6s ease-out;
}

.extended-info-section.errand-section-highlight::before {
	left: 100%;
}

.extended-info-section .section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 1px solid #eee;
}

.extended-info-section .section-header h4 {
	margin: 0;
	color: #0073aa;
	font-size: 1.2rem;
}

.remove-section-button {
	padding: 8px 16px;
	background: rgba(220, 53, 69, 0.1);
	color: #dc3545;
	border: 1px solid rgba(220, 53, 69, 0.2);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.remove-section-button::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: rgba(220, 53, 69, 0.1);
	transition: left 0.3s ease;
}

.remove-section-button:hover {
	background: rgba(220, 53, 69, 0.15);
	border-color: rgba(220, 53, 69, 0.3);
	color: #c82333;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.remove-section-button:hover::before {
	left: 100%;
}

/* =============================================================================
   Form Submit
   ============================================================================= */

.errand-form-submit {
	text-align: center;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.errand-submit-btn {
	padding: 15px 40px;
	background: #28a745;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.errand-submit-btn:hover {
	background: #218838;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.errand-submit-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* =============================================================================
   Anonymous Notice
   ============================================================================= */

.errand-anonymous-notice {
	background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(6, 182, 212, 0.05));
	padding: 2rem;
	margin-bottom: 2.5rem;
	border: 1px solid #e1e8ed;
	border-radius: 8px;
	text-align: center;
	position: relative;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.errand-anonymous-notice::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #0073aa, #17a2b8);
	border-radius: 8px 8px 0 0;
}

.errand-notice-content {
	text-align: center;
}

.errand-notice-content p {
	margin: 0 0 1.5rem 0;
	color: #0c5460;
	font-weight: 500;
	font-size: 1.1rem;
}

/* Anonymous notice actions */
.errand-notice-actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.errand-notice-actions .button {
	background: rgba(37, 99, 235, 0.08) !important;
	color: #0073aa !important;
	border: 1px solid rgba(37, 99, 235, 0.2) !important;
	padding: 0.7rem 1.7rem !important;
	border-radius: 4px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	transition: all 0.3s ease !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.5rem !important;
	box-shadow: none !important;
	height: auto !important;
	min-height: 48px !important;
	box-sizing: border-box !important;
	justify-content: center !important;
	flex: 0 0 auto; /* Don't grow or shrink */
}

.errand-notice-actions .button:hover {
	background: rgba(37, 99, 235, 0.12) !important;
	border-color: rgba(37, 99, 235, 0.3) !important;
	color: #005a87 !important;
	transform: none !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.errand-notice-close {
	background: transparent;
	border: none;
	color: #999999;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
	text-decoration: underline;
	transition: opacity 0.3s ease;
	flex: 0 0 auto; /* Don't grow or shrink */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px; /* Match button height */
}

.errand-notice-actions a.errand-notice-close {
	color: #999999 !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
}

.errand-notice-actions a.errand-notice-close:hover {
	opacity: 0.7;
	color: #0073aa !important;
}

/* =============================================================================
   Error and Success Messages
   ============================================================================= */

.errand-message {
	padding: 1rem 1.5rem;
	margin: 1.5rem 0;
	border-radius: 4px;
	font-weight: 500;
	position: relative;
	animation: fadeIn 0.3s ease-out;
}

.errand-message::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	border-radius: 4px 0 0 4px;
}

.errand-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.errand-message.success::before {
	background: #28a745;
}

.errand-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f1b0b7;
}

.errand-message.error::before {
	background: #dc3545;
}

.errand-message.warning {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeaa7;
}

.errand-message.warning::before {
	background: #ffc107;
}

.errand-message.info {
	background: #cce5ff;
	color: #004085;
	border: 1px solid #99d3ff;
}

.errand-message.info::before {
	background: #17a2b8;
}

.errand-message-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: transparent;
	border: none;
	font-size: 20px;
	font-weight: bold;
	color: inherit;
	cursor: pointer;
	padding: 0;
	width: 20px;
	height: 20px;
	line-height: 1;
}

.errand-message-close:hover {
	opacity: 0.7;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =============================================================================
   Order Confirmation Styles
   ============================================================================= */

.errand-order-confirmation-container {
	max-width: 800px;
	margin: 2rem auto;
	padding: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	animation: fadeInUp 0.5s ease-out;
}

.errand-confirmation-header {
	background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
	color: white;
	padding: 2rem;
	border-radius: 8px 8px 0 0;
	text-align: center;
}

.errand-confirmation-header h2 {
	margin: 0 0 0.5rem 0;
	font-size: 1.8rem;
	font-weight: 600;
	color: white !important;
}

.errand-confirmation-header p {
	margin: 0;
	color: rgba(255, 255, 255, 0.95) !important;
	font-size: 1.1rem;
}

.errand-confirmation-content {
	padding: 2rem;
}

.confirmation-section {
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #eef2f7;
}

.confirmation-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.confirmation-section h3 {
	margin: 0 0 1rem 0;
	color: #0073aa;
	font-size: 1.3rem;
	font-weight: 600;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #e1e8ed;
}

.confirmation-row {
	display: flex;
	margin-bottom: 0.75rem;
	align-items: flex-start;
}

.confirmation-row label {
	font-weight: 600;
	color: #333;
	min-width: 150px;
	margin-right: 1rem;
	flex-shrink: 0;
}

.confirmation-row span {
	color: #555;
	line-height: 1.5;
	word-break: break-word;
}

.errand-confirmation-actions {
	padding: 1.5rem 2rem;
	background: #fafbfc;
	border-radius: 0 0 8px 8px;
	display: flex;
	gap: 1rem;
	justify-content: center;
	border-top: 1px solid #eef2f7;
}

.errand-confirmation-actions .btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
}

.errand-confirmation-actions .btn-primary {
	background: #28a745;
	color: white;
}

.errand-confirmation-actions .btn-primary:hover {
	background: #218838;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.errand-confirmation-actions .btn-secondary {
	background: #6c757d;
	color: white;
}

.errand-confirmation-actions .btn-secondary:hover {
	background: #5a6268;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.errand-confirmation-actions .btn.loading {
	position: relative;
	color: transparent;
}

.errand-confirmation-actions .btn.disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.loading-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =============================================================================
   Order Success Styles
   ============================================================================= */

.errand-order-success-container {
	max-width: 600px;
	margin: 2rem auto;
	padding: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	animation: fadeInUp 0.5s ease-out;
	text-align: center;
}

.errand-success-header {
	background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
	color: white !important;
	padding: 3rem 2rem;
	border-radius: 8px 8px 0 0;
}

.success-icon {
	width: 80px;
	height: 80px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1.5rem;
	font-size: 2.5rem;
}

.errand-success-header h2 {
	margin: 0 0 0.5rem 0;
	font-size: 2rem;
	font-weight: 600 !important;
	color: white !important;
}

.errand-success-header p {
	margin: 0;
	opacity: 0.9;
	font-size: 1.1rem;
	color: white !important;
}

.errand-success-content {
	padding: 2rem;
}

.success-message {
	background: rgba(40, 167, 69, 0.1);
	padding: 1.5rem;
	border-radius: 6px;
	margin-bottom: 2rem;
	border-left: 4px solid #28a745;
}

.success-message p {
	margin: 0;
	color: #155724;
	line-height: 1.6;
}

.success-details {
	background: #f8f9fa;
	padding: 1.5rem;
	border-radius: 6px;
	margin-bottom: 2rem;
}

.detail-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.detail-row:last-child {
	margin-bottom: 0;
}

.detail-row label {
	font-weight: 600;
	color: #333;
}

.detail-row span {
	color: #555;
}

.detail-row .order-number {
	font-weight: 700;
	color: #28a745;
	font-size: 1.1rem;
}

.order-number-container {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.copy-order-number {
	background: #0073aa;
	color: white;
	border: none;
	padding: 0.4rem 0.8rem;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.copy-order-number:hover {
	background: #005a87;
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
}

.copy-order-number.copied {
	background: #28a745;
	color: white;
}

.copy-order-number.copy-error {
	background: #dc3545;
	color: white;
}

.errand-success-actions {
	padding: 1.5rem 2rem;
	background: #fafbfc;
	border-radius: 0 0 8px 8px;
	display: flex;
	gap: 1rem;
	justify-content: center;
	border-top: 1px solid #eef2f7;
}

.errand-success-actions .btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
}

.errand-success-actions a.btn-primary {
	background: #0073aa !important;
	color: white !important;
}

.errand-success-actions .btn-primary:hover {
	background: #005a87 !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.errand-success-actions a.btn-secondary {
	background: #6c757d !important;
	color: white !important;
}

.errand-success-actions .btn-secondary:hover {
	background: #5a6268 !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
	.errand-order-form-container {
		padding: 15px;
	}
	
	.errand-form-section {
		padding: 15px;
	}
	
	.contact-methods {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	
	.extended-info-tabs-nav {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.errand-form-row input,
	.errand-form-row textarea,
	.errand-form-row select {
		font-size: 16px; /* Prevents zoom on iOS */
	}
	
	/* Anonymous notice actions on mobile */
	.errand-notice-actions {
		flex-direction: column;
		gap: 0.75rem;
	}
	
	/* Order confirmation responsive */
	.errand-order-confirmation-container,
	.errand-order-success-container {
		margin: 1rem;
		max-width: none;
	}
	
	.errand-confirmation-header,
	.errand-success-header {
		padding: 1.5rem;
	}
	
	.errand-confirmation-content,
	.errand-success-content {
		padding: 1.5rem;
	}
	
	.confirmation-row {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.confirmation-row label {
		min-width: auto;
		margin-right: 0;
		margin-bottom: 0.25rem;
	}
	
	.errand-confirmation-actions,
	.errand-success-actions {
		flex-direction: column;
		padding: 1rem;
	}
	
	.errand-confirmation-actions .btn,
	.errand-success-actions .btn {
		width: 100%;
		min-width: auto;
	}
	
	.order-number-container {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
	
	.copy-order-number {
		align-self: flex-start;
	}
}