/**
 * Israeli Privacy Consent – Banner Templates
 * סגנונות ספציפיים לתבניות הבאנר השונות
 *
 * @package IsraeliPrivacyConsent
 * @version 2.0.0
 *
 * תבניות: classic, popup, bar, sidebar, minimal
 * + קטגוריות, אנימציות, כפתור צף (FAB), רספונסיבי
 */

/* ==========================================================================
   1. תבנית קלאסית (Classic) – כרטיסיית צד
   ========================================================================== */

.ipc-template-classic {
	max-width: var(--ipc-max-width, 420px);
	width: 90%;
	padding: 22px 24px 18px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* מיקום - ימין למטה */
.ipc-template-classic.ipc-position-bottom-right {
	bottom: 20px;
	right: 20px;
}

/* מיקום - שמאל למטה */
.ipc-template-classic.ipc-position-bottom-left {
	bottom: 20px;
	left: 20px;
}

/* מיקום - ימין למעלה */
.ipc-template-classic.ipc-position-top-right {
	top: 20px;
	right: 20px;
}

/* מיקום - שמאל למעלה */
.ipc-template-classic.ipc-position-top-left {
	top: 20px;
	left: 20px;
}

/* גריד כפתורים */
.ipc-template-classic .ipc-banner-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 8px;
	margin-top: 12px;
}

/* ==========================================================================
   2. תבנית פופאפ (Popup) – חלון מרכזי עם overlay
   ========================================================================== */

