/**
 * Enhanced CSS for Form UX/UI Improvements
 * Adds modern, polished styles to the PR form
 */

/* ====================================
   ENHANCED FIELD STYLING
   ==================================== */

/* Floating label effect for inputs */
.form-group-enhanced {
	position: relative;
	margin-bottom: 24px;
}

.form-group-enhanced input,
.form-group-enhanced select,
.form-group-enhanced textarea {
	padding: 14px 16px 6px 16px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group-enhanced label {
	position: absolute;
	left: 16px;
	top: 12px;
	font-size: 14px;
	color: var(--gray-500);
	pointer-events: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: white;
	padding: 0 4px;
}

.form-group-enhanced input:focus + label,
.form-group-enhanced select:focus + label,
.form-group-enhanced textarea:focus + label,
.form-group-enhanced input:not(:placeholder-shown) + label,
.form-group-enhanced select:not([value=""]) + label,
.form-group-enhanced textarea:not(:placeholder-shown) + label {
	top: -8px;
	left: 12px;
	font-size: 11px;
	color: var(--primary);
	font-weight: 600;
}

/* Input focus glow effect */
input:focus,
select:focus,
textarea:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(0, 200, 81, 0.15), 0 4px 12px rgba(0, 200, 81, 0.08);
	transform: translateY(-1px);
}

/* ====================================
   WIZARD STEP ENHANCEMENTS
   ==================================== */

.wizard-step-circle {
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-step-circle:hover {
	transform: scale(1.15);
	box-shadow: 0 4px 12px rgba(0, 200, 81, 0.3);
}

.wizard-step.active .wizard-step-circle {
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(0, 200, 81, 0.5);
	}
	50% {
		box-shadow: 0 0 0 10px rgba(0, 200, 81, 0);
	}
}

/* ====================================
   BUTTON ENHANCEMENTS
   ==================================== */

.btn {
	position: relative;
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.btn:active::before {
	width: 300px;
	height: 300px;
}

.btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
	transform: translateY(0);
}

/* ====================================
   ITEM CARD ENHANCEMENTS
   ==================================== */

.item-card {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.item-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform 0.3s ease;
}

.item-card:hover::before {
	transform: scaleY(1);
	transform-origin: top;
}

.item-card:hover {
	transform: translateX(4px);
	box-shadow: 0 8px 24px rgba(0, 200, 81, 0.15);
}

/* ====================================
   BOQ COMPONENT ENHANCEMENTS
   ==================================== */

.boq-component {
	transition: all 0.3s ease;
	position: relative;
}

.boq-component:hover {
	background: linear-gradient(90deg, rgba(0, 200, 81, 0.02) 0%, rgba(0, 188, 212, 0.02) 100%);
	transform: scale(1.01);
}

.boq-component::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
	transform: scaleX(0);
	transition: transform 0.3s ease;
}

.boq-component:hover::after {
	transform: scaleX(1);
}

/* ====================================
   LOADING STATES
   ==================================== */

.btn-loading {
	pointer-events: none;
	opacity: 0.7;
	position: relative;
}

.btn-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	margin-left: -8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

/* ====================================
   TOOLTIP ENHANCEMENTS
   ==================================== */

[data-tooltip] {
	position: relative;
	cursor: help;
}

[data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	padding: 8px 12px;
	background: var(--gray-900);
	color: white;
	font-size: 12px;
	white-space: nowrap;
	border-radius: 6px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s, transform 0.3s;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]::after {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--gray-900);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s, transform 0.3s;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}

/* ====================================
   FORM SECTION ANIMATIONS
   ==================================== */

.form-section-enter {
	animation: formSectionEnter 0.4s ease;
}

