/**
 * Content Gatekeeper Public Styles
 * Full-screen overlay version with theme inheritance
 *
 * @package Content_Gatekeeper
 */

/* ==========================================
   Gate Overlay - FULL SCREEN (Default)
   ========================================== */

.cg-gate-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: none;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.cg-gate-overlay.cg-gate-visible {
	display: block;
}

/* Background layer */
.cg-gate-overlay-bg {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

/* Content container */
.cg-gate-content-wrapper {
	position: relative;
	z-index: 2;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

/* ==========================================
   Gate Overlay - INLINE (Scroll Trigger)
   ========================================== */

.cg-gate-overlay.cg-trigger-scroll {
	position: relative;
	height: auto;
	min-height: 60vh;
	overflow: visible;
}

.cg-gate-overlay.cg-trigger-scroll .cg-gate-overlay-bg {
	position: absolute;
}

.cg-gate-overlay.cg-trigger-scroll .cg-gate-content-wrapper {
	min-height: 60vh;
	padding: 60px 20px;
}

/* ==========================================
   Gate Style: Blurred
   ========================================== */

.cg-gate-style-blurred .cg-gate-overlay-bg {
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
}

/* ==========================================
   Gate Style: Dark Overlay
   ========================================== */

.cg-gate-style-overlay .cg-gate-overlay-bg {
	background: rgba(0, 0, 0, 0.95);
}

.cg-gate-style-overlay .cg-gate-form-container {
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.cg-gate-style-overlay .cg-form-title,
.cg-gate-style-overlay .cg-form-description {
	color: #fff;
}

.cg-gate-style-overlay .cg-form-field label {
	color: #e0e0e0;
}

.cg-gate-style-overlay .cg-form-field input,
.cg-gate-style-overlay .cg-form-field textarea,
.cg-gate-style-overlay .cg-form-field select {
	background: rgba(255,255,255,0.1);
	border-color: rgba(255,255,255,0.3);
	color: #fff;
}

.cg-gate-style-overlay .cg-form-field input::placeholder {
	color: rgba(255,255,255,0.5);
}

.cg-gate-style-overlay .cg-gdpr-field .cg-checkbox-label span {
	color: #e0e0e0;
}

/* ==========================================
   Gate Style: Gradient Fade
   ========================================== */

.cg-gate-style-gradient .cg-gate-overlay-bg {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cg-gate-style-gradient .cg-gate-form-container {
	background: rgba(255,255,255,0.95);
	backdrop-filter: blur(10px);
}

.cg-gate-style-gradient .cg-form-title,
.cg-gate-style-gradient .cg-form-description {
	color: #333;
}

.cg-gate-style-gradient .cg-form-field label {
	color: #333;
}

.cg-gate-style-gradient .cg-form-field input,
.cg-gate-style-gradient .cg-form-field textarea,
.cg-gate-style-gradient .cg-form-field select {
	color: #333;
}

.cg-gate-style-gradient .cg-gdpr-field .cg-checkbox-label span {
	color: #333;
}

/* ==========================================
   Form Container - Inherits from Theme
   ========================================== */

.cg-gate-form-container {
	max-width: 500px;
	width: 100%;
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);

	/* Inherit theme colors */
	background: inherit;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.cg-gate-style-blurred .cg-gate-form-container,
.cg-gate-style-gradient .cg-gate-form-container {
	background: #ffffff;
	color: inherit;
}

.cg-form-title {
	margin: 0 0 10px 0;
	font-size: 28px;
	font-weight: bold;
	text-align: center;

	/* Inherit from theme headings */
	font-family: inherit;
	color: inherit;
}

.cg-form-description {
	margin: 0 0 30px 0;
	font-size: 16px;
	text-align: center;
	line-height: 1.5;
	opacity: 0.8;

	/* Inherit from theme */
	font-family: inherit;
	color: inherit;
}

/* ==========================================
   Form Fields - Theme Inheritance
   ========================================== */

.cg-gate-form {
	width: 100%;
}

.cg-form-field {
	margin-bottom: 20px;
}

.cg-form-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;

	/* Inherit from theme */
	font-family: inherit;
	color: inherit;
}

.cg-form-field input[type="text"],
.cg-form-field input[type="email"],
.cg-form-field input[type="tel"],
.cg-form-field input[type="url"],
.cg-form-field textarea,
.cg-form-field select {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 15px;
	transition: all 0.3s ease;
	box-sizing: border-box;

	/* Inherit from theme */
	font-family: inherit;
	background: #fff;
	color: inherit;
}

.cg-form-field input:focus,
.cg-form-field textarea:focus,
.cg-form-field select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.cg-form-field textarea {
	min-height: 100px;
	resize: vertical;
}

.cg-form-field input::placeholder {
	color: #999;
	opacity: 1;
}

/* Checkbox and Radio Styles */
.cg-checkbox-label,
.cg-radio-label {
	display: flex;
	align-items: flex-start;
	cursor: pointer;
	user-select: none;
	font-family: inherit;
	color: inherit;
}

.cg-checkbox-label input[type="checkbox"],
.cg-radio-label input[type="radio"] {
	margin-right: 10px;
	margin-top: 2px;
	width: auto;
	cursor: pointer;
}

.cg-gdpr-field {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #e0e0e0;
}

.cg-gdpr-field .cg-checkbox-label span {
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.8;
}

/* ==========================================
   Submit Button - Customizable
   ========================================== */

.cg-submit-btn {
	width: 100%;
	padding: 14px 28px;
	background: #667eea;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 10px;
	font-family: inherit;
}

.cg-submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

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

.cg-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ==========================================
   Messages
   ========================================== */

.cg-form-messages {
	margin: 15px 0;
}

.cg-message {
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	font-family: inherit;
}

.cg-message-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.cg-message-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================
   WooCommerce Purchase Link
   ========================================== */

.cg-woocommerce-purchase {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 1px solid #e0e0e0;
	text-align: center;
}

.cg-purchase-message {
	margin-bottom: 15px;
	font-size: 14px;
	opacity: 0.8;
}

.cg-purchase-btn {
	display: inline-block;
	padding: 12px 24px;
	background: #28a745;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	transition: all 0.3s ease;
	font-family: inherit;
}

.cg-purchase-btn:hover {
	background: #218838;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(40,167,69,0.3);
	color: #fff;
	text-decoration: none;
}

/* ==========================================
   Close Button (Optional)
   ========================================== */

.cg-close-btn {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(0,0,0,0.5);
	color: #fff;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 3;
}

.cg-close-btn:hover {
	background: rgba(0,0,0,0.8);
	transform: rotate(90deg);
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
	.cg-gate-form-container {
		padding: 30px 20px;
		max-width: 100%;
		margin: 20px;
	}

	.cg-form-title {
		font-size: 24px;
	}

	.cg-form-description {
		font-size: 15px;
	}

	.cg-gate-content-wrapper {
		padding: 20px 10px;
	}
}

@media (max-width: 480px) {
	.cg-gate-form-container {
		padding: 20px 15px;
		margin: 10px;
	}

	.cg-form-title {
		font-size: 20px;
	}

	.cg-submit-btn {
		padding: 12px 20px;
		font-size: 15px;
	}
}

/* ==========================================
   Animations
   ========================================== */

@keyframes cgFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes cgSlideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cg-gate-visible {
	animation: cgFadeIn 0.3s ease forwards;
}

.cg-gate-visible .cg-gate-form-container {
	animation: cgSlideUp 0.5s ease forwards;
}

/* ==========================================
   Custom Field Styles
   ========================================== */

.cg-custom-field {
	margin-bottom: 20px;
}

.cg-custom-field select {
	appearance: none;
	background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%207l5%205%205-5z%22%20fill%3D%22%23666%22%2F%3E%3C%2Fsvg%3E');
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 40px;
}

/* ==========================================
   Accessibility
   ========================================== */

.cg-gate-form *:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.cg-gate-form input[type="checkbox"]:focus,
.cg-gate-form input[type="radio"]:focus {
	outline-offset: 1px;
}

/* Screen reader only text */
.cg-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border-width: 0;
}

/* ==========================================
   Prevent body scroll when overlay is open
   ========================================== */

body.cg-overlay-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
}

/* ==========================================
   Downloads Section
   ========================================== */

.cg-downloads {
	margin: 40px 0;
	padding: 30px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 2px solid #e0e0e0;
}

.cg-downloads h3 {
	margin: 0 0 20px 0;
	font-size: 22px;
	font-weight: 600;
	color: inherit;
	font-family: inherit;
}

.cg-download-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.cg-download-list li {
	margin: 10px 0;
}

.cg-download-link {
	display: inline-flex;
	align-items: center;
	padding: 12px 20px;
	background: #fff;
	border: 2px solid #667eea;
	border-radius: 6px;
	color: #667eea;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.3s ease;
	font-family: inherit;
}

.cg-download-link::before {
	content: "\2B07";
	margin-right: 10px;
	font-size: 16px;
}

.cg-download-link:hover {
	background: #667eea;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
	text-decoration: none;
}

@media (max-width: 768px) {
	.cg-downloads {
		padding: 20px 15px;
		margin: 30px 0;
	}

	.cg-downloads h3 {
		font-size: 18px;
	}

	.cg-download-link {
		padding: 10px 16px;
		font-size: 14px;
	}
}
