/**
 * Product Subscribe - Header and Modal Styles
 *
 * Styles for the subscribe header widget and subscription modal.
 *
 * @package Changeloger_Pro
 */

/* ========== Subscribe Header ========== */

.cha-subscribe-header {
	max-width: 1200px;
	margin: 20px auto 0;
	padding: 0 12px;
}

.cha-subscribe-header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 20px 28px;
	background: color-mix(in srgb, var(--changeloger_brand_color) 10%, transparent);
	border:1px solid color-mix(in srgb, var(--changeloger_brand_color) 10%, transparent);
	border-radius: 12px;
}

.cha-subscribe-header-text {
	flex: 1;
	min-width: 0;
}

.cha-subscribe-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
}

.cha-subscribe-title svg {
	color: #6366f1;
	flex-shrink: 0;
}

.cha-subscribe-subtitle {
	margin: 0;
	font-size: 14px;
	color: #6b7280;
	line-height: 1.5;
}

/* Header Action Container */

.cha-subscribe-header-action {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.cha-subscribe-btn{
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
	background: var(--changeloger_brand_color);
    color: #fff;
    transition: all 0.2s;
}

.cha-subscribe-btn:hover {
    background: color-mix(in srgb, var(--changeloger_brand_color) 90%, #fff);
    color: #fff;
}

.cha-subscribe-btn .cha-spinner{
	width: 20px;
    height: 20px;
	margin: 0 auto 0;
}
/* RSS Feed Button */

.cha-rss-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
	background:transparent;
	color: var(--cha-hub-text-muted);
	text-decoration: none;
}

.cha-rss-btn:hover {
	transform: translateY(-1px);
	color: var(--cha-hub-text);
	text-decoration: none;
	background-color: #e2e8f0;
}

.cha-rss-btn:active {
	transform: translateY(0);
}

.cha-rss-btn svg {
	flex-shrink: 0;
}

/* ========== Subscribe Modal ========== */

.cha-subscribe-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	animation: chaModalFadeIn 0.2s ease;
}

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

@keyframes chaModalSlideUp {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.cha-subscribe-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: 20px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.08);
	animation: chaModalSlideUp 0.3s ease;
	overflow: hidden;
}

/* Modal Close Button */

.cha-subscribe-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.2);
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	transition: all 0.15s ease;
}

.cha-subscribe-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
	color: #ffffff;
}

/* Modal Header */

.cha-subscribe-modal-header {
	padding: 32px 28px 24px;
	background: var(--changeloger_brand_color);
	text-align: center;
}

.cha-subscribe-modal-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 14px;
	color: #ffffff;
}

.cha-subscribe-modal-title {
	margin: 0 0 4px;
	font-size: 20px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
}

.cha-subscribe-modal-product {
	margin: 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.75);
}

/* Modal Form */

.cha-subscribe-form {
	padding: 28px;
}

.cha-subscribe-field {
	margin-bottom: 16px;
}

.cha-subscribe-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.cha-subscribe-field input[type="text"],
.cha-subscribe-field input[type="email"] {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	color: #111827;
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.cha-subscribe-field input[type="text"]:focus,
.cha-subscribe-field input[type="email"]:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.cha-subscribe-field input[type="text"]::placeholder,
.cha-subscribe-field input[type="email"]::placeholder {
	color: #9ca3af;
}

/* Submit Button */

.cha-subscribe-form-actions {
	margin-top: 20px;
}

.cha-subscribe-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	background: var(--changeloger_brand_color);
	color: #ffffff;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.cha-subscribe-submit:hover {
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.cha-subscribe-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.cha-subscribe-submit-loading {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* Spinner Animation */

.cha-spinner {
	animation: chaSpinnerRotate 1s linear infinite;
}

@keyframes chaSpinnerRotate {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Message Feedback */

.cha-subscribe-message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.cha-subscribe-message--success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.cha-subscribe-message--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Privacy Notice */

.cha-subscribe-privacy {
	margin: 0;
	padding: 0 28px 24px;
	font-size: 12px;
	color: #9ca3af;
	text-align: center;
	line-height: 1.5;
}

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

@media (max-width: 640px) {
	.cha-subscribe-header-content {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		gap: 16px;
		padding: 20px;
	}

	.cha-subscribe-header-action {
		display: flex;
		justify-content: center;
	}

	.cha-subscribe-modal {
		max-width: calc(100% - 32px);
		margin: 16px;
	}

	.cha-subscribe-form {
		padding: 20px;
	}

	.cha-subscribe-privacy {
		padding: 0 20px 20px;
	}
}
