/* ==========================================================================
   Campus Element — GDPR Consent
   Base styles for builder previews and frontend GDPR consent box.
   ========================================================================== */


/* --------------------------------------------------------------------------
   BUILDER: Toolbox Card Preview
   -------------------------------------------------------------------------- */

.cp-ffb-card-preview-gdpr {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 12px;
	background: var(--cp-theme-input-bg, #f9fafb);
	border: 1px solid var(--cp-theme-border, #e5e7eb);
	border-radius: var(--cp-theme-radius, 6px);
	min-height: 36px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cp-theme-text-secondary, #64748b);
}

.cp-ffb-card-preview-gdpr .dashicons-lock {
	font-size: 18px;
	width: 18px;
	height: 18px;
}


/* --------------------------------------------------------------------------
   BUILDER: Grid Preview — GDPR Box
   -------------------------------------------------------------------------- */

.cp-ffb-grid-gdpr-box {
	padding: 12px;
	background: var(--cp-theme-input-bg-alt, #f8fafc);
	border: 1px solid var(--cp-theme-border, #e5e7eb);
	border-radius: 8px;
}

.cp-ffb-grid-gdpr-header {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cp-theme-text, #374151);
	margin-bottom: 8px;
}

.cp-ffb-grid-gdpr-header .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--cp-theme-accent, #3b82f6);
}

.cp-ffb-grid-gdpr-purpose {
	font-size: 13px;
	color: var(--cp-theme-text-secondary, #64748b);
	line-height: 1.5;
	margin: 0 0 10px 0;
}

.cp-ffb-grid-gdpr-box .cp-ffb-grid-checkbox-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	color: var(--cp-theme-text, #374151);
	margin-bottom: 8px;
	cursor: default;
}

.cp-ffb-grid-gdpr-box .cp-ffb-grid-checkbox-item:last-of-type {
	margin-bottom: 0;
}

.cp-ffb-grid-gdpr-box .cp-ffb-grid-checkbox-item input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	flex-shrink: 0;
	accent-color: var(--cp-theme-accent, #3b82f6);
}

.cp-ffb-grid-consent-link {
	color: var(--cp-theme-accent, #3b82f6);
	text-decoration: underline;
}

.cp-ffb-grid-consent-link--button,
.cp-ffb-grid-consent-link--icon-button {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid var(--cp-theme-accent, #3b82f6);
	border-radius: 999px;
	text-decoration: none;
	font-size: 11px;
	margin-left: 6px;
}

.cp-ffb-grid-consent-link--icon-button::before {
	content: '🔗';
	margin-right: 4px;
}

.cp-ffb-grid-gdpr-select-all {
	margin-bottom: 8px;
	padding: 4px 10px;
	border: 1px solid var(--cp-theme-accent, #3b82f6);
	border-radius: 999px;
	background: #fff;
	color: var(--cp-theme-accent, #3b82f6);
	font-size: 12px;
	font-weight: 600;
}

.cp-ffb-grid-checkbox-item--toggle .cp-ffb-grid-gdpr-input {
	appearance: none;
	width: 28px;
	height: 16px;
	border-radius: 999px;
	background: #cbd5e1;
	border: none;
	position: relative;
}

.cp-ffb-grid-checkbox-item--toggle .cp-ffb-grid-gdpr-input::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
}

.cp-ffb-grid-gdpr-size--small .cp-ffb-grid-checkbox-item { font-size: 12px; }
.cp-ffb-grid-gdpr-size--large .cp-ffb-grid-checkbox-item { font-size: 15px; }

.cp-ffb-grid-gdpr-style--banner {
	border-left: 4px solid var(--cp-theme-accent, #3b82f6);
}

.cp-ffb-grid-gdpr-style--legal {
	background: #fff;
	border-style: dashed;
}

.cp-ffb-grid-gdpr-style--highlighted {
	background: #ecfdf5;
	border-color: #86efac;
}

/* ==========================================================================
   GDPR Consent — Builder Settings (Modern UX)
   ========================================================================== */

.cp-ffb-gdpr-settings {
	width: 100%;
	min-width: 0;
}

/* Full width when GDPR is the primary config panel */
.cp-ffb-ribbon-field-options--gdpr_consent .cp-ffb-section {
	flex: 1 1 100%;
	min-width: 100%;
}

.cp-ffb-gdpr-settings .cp-ffb-section-body {
	padding: 0;
}

.cp-ffb-gdpr-settings-inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 16px;
}

/* Quick preset bar */
.cp-ffb-gdpr-preset-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.cp-ffb-gdpr-preset-label {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	margin: 0;
}

.cp-ffb-gdpr-preset-select {
	flex: 1;
	min-width: 0;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 500;
	color: #1e293b;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cp-ffb-gdpr-preset-select:hover {
	border-color: #cbd5e1;
}

.cp-ffb-gdpr-preset-select:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Consent items list */
.cp-ffb-gdpr-items-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cp-ffb-gdpr-item-card {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cp-ffb-gdpr-item-card:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cp-ffb-gdpr-item-card-content {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex: 1;
	min-width: 0;
}

.cp-ffb-gdpr-item-index {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	background: #f1f5f9;
	border-radius: 6px;
}

.cp-ffb-gdpr-item-card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cp-ffb-gdpr-item-label {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.4;
	display: block;
}

.cp-ffb-gdpr-item-desc {
	font-size: 12px;
	color: #64748b;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cp-ffb-gdpr-item-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.cp-ffb-gdpr-badge {
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 6px;
	letter-spacing: 0.02em;
}

.cp-ffb-gdpr-badge.is-required {
	background: #dcfce7;
	color: #166534;
}

.cp-ffb-gdpr-badge.is-optional {
	background: #f1f5f9;
	color: #475569;
}

.cp-ffb-gdpr-badge.is-link {
	background: #eff6ff;
	color: #1d4ed8;
}

.cp-ffb-gdpr-item-card-actions {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.cp-ffb-gdpr-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 6px;
	color: #64748b;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cp-ffb-gdpr-icon-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.cp-ffb-gdpr-icon-btn:hover {
	background: #f1f5f9;
	color: #1e293b;
}

.cp-ffb-gdpr-icon-btn.is-danger:hover {
	background: #fef2f2;
	color: #dc2626;
}

/* Add item button */
.cp-ffb-gdpr-add-item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 16px;
	background: transparent;
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s ease;
}

.cp-ffb-gdpr-add-item:hover {
	border-color: #3b82f6;
	color: #3b82f6;
	background: rgba(59, 130, 246, 0.04);
}

.cp-ffb-gdpr-add-icon {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Modal */
.cp-ffb-gdpr-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100200;
	padding: 24px;
	animation: cp-ffb-gdpr-backdrop-in 0.2s ease;
}

@keyframes cp-ffb-gdpr-backdrop-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.cp-ffb-gdpr-modal {
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 48px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
	border: 1px solid #e2e8f0;
	animation: cp-ffb-gdpr-modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cp-ffb-gdpr-modal-in {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(-8px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.cp-ffb-gdpr-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 20px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.cp-ffb-gdpr-modal-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #0f172a;
	letter-spacing: -0.02em;
}

.cp-ffb-gdpr-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 8px;
	color: #64748b;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cp-ffb-gdpr-modal-close .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.cp-ffb-gdpr-modal-close:hover {
	background: #f1f5f9;
	color: #1e293b;
}

.cp-ffb-gdpr-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.cp-ffb-gdpr-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cp-ffb-gdpr-form-group.cp-ffb-gdpr-form-row {
	flex-direction: row;
	gap: 12px;
}

.cp-ffb-gdpr-form-group.cp-ffb-gdpr-form-row .cp-ffb-gdpr-form-field {
	flex: 1;
	min-width: 0;
}

.cp-ffb-gdpr-form-label {
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin: 0;
}

.cp-ffb-gdpr-form-optional {
	font-weight: 400;
	color: #94a3b8;
}

.cp-ffb-gdpr-form-input,
.cp-ffb-gdpr-form-textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	color: #1e293b;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
}

.cp-ffb-gdpr-form-input::placeholder,
.cp-ffb-gdpr-form-textarea::placeholder {
	color: #94a3b8;
}

.cp-ffb-gdpr-form-input:hover,
.cp-ffb-gdpr-form-textarea:hover {
	border-color: #cbd5e1;
}

.cp-ffb-gdpr-form-input:focus,
.cp-ffb-gdpr-form-textarea:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cp-ffb-gdpr-form-textarea {
	resize: vertical;
	min-height: 72px;
}

.cp-ffb-gdpr-form-checkbox {
	margin-top: 4px;
}

.cp-ffb-gdpr-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #475569;
}

.cp-ffb-gdpr-checkbox-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 2px 0 0 0;
	flex-shrink: 0;
	accent-color: #3b82f6;
}

.cp-ffb-gdpr-checkbox-text {
	line-height: 1.5;
}

.cp-ffb-gdpr-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 20px 20px;
	border-top: 1px solid #f1f5f9;
	background: #fafbfc;
}

.cp-ffb-gdpr-btn {
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
	font-family: inherit;
	border: none;
}

.cp-ffb-gdpr-btn-secondary {
	background: #fff;
	color: #475569;
	border: 1px solid #e2e8f0;
}

.cp-ffb-gdpr-btn-secondary:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
}

.cp-ffb-gdpr-btn-primary {
	background: #3b82f6;
	color: #fff;
}

.cp-ffb-gdpr-btn-primary:hover {
	background: #2563eb;
}

.cp-ffb-grid-gdpr-note {
	font-size: 12px;
	color: var(--cp-theme-muted, #64748b);
	line-height: 1.4;
	margin: 10px 0 0 0;
}


/* --------------------------------------------------------------------------
   FRONTEND: GDPR Consent Wrapper
   -------------------------------------------------------------------------- */

.cp-el-gdpr-consent {
	position: relative;
	width: 100%;
}

.cp-el-gdpr-consent .cp-field-label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cp-theme-label, #334155);
	line-height: 1.4;
}

.cp-el-gdpr-consent .cp-field-required {
	color: var(--cp-theme-danger, #ef4444);
	margin-left: 2px;
}


/* --------------------------------------------------------------------------
   FRONTEND: GDPR Box
   -------------------------------------------------------------------------- */

.cp-el-gdpr-consent .cp-gdpr-box {
	padding: 16px;
	background: var(--cp-theme-input-bg-alt, #f8fafc);
	border: 1px solid var(--cp-theme-border, #e5e7eb);
	border-radius: 8px;
}

.cp-el-gdpr-consent .cp-gdpr-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cp-theme-text, #1e293b);
	margin-bottom: 12px;
}

.cp-el-gdpr-consent .cp-gdpr-header .dashicons-lock {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: var(--cp-theme-accent, #3b82f6);
}

.cp-el-gdpr-consent .cp-gdpr-purpose {
	font-size: 14px;
	color: var(--cp-theme-text-secondary, #64748b);
	line-height: 1.5;
	margin: 0 0 12px 0;
}

.cp-el-gdpr-consent .cp-gdpr-retention,
.cp-el-gdpr-consent .cp-gdpr-controller {
	font-size: 13px;
	color: var(--cp-theme-text-secondary, #64748b);
	margin: 0 0 12px 0;
}


/* --------------------------------------------------------------------------
   FRONTEND: Consent Checkbox Items
   -------------------------------------------------------------------------- */

.cp-el-gdpr-consent .cp-gdpr-item {
	margin-bottom: 12px;
}

.cp-el-gdpr-consent .cp-gdpr-item:last-of-type {
	margin-bottom: 0;
}

.cp-el-gdpr-consent .cp-gdpr-item-wrap {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
}

.cp-el-gdpr-consent .cp-gdpr-item-wrap input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 2px 0 0 0;
	flex-shrink: 0;
	accent-color: var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
}

.cp-el-gdpr-consent .cp-gdpr-item-wrap .cp-gdpr-item-label {
	font-size: 15px;
	line-height: 1.5;
	color: var(--cp-theme-text, #1e293b);
}

.cp-el-gdpr-consent .cp-gdpr-item-label a {
	color: var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
	text-decoration: underline;
}

.cp-el-gdpr-consent .cp-gdpr-accept-all {
	margin: 0 0 12px;
	padding: 6px 12px;
	border: 1px solid var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
	border-radius: 999px;
	background: #fff;
	color: var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.cp-el-gdpr-consent.cp-gdpr-link-button .cp-gdpr-privacy-link,
.cp-el-gdpr-consent.cp-gdpr-link-icon-button .cp-gdpr-privacy-link {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
	border-radius: 999px;
	text-decoration: none;
	margin-left: 6px;
	font-size: 12px;
}

.cp-el-gdpr-consent.cp-gdpr-link-icon-button .cp-gdpr-privacy-link::before {
	content: '\f103';
	font-family: dashicons;
	margin-right: 4px;
}

.cp-el-gdpr-consent.cp-gdpr-input-toggle .cp-gdpr-item-wrap input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.cp-el-gdpr-consent .cp-gdpr-toggle-ui {
	position: relative;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background-color 0.15s ease;
}

.cp-el-gdpr-consent .cp-gdpr-toggle-knob {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
	transition: transform 0.15s ease;
}

.cp-el-gdpr-consent.cp-gdpr-input-toggle .cp-gdpr-item-wrap input[type="checkbox"]:checked + .cp-gdpr-toggle-ui {
	background: var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
}

.cp-el-gdpr-consent.cp-gdpr-input-toggle .cp-gdpr-item-wrap input[type="checkbox"]:checked + .cp-gdpr-toggle-ui .cp-gdpr-toggle-knob {
	transform: translateX(16px);
}

.cp-el-gdpr-consent.cp-gdpr-size-small .cp-gdpr-item-label { font-size: 13px; }
.cp-el-gdpr-consent.cp-gdpr-size-large .cp-gdpr-item-label { font-size: 16px; }

.cp-el-gdpr-consent.cp-gdpr-style-banner .cp-gdpr-box {
	border-left: 4px solid var(--cp-gdpr-accent, var(--cp-theme-accent, #3b82f6));
}

.cp-el-gdpr-consent.cp-gdpr-style-legal .cp-gdpr-box {
	background: #fff;
	border-style: dashed;
}

.cp-el-gdpr-consent.cp-gdpr-style-highlighted .cp-gdpr-box {
	background: #ecfdf5;
	border-color: #86efac;
}

.cp-el-gdpr-consent .cp-gdpr-item .cp-gdpr-item-desc {
	display: block;
	font-size: 13px;
	color: var(--cp-theme-muted, #64748b);
	margin-top: 4px;
	line-height: 1.4;
}


/* --------------------------------------------------------------------------
   FRONTEND: Withdrawal Notice
   -------------------------------------------------------------------------- */

.cp-el-gdpr-consent .cp-gdpr-withdrawal {
	display: block;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--cp-theme-border, #e5e7eb);
	font-size: 13px;
	color: var(--cp-theme-muted, #64748b);
	line-height: 1.5;
}


/* --------------------------------------------------------------------------
   FRONTEND: Description & Error
   -------------------------------------------------------------------------- */

.cp-el-gdpr-consent .cp-field-desc {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: var(--cp-theme-muted, #64748b);
	line-height: 1.5;
}

.cp-el-gdpr-consent .cp-field-error {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--cp-theme-danger, #ef4444);
	line-height: 1.4;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.cp-el-gdpr-consent .cp-gdpr-box {
		padding: 12px;
	}

	.cp-el-gdpr-consent .cp-gdpr-item {
		gap: 10px;
	}
}