.ipc-template-popup {
	max-width: 520px;
	width: 90%;
	padding: 30px 28px 24px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	box-shadow: 0 8px 40px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* מיקום מרכזי */
.ipc-template-popup.ipc-position-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* אייקון מעל התוכן */
.ipc-banner-icon {
	text-align: center;
	margin-bottom: 16px;
	color: var(--ipc-primary-btn-bg, #0EA5A0);
}

.ipc-banner-icon svg {
	width: 48px;
	height: 48px;
}

/* כותרת ממורכזת בפופאפ */
.ipc-template-popup .ipc-banner-content {
	text-align: center;
}

.ipc-template-popup .ipc-banner-content h4 {
	text-align: center;
}

.ipc-template-popup .ipc-banner-content p {
	text-align: center;
}

/* כפתורים בפופאפ */
.ipc-template-popup .ipc-banner-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 16px;
}

.ipc-template-popup .ipc-btn-link {
	grid-column: 1 / -1;
	text-align: center;
}

/* שכבת Overlay */
.ipc-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 99998;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ipc-overlay.ipc-overlay-visible {
	opacity: 1;
}

/* ==========================================================================
   3. תבנית בר (Bar) – פס מלא ברוחב המסך
   ========================================================================== */

.ipc-template-bar {
	left: 0;
	right: 0;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	padding: 0;
	box-shadow: 0 -2px 15px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* מיקום למטה */
.ipc-template-bar.ipc-position-bottom-full {
	bottom: 0;
}

/* מיקום למעלה */
.ipc-template-bar.ipc-position-top-full {
	top: 0;
	box-shadow: 0 2px 15px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* שורה פנימית - תוכן וכפתורים */
.ipc-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 14px 24px;
}

.ipc-template-bar .ipc-banner-content {
	flex: 1;
	margin-bottom: 0;
}

.ipc-template-bar .ipc-banner-content p {
	margin: 0;
}

.ipc-template-bar .ipc-banner-content p a {
	color: var(--ipc-primary-btn-bg, #0EA5A0);
	text-decoration: underline;
	margin-right: 8px;
}

/* כפתורים בבר */
.ipc-template-bar .ipc-banner-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* אזור קטגוריות מתרחב בבר */
.ipc-bar-categories {
	border-top: 1px solid rgba(128, 128, 128, 0.2);
	padding: 12px 0;
}

.ipc-bar-categories .ipc-bar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.ipc-bar-categories .ipc-category-item {
	border-bottom: none;
	padding: 4px 0;
}

/* ==========================================================================
   4. תבנית סיידבר (Sidebar) – פאנל צד מלא בגובה
   ========================================================================== */

.ipc-template-sidebar {
	top: 0;
	bottom: 0;
	width: 380px;
	max-width: 90vw;
	height: 100vh;
	border-radius: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 25px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
	overflow: hidden;
}

/* סיידבר מימין */
.ipc-template-sidebar.ipc-sidebar-right {
	right: 0;
}

/* סיידבר משמאל */
.ipc-template-sidebar.ipc-sidebar-left {
	left: 0;
	box-shadow: 4px 0 25px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* כותרת הסיידבר */
.ipc-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid rgba(128, 128, 128, 0.15);
	flex-shrink: 0;
}

.ipc-sidebar-header h4 {
	margin: 0;
	font-size: calc(var(--ipc-font-size, 14px) + 4px);
	font-weight: 700;
	color: var(--ipc-title-color, #1B2B5B);
}

.ipc-sidebar-header .ipc-close-btn {
	position: static;
	padding: 4px 8px;
}

/* גוף הסיידבר - גלילה */
.ipc-sidebar-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 22px;
	-webkit-overflow-scrolling: touch;
}

.ipc-sidebar-body > p {
	margin: 0 0 16px;
	color: var(--ipc-text-color, #333333);
	line-height: 1.7;
}

/* סרגל גלילה מעוצב */
.ipc-sidebar-body::-webkit-scrollbar {
	width: 5px;
}

.ipc-sidebar-body::-webkit-scrollbar-track {
	background: transparent;
}

.ipc-sidebar-body::-webkit-scrollbar-thumb {
	background-color: rgba(128, 128, 128, 0.3);
	border-radius: 10px;
}

/* פוטר הסיידבר - כפתורים קבועים */
.ipc-sidebar-footer {
	padding: 16px 22px;
	border-top: 1px solid rgba(128, 128, 128, 0.15);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ipc-sidebar-footer .ipc-btn {
	width: 100%;
}

/* קישור פרטיות בסיידבר */
.ipc-privacy-sidebar-link {
	display: block;
	text-align: center;
	color: var(--ipc-text-color, #333333);
	font-size: calc(var(--ipc-font-size, 14px) - 1px);
	text-decoration: underline;
	opacity: 0.7;
	padding: 4px 0;
	transition: opacity 0.2s ease;
}

.ipc-privacy-sidebar-link:hover {
	opacity: 1;
}

/* ==========================================================================
   5. תבנית מינימלית (Minimal) – שורה קומפקטית
   ========================================================================== */

.ipc-template-minimal {
	left: 0;
	right: 0;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	padding: 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

.ipc-template-minimal.ipc-position-bottom-full {
	bottom: 0;
}

.ipc-template-minimal.ipc-position-top-full {
	top: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, calc(var(--ipc-shadow-opacity, 15) / 100));
}

/* שורה פנימית */
.ipc-minimal-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 24px;
}

/* טקסט */
.ipc-minimal-text {
	flex: 1;
	font-size: var(--ipc-font-size, 14px);
	color: var(--ipc-text-color, #333333);
}

.ipc-minimal-text a {
	color: var(--ipc-primary-btn-bg, #0EA5A0);
	text-decoration: underline;
	margin-right: 6px;
}

/* כפתורים */
.ipc-minimal-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ==========================================================================
   6. קטגוריות עוגיות (משותף)
   ========================================================================== */

.ipc-categories {
	margin: 12px 0;
	padding: 0;
}

.ipc-category-item {
	padding: 10px 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.ipc-category-item:last-child {
	border-bottom: none;
}

/* תווית הקטגוריה עם מתג */
.ipc-category-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

/* שם הקטגוריה */
.ipc-category-name {
	font-weight: 600;
	font-size: var(--ipc-font-size, 14px);
	color: var(--ipc-text-color, #333333);
	flex: 1;
}

/* תיאור קטגוריה */
.ipc-category-desc {
	margin: 4px 0 0;
	padding-right: 52px;
	font-size: calc(var(--ipc-font-size, 14px) - 2px);
	color: var(--ipc-text-color, #333333);
	opacity: 0.65;
	line-height: 1.5;
}

/* תגית "תמיד פעיל" */
.ipc-category-badge {
	display: inline-block;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 600;
	color: var(--ipc-primary-btn-bg, #0EA5A0);
	background-color: rgba(14, 165, 160, 0.1);
	border-radius: 20px;
	white-space: nowrap;
	line-height: 1.4;
}

/* --- מתג Toggle (switch) לקטגוריות --- */

/* הסתרת הצ'קבוקס המקורי */
.ipc-category-label input[type="checkbox"] {
	position: relative;
	appearance: none;
	-webkit-appearance: none;
	width: 42px;
	height: 22px;
	min-width: 42px;
	background-color: #cbd5e1;
	border-radius: 22px;
	cursor: pointer;
	transition: background-color 0.25s ease;
	outline: none;
	border: none;
	flex-shrink: 0;
}

/* המחוון (thumb) */
.ipc-category-label input[type="checkbox"]::before {
	content: '';
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	background-color: #ffffff;
	border-radius: 50%;
	transition: transform 0.25s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* מצב פעיל (checked) */
.ipc-category-label input[type="checkbox"]:checked {
	background-color: var(--ipc-primary-btn-bg, #0EA5A0);
}

.ipc-category-label input[type="checkbox"]:checked::before {
	transform: translateX(-20px);
}

/* מצב disabled (עוגיות חיוניות) */
.ipc-category-label input[type="checkbox"]:disabled {
	opacity: 0.6;
	cursor: default;
}

/* focus */
.ipc-category-label input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--ipc-primary-btn-bg, #0EA5A0);
	outline-offset: 2px;
}

/* ==========================================================================
   7. אנימציות
   ========================================================================== */

/* --- Slide --- */
.ipc-anim-slide {
	opacity: 0;
}

/* slide מלמטה (ברירת מחדל לכל תבנית תחתונה) */
.ipc-anim-slide.ipc-position-bottom-right,
.ipc-anim-slide.ipc-position-bottom-left,
.ipc-anim-slide.ipc-position-bottom-full {
	transform: translateY(100%);
}

.ipc-anim-slide.ipc-position-top-right,
.ipc-anim-slide.ipc-position-top-left,
.ipc-anim-slide.ipc-position-top-full {
	transform: translateY(-100%);
}

/* slide לסיידבר */
.ipc-anim-slide.ipc-sidebar-right {
	transform: translateX(100%);
}

.ipc-anim-slide.ipc-sidebar-left {
	transform: translateX(-100%);
}

/* slide לפופאפ - מלמטה */
.ipc-anim-slide.ipc-position-center {
	transform: translate(-50%, -40%);
}

/* מצב פעיל */
.ipc-anim-slide.ipc-anim-active {
	opacity: 1;
	transform: translateY(0) translateX(0);
}

/* תיקון לפופאפ - שמירה על מיקום מרכזי */
.ipc-anim-slide.ipc-position-center.ipc-anim-active {
	transform: translate(-50%, -50%);
}

/* --- Fade --- */
.ipc-anim-fade {
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* פופאפ fade - שמירה על מיקום */
.ipc-anim-fade.ipc-position-center {
	transform: translate(-50%, -50%);
}

.ipc-anim-fade.ipc-anim-active {
	opacity: 1;
}

/* --- Bounce --- */
.ipc-anim-bounce {
	opacity: 0;
}

.ipc-anim-bounce.ipc-position-bottom-right,
.ipc-anim-bounce.ipc-position-bottom-left,
.ipc-anim-bounce.ipc-position-bottom-full {
	transform: translateY(60px);
}

.ipc-anim-bounce.ipc-position-top-right,
.ipc-anim-bounce.ipc-position-top-left,
.ipc-anim-bounce.ipc-position-top-full {
	transform: translateY(-60px);
}

.ipc-anim-bounce.ipc-sidebar-right {
	transform: translateX(60px);
}

.ipc-anim-bounce.ipc-sidebar-left {
	transform: translateX(-60px);
}

.ipc-anim-bounce.ipc-position-center {
	transform: translate(-50%, -45%);
}

.ipc-anim-bounce.ipc-anim-active {
	animation: ipc-bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ipc-anim-bounce.ipc-position-center.ipc-anim-active {
	animation: ipc-bounce-in-center 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ipc-bounce-in {
	0% {
		opacity: 0;
		transform: translateY(30px) scale(0.95);
	}
	60% {
		opacity: 1;
		transform: translateY(-8px) scale(1.02);
	}
	80% {
		transform: translateY(4px) scale(0.99);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes ipc-bounce-in-center {
	0% {
		opacity: 0;
		transform: translate(-50%, -45%) scale(0.9);
	}
	60% {
		opacity: 1;
		transform: translate(-50%, -52%) scale(1.02);
	}
	80% {
		transform: translate(-50%, -49%) scale(0.99);
	}
	100% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

/* --- None (ללא אנימציה) --- */
.ipc-anim-none {
	opacity: 1;
}

/* שמירה על transform לפופאפ */
.ipc-anim-none.ipc-position-center {
	transform: translate(-50%, -50%);
}

/* --- Transition משותף לslide ו-bounce --- */
.ipc-anim-slide,
.ipc-anim-bounce {
	transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ==========================================================================
   8. כפתור צף (Floating Action Button – FAB)
   ========================================================================== */

.ipc-fab {
	position: fixed;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--ipc-fab-size, 48px);
	height: var(--ipc-fab-size, 48px);
	border-radius: 50%;
	background-color: var(--ipc-fab-bg, #0EA5A0);
	color: var(--ipc-fab-color, #ffffff);
	border: none;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	padding: 0;
	line-height: 1;
}

.ipc-fab svg {
	width: calc(var(--ipc-fab-size, 48px) * 0.5);
	height: calc(var(--ipc-fab-size, 48px) * 0.5);
}

.ipc-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.28);
}

.ipc-fab:active {
	transform: scale(0.95);
}

.ipc-fab:focus-visible {
	outline: 2px solid var(--ipc-fab-bg, #0EA5A0);
	outline-offset: 3px;
}

/* מיקום - ימין למטה */
.ipc-fab--bottom-right {
	bottom: 20px;
	right: 20px;
}

/* מיקום - שמאל למטה */
.ipc-fab--bottom-left {
	bottom: 20px;
	left: 20px;
}

/* מיקום - ימין למעלה */
.ipc-fab--top-right {
	top: 20px;
	right: 20px;
}

/* מיקום - שמאל למעלה */
.ipc-fab--top-left {
	top: 20px;
	left: 20px;
}

/* Tooltip (כותרת מרחפת) */
.ipc-fab-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 50%;
	transform: translateX(50%);
	background-color: #1f2937;
	color: #ffffff;
	font-size: 12px;
	padding: 5px 10px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	direction: rtl;
}

.ipc-fab-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 50%;
	transform: translateX(50%);
	border: 5px solid transparent;
	border-top-color: #1f2937;
}

.ipc-fab:hover .ipc-fab-tooltip {
	opacity: 1;
}

/* ==========================================================================
   8.5. Fallback positions (safety net for invalid template+position combos)
   ========================================================================== */

.ipc-template-bar:not(.ipc-position-bottom-full):not(.ipc-position-top-full) {
	bottom: 0;
	left: 0;
	right: 0;
}

.ipc-template-minimal:not(.ipc-position-bottom-full):not(.ipc-position-top-full) {
	bottom: 0;
	left: 0;
	right: 0;
}

.ipc-template-classic:not(.ipc-position-bottom-right):not(.ipc-position-bottom-left):not(.ipc-position-top-right):not(.ipc-position-top-left) {
	bottom: 20px;
	right: 20px;
}

.ipc-template-popup:not(.ipc-position-center) {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* ==========================================================================
   9. רספונסיבי
   ========================================================================== */

@media (max-width: 767px) {

	/* --- קלאסי: רוחב מלא --- */
	.ipc-template-classic {
		width: calc(100% - 20px);
		max-width: none;
		left: 10px !important;
		right: 10px !important;
	}

	.ipc-template-classic.ipc-position-bottom-right,
	.ipc-template-classic.ipc-position-bottom-left {
		bottom: 10px;
	}

	.ipc-template-classic.ipc-position-top-right,
	.ipc-template-classic.ipc-position-top-left {
		top: 10px;
	}

	.ipc-template-classic .ipc-banner-actions {
		grid-template-columns: 1fr;
	}

	/* --- פופאפ: מתאים למובייל --- */
	.ipc-template-popup {
		width: calc(100% - 20px);
		max-width: none;
		padding: 24px 20px 20px;
	}

	.ipc-template-popup .ipc-banner-actions {
		grid-template-columns: 1fr;
	}

	/* --- בר: מחסנית אנכית --- */
	.ipc-bar-inner {
		flex-direction: column;
		text-align: center;
		gap: 12px;
		padding: 12px 16px;
	}

	.ipc-template-bar .ipc-banner-actions {
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
	}

	.ipc-bar-categories .ipc-bar-inner {
		flex-direction: column;
		gap: 8px;
	}

	/* --- סיידבר: הפיכה ל-bottom sheet --- */
	.ipc-template-sidebar {
		top: auto !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		max-height: 85vh;
		border-radius: var(--ipc-border-radius, 12px) var(--ipc-border-radius, 12px) 0 0;
		box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.15);
	}

	/* התאמת אנימציה לbottom-sheet */
	.ipc-template-sidebar.ipc-anim-slide {
		transform: translateY(100%) !important;
	}

	.ipc-template-sidebar.ipc-anim-slide.ipc-anim-active {
		transform: translateY(0) !important;
	}

	/* --- מינימלי: מחסנית קלה --- */
	.ipc-minimal-inner {
		flex-direction: column;
		text-align: center;
		gap: 10px;
		padding: 10px 16px;
	}

	.ipc-minimal-actions {
		width: 100%;
		justify-content: center;
	}

	/* --- FAB: גודל קבוע למובייל --- */
	.ipc-fab {
		width: 44px;
		height: 44px;
	}

	.ipc-fab--bottom-right,
	.ipc-fab--bottom-left {
		bottom: 12px;
	}

	.ipc-fab--top-right,
	.ipc-fab--top-left {
		top: 12px;
	}

	.ipc-fab--bottom-right,
	.ipc-fab--top-right {
		right: 12px;
	}

	.ipc-fab--bottom-left,
	.ipc-fab--top-left {
		left: 12px;
	}

	/* Tooltip - מעל FAB */
	.ipc-fab-tooltip {
		display: none;
	}
}

/* ==========================================================================
   10. רספונסיבי - מסכים גדולים
   ========================================================================== */

@media (min-width: 1200px) {
	.ipc-bar-inner,
	.ipc-minimal-inner {
		max-width: 1400px;
	}
}
