/**
 * Public CSS for Webshot Popup.
 * Provides a responsive layout, premium aesthetics, and smooth animations.
 */

/* Overlay styling */
.webshot-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 23, 42, 0.65); /* Modern deep slate blue-dark with transparency */
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 999999; /* Ensure it is on top of everything */
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
				visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-sizing: border-box;
}

/* Overlay active state */
.webshot-popup-overlay.webshot-popup-active {
	opacity: 1;
	visibility: visible;
}

/* Modal container styling */
.webshot-popup-container {
	position: relative;
	width: 92%;
	padding: 40px 30px 30px 30px;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
	max-height: 85vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	box-sizing: border-box;
	
	/* Animation initial state: scaled down and slightly shifted down */
	transform: scale(0.92) translateY(20px);
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
				opacity 0.3s ease;
}

/* Container active state transition */
.webshot-popup-overlay.webshot-popup-active .webshot-popup-container {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* Close Button (top-right corner) */
.webshot-popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 32px;
	height: 32px;
	line-height: 30px;
	text-align: center;
	background: rgba(0, 0, 0, 0.05);
	border: none;
	border-radius: 50%;
	font-size: 24px;
	font-weight: 300;
	color: inherit;
	cursor: pointer;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
	opacity: 0.7;
	z-index: 10;
}

.webshot-popup-close:hover {
	opacity: 1;
	background-color: rgba(0, 0, 0, 0.15);
	transform: scale(1.1) rotate(90deg);
}

.webshot-popup-close:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Popup content area */
.wsp-popup-content,
.webshot-popup-content {
	font-size: 16px;
	line-height: 1.6;
	word-wrap: break-word;
}

.wsp-popup-content p:first-of-type,
.webshot-popup-content p:first-of-type {
	margin-top: 0;
}

.wsp-popup-content p:last-of-type,
.webshot-popup-content p:last-of-type {
	margin-bottom: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.webshot-popup-container {
		padding: 35px 20px 25px 20px;
		border-radius: 12px;
		width: 95%;
	}
	
	.webshot-popup-close {
		top: 10px;
		right: 10px;
		width: 28px;
		height: 28px;
		font-size: 20px;
	}
}

/* Custom Scrollbar for popup container */
.webshot-popup-container::-webkit-scrollbar {
	width: 8px;
}

.webshot-popup-container::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 10px;
}

.webshot-popup-container::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 10px;
}

.webshot-popup-container::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Contact Form Styles
   ========================================================================== */
.wsp-form-wrapper {
	width: 100%;
	margin-top: 15px;
	box-sizing: border-box;
}

.wsp-contact-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.wsp-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
}

.wsp-form-field label {
	font-size: 14px;
	font-weight: 600;
	color: inherit;
	display: block;
}

.wsp-required-star {
	color: #ef4444;
	font-weight: bold;
	margin-left: 2px;
}

.wsp-input,
.wsp-textarea,
.wsp-file-input {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.9);
	color: #1e293b;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wsp-input:focus,
.wsp-textarea:focus,
.wsp-file-input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.wsp-input.wsp-input-error,
.wsp-textarea.wsp-input-error,
.wsp-file-input.wsp-input-error {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.wsp-textarea {
	resize: vertical;
	min-height: 90px;
}

.wsp-file-hint {
	font-size: 12px;
	color: #64748b;
	margin-top: 2px;
}

.wsp-field-error {
	font-size: 12px;
	color: #ef4444;
	font-weight: 500;
	display: none;
	margin-top: 2px;
}

.wsp-form-response {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	margin-bottom: 10px;
	box-sizing: border-box;
}

.wsp-response-success {
	background-color: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.wsp-response-error {
	background-color: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.wsp-form-actions {
	margin-top: 6px;
}

.wsp-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff !important;
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wsp-submit-btn:hover {
	background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
	box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
	transform: translateY(-1px);
}

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

.wsp-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none !important;
}

.wsp-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: wsp-spin 0.8s linear infinite;
}

@keyframes wsp-spin {
	to { transform: rotate(360deg); }
}