@keyframes formSectionEnter {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ====================================
   DRAG & DROP ZONES (Future Enhancement)
   ==================================== */

.drop-zone {
	border: 2px dashed var(--gray-300);
	border-radius: var(--border-radius);
	padding: 40px;
	text-align: center;
	transition: all 0.3s ease;
	background: var(--gray-50);
}

.drop-zone:hover,
.drop-zone.drag-over {
	border-color: var(--primary);
	background: rgba(0, 200, 81, 0.05);
	transform: scale(1.02);
}

.drop-zone.drag-over {
	box-shadow: 0 0 20px rgba(0, 200, 81, 0.2);
}

/* ====================================
   SUCCESS CHECKMARKS
   ==================================== */

.success-checkmark {
	display: inline-block;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 4px solid var(--success);
	position: relative;
	animation: successCheckmarkScale 0.3s ease;
}

.success-checkmark::after {
	content: '';
	position: absolute;
	top: 20px;
	left: 16px;
	width: 12px;
	height: 24px;
	border: solid var(--success);
	border-width: 0 4px 4px 0;
	transform: rotate(45deg);
	animation: successCheckmarkDraw 0.3s ease 0.1s forwards;
	opacity: 0;
}

@keyframes successCheckmarkScale {
	from {
		transform: scale(0);
	}
	to {
		transform: scale(1);
	}
}

@keyframes successCheckmarkDraw {
	to {
		opacity: 1;
	}
}

/* ====================================
   IMPROVED EMPTY STATES
   ==================================== */

.empty-state-enhanced {
	text-align: center;
	padding: 60px 24px;
	color: var(--gray-500);
	animation: fadeIn 0.4s ease;
}

.empty-state-enhanced i {
	font-size: 64px;
	margin-bottom: 20px;
	color: var(--gray-300);
	animation: float 3s ease-in-out infinite;
}

@keyframes float {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.empty-state-enhanced h3 {
	font-size: 20px;
	margin-bottom: 12px;
	color: var(--gray-700);
	font-weight: 700;
}

.empty-state-enhanced p {
	font-size: 14px;
	margin: 0 0 24px 0;
	line-height: 1.6;
}

/* ====================================
   MICRO-INTERACTIONS
   ==================================== */

.clickable-icon {
	transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
	cursor: pointer;
}

.clickable-icon:hover {
	transform: scale(1.2) rotate(5deg);
	color: var(--primary);
}

.clickable-icon:active {
	transform: scale(0.95);
}

/* ====================================
   FOCUS RING ENHANCEMENT
   ==================================== */

*:focus-visible {
	outline: 3px solid var(--primary);
	outline-offset: 2px;
	border-radius: 4px;
}

button:focus-visible,
.btn:focus-visible {
	outline: 3px solid rgba(0, 200, 81, 0.5);
	outline-offset: 3px;
}

/* ====================================
   SMOOTH SCROLL
   ==================================== */

html {
	scroll-behavior: smooth;
}

/* Scroll padding to account for fixed headers */
html {
	scroll-padding-top: 100px;
}

/* ====================================
   IMPROVED MODAL ANIMATIONS
   ==================================== */

.modal {
	animation: modalBackdropFadeIn 0.3s ease;
}

.modal .dialog {
	animation: modalContentSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalBackdropFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes modalContentSlideIn {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* ====================================
   COLLAPSIBLE SECTIONS
   ==================================== */

.collapsible-section {
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.collapsible-section.collapsed {
	max-height: 0 !important;
}

.collapsible-toggle {
	transition: transform 0.3s ease;
}

.collapsible-toggle.collapsed {
	transform: rotate(-90deg);
}

/* ====================================
   NUMBER INPUT SPINNERS
   ==================================== */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	opacity: 0;
	transition: opacity 0.2s;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button,
input[type="number"]:focus::-webkit-inner-spin-button,
input[type="number"]:focus::-webkit-outer-spin-button {
	opacity: 1;
}

/* ====================================
   IMPROVED CHECKBOX & RADIO
   ==================================== */

input[type="checkbox"],
input[type="radio"] {
	width: 20px;
	height: 20px;
	cursor: pointer;
	accent-color: var(--primary);
	transition: transform 0.2s ease;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
	transform: scale(1.1);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
	animation: checkboxBounce 0.3s ease;
}

@keyframes checkboxBounce {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.2);
	}
}

/* ====================================
   BADGE ANIMATIONS
   ==================================== */

.badge-animated {
	animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 0 0 rgba(0, 200, 81, 0.4);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 0 0 6px rgba(0, 200, 81, 0);
	}
}

/* ====================================
   RESPONSIVE ENHANCEMENTS
   ==================================== */

@media (max-width: 768px) {
	.form-grid {
		grid-template-columns: 1fr !important;
	}
	
	.wizard-steps {
		overflow-x: auto;
		scrollbar-width: thin;
	}
	
	[data-tooltip]::before {
		left: auto;
		right: 0;
		transform: translateX(0) translateY(-8px);
	}
	
	[data-tooltip]:hover::before {
		transform: translateX(0) translateY(-4px);
	}
}

/* ====================================
   DARK MODE SUPPORT (FUTURE)
   ==================================== */

@media (prefers-color-scheme: dark) {
	/* Dark mode styles can be added here in the future */
}

/* ====================================
   PRINT STYLES
   ==================================== */

@media print {
	.wizard-steps,
	.wizard-footer,
	.btn,
	.modal-close {
		display: none !important;
	}
	
	.wizard-content {
		max-height: none !important;
		overflow: visible !important;
	}
	
	.modal .dialog {
		box-shadow: none !important;
		border: 1px solid var(--gray-300) !important;
	}
}

