/* Homer Patuach Tips - Bubble (Design System: חומר פתוח) */

:root {
	--hpt-gradient: linear-gradient(135deg, #FB8255, #FB6965);
	--hpt-accent: #7699f2;
	--hpt-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
	--hpt-shadow-accent: 0 4px 15px rgba(255, 107, 129, 0.4);
	--hpt-border: #e9ebee;
	--hpt-radius: 8px;
	--hpt-radius-btn: 25px;
	--hpt-font: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
}

#hpt-tips-bubble,
#hpt-bubble-overlay,
#hpt-add-tip-modal {
	font-family: var(--hpt-font);
}

#hpt-tips-bubble {
	position: fixed;
	z-index: 99990;
	font-size: 14px;
}

/* מיקומים */
.hpt-bubble--bottom-left {
	bottom: 24px;
	left: 24px;
}

.hpt-bubble--bottom-right {
	bottom: 24px;
	right: 24px;
}

.hpt-bubble--top-left {
	top: 24px;
	left: 24px;
}

.hpt-bubble--top-right {
	top: 24px;
	right: 24px;
}

/* כפתור הבועה */
.hpt-bubble-trigger {
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--hpt-gradient);
	color: white;
	cursor: pointer;
	box-shadow: var(--hpt-shadow-accent);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hpt-bubble-trigger:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(255, 107, 129, 0.5);
}

.hpt-bubble-icon {
	font-size: 28px;
	line-height: 1;
}

/* Overlay + פאנל ממורכז 50% */
.hpt-bubble-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99995;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hpt-bubble-overlay[hidden] {
	display: none !important;
}

.hpt-bubble-panel {
	width: 50vw;
	min-width: 280px;
	max-width: 600px;
	max-height: 90vh;
	background: #fff;
	border-radius: var(--hpt-radius);
	box-shadow: var(--hpt-shadow);
	border: 1px solid var(--hpt-border);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

@media (max-width: 768px) {
	.hpt-bubble-panel {
		width: 92vw;
		max-width: none;
	}
}

.hpt-bubble-panel-inner {
	padding: 24px;
	position: relative;
	flex: 1;
	overflow-y: auto;
}

.hpt-bubble-close {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	color: #333;
	font-size: 28px;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
	z-index: 2;
}

.hpt-bubble-close:hover {
	color: #000;
}

/* תוכן הטיפ */
.hpt-tip-content-area {
	min-height: 80px;
	margin-bottom: 12px;
}

.hpt-tip-content-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hpt-tip-content-wrapper .hpt-nav-prev,
.hpt-tip-content-wrapper .hpt-nav-next {
	flex-shrink: 0;
}

.hpt-tip-inner {
	flex: 1;
	min-width: 0;
}

.hpt-tip-loading {
	color: #888;
	text-align: center;
	padding: 20px;
}

.hpt-tip-display {
	text-align: right;
}

.hpt-tip-media {
	font-size: 36px;
	margin-bottom: 8px;
	text-align: center;
}

.hpt-tip-media img {
	max-width: 80px;
	height: auto;
	border-radius: 4px;
}

.hpt-tip-body {
	margin-bottom: 8px;
	line-height: 1.5;
	color: #333;
}

.hpt-tip-body p:last-child {
	margin-bottom: 0;
}

.hpt-tip-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
}

.hpt-tip-credit {
	font-size: 12px;
	color: #888;
	flex: 1;
}

.hpt-tip-footer-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hpt-tip-edit {
	font-size: 14px;
	color: #888;
	text-decoration: none;
	padding: 4px 6px;
	border-radius: 4px;
	transition: color 0.2s, background 0.2s;
}

.hpt-tip-edit:hover {
	color: var(--hpt-accent);
	background: #f0f2f5;
}

.hpt-tip-like {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 14px;
	color: #888;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: var(--hpt-radius);
	transition: color 0.2s;
}

.hpt-tip-like:hover {
	color: #e91e63;
}

.hpt-tip-like.liked {
	color: #e91e63;
}

.hpt-tip-like.liked .hpt-like-icon {
	color: #e91e63;
}

.hpt-tip-like.hpt-like-loading {
	opacity: 0.6;
	pointer-events: none;
}

.hpt-tip-empty {
	text-align: center;
	padding: 20px;
	color: #888;
}

/* ניווט - חצים בצדדים */
.hpt-nav-prev,
.hpt-nav-next {
	width: 36px;
	height: 36px;
	border: 1px solid var(--hpt-border);
	background: #fff;
	border-radius: 50%;
	cursor: pointer;
	font-size: 20px;
	color: #555;
	transition: background 0.2s, color 0.2s;
}

.hpt-nav-prev:hover,
.hpt-nav-next:hover {
	background: #f0f2f5;
	color: var(--hpt-accent);
}

/* שורת כפתורים: הוספת טיפ + סינון */
.hpt-bubble-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.hpt-add-tip-btn,
.hpt-filter-toggle {
	flex: 1;
	padding: 10px 16px;
	border: none;
	border-radius: var(--hpt-radius-btn);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	transition: opacity 0.2s, transform 0.2s;
}

.hpt-add-tip-btn {
	background: var(--hpt-gradient);
	color: #fff;
}

.hpt-add-tip-btn:hover {
	opacity: 0.95;
	transform: translateY(-1px);
}

.hpt-filter-toggle {
	background: linear-gradient(135deg, #7699f2, #94b2ff);
	color: #fff;
}

.hpt-filter-toggle:hover {
	opacity: 0.95;
	transform: translateY(-1px);
}

/* מודל הוספת טיפ */
.hpt-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hpt-modal-overlay[hidden] {
	display: none !important;
}

.hpt-modal {
	width: 95%;
	max-width: 560px;
	max-height: 90vh;
	background: #fff;
	border-radius: var(--hpt-radius);
	box-shadow: var(--hpt-shadow);
	border: 1px solid var(--hpt-border);
	overflow-y: auto;
	position: relative;
	padding: 24px;
}

@media (max-width: 768px) {
	.hpt-modal {
		width: 96%;
		max-width: none;
	}
}

.hpt-modal-close {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	color: #333;
	font-size: 28px;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.hpt-modal-close:hover {
	color: #000;
}

.hpt-modal-title {
	margin: 0 0 20px 0;
	text-align: right;
	font-size: 1.25rem;
}

.hpt-add-tip-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.hpt-add-tip-form p {
	margin-bottom: 16px;
}

.hpt-add-tip-form textarea,
.hpt-add-tip-form input[type="text"],
.hpt-add-tip-form select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--hpt-border);
	border-radius: 12px;
	font-family: var(--hpt-font);
}

.hpt-form-format-bar {
	display: flex;
	gap: 6px;
	margin-bottom: 6px;
}

.hpt-format-btn {
	width: 32px;
	height: 28px;
	border: 1px solid var(--hpt-border);
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-family: var(--hpt-font);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, border-color 0.2s;
}

.hpt-format-btn:hover {
	background: #f0f2f5;
	border-color: var(--hpt-accent);
}

.hpt-form-content-editable {
	min-height: 100px;
	padding: 10px 14px;
	border: 1px solid var(--hpt-border);
	border-radius: 12px;
	font-family: var(--hpt-font);
	line-height: 1.5;
	outline: none;
}

.hpt-form-content-editable:empty::before {
	content: attr(data-placeholder);
	color: #999;
}

.hpt-form-content-editable a {
	color: var(--hpt-accent);
	text-decoration: underline;
}

.hpt-form-content-editable strong,
.hpt-form-content-editable b {
	font-weight: 700;
}

.hpt-form-symbol-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.hpt-form-symbol-row label {
	margin: 0;
	min-width: 50px;
}

.hpt-form-symbol-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
}

.hpt-form-symbol-controls button {
	padding: 8px 16px;
	border: none;
	border-radius: 12px;
	background: var(--hpt-gradient);
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	font-family: var(--hpt-font);
}

.hpt-form-symbol-controls .hpt-form-upload-image {
	background: linear-gradient(135deg, #7699f2, #94b2ff);
}

.hpt-form-symbol-preview {
	font-size: 24px;
}

.hpt-form-symbol-preview img {
	max-width: 48px;
	height: auto;
	border-radius: 8px;
}

.hpt-form-row-inline {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.hpt-form-row-inline .hpt-form-field {
	flex: 1;
	min-width: 120px;
}

.hpt-form-row-inline select {
	width: 100%;
}

.hpt-form-submit {
	background: var(--hpt-gradient);
	color: #fff;
	border: none;
	padding: 12px 24px;
	border-radius: 12px;
	cursor: pointer;
	font-weight: 600;
	font-family: var(--hpt-font);
}

.hpt-form-submit:hover {
	opacity: 0.95;
}

.hpt-form-message {
	padding: 10px;
	border-radius: 12px;
	font-family: var(--hpt-font);
}

.hpt-popover-emoji {
	position: absolute;
	background: #fff;
	border: 1px solid var(--hpt-border);
	border-radius: 12px;
	padding: 12px;
	box-shadow: var(--hpt-shadow);
	z-index: 100001;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.hpt-popover-emoji .hpt-emoji-btn {
	font-size: 24px;
	padding: 6px;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: 8px;
}

.hpt-popover-emoji .hpt-emoji-btn:hover {
	background: #f0f2f5;
}

.hpt-form-message.success {
	background: #e8f5e9;
	color: #2e7d32;
}

.hpt-form-message.error {
	background: #ffebee;
	color: #c62828;
}

/* צ'יפי סינון */
.hpt-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.hpt-filter-chip {
	padding: 6px 12px;
	border: 1px solid var(--hpt-border);
	background: #fff;
	border-radius: 20px;
	font-size: 12px;
	color: #555;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.hpt-filter-chip:hover,
.hpt-filter-chip.active {
	background: #e8ecf7;
	border-color: var(--hpt-accent);
	color: var(--hpt-accent);
}

.hpt-filter-clear {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 8px 16px;
	border: 1px solid var(--hpt-border);
	background: #fff;
	border-radius: var(--hpt-radius);
	font-size: 13px;
	color: #666;
	cursor: pointer;
	font-family: var(--hpt-font);
	transition: background 0.2s, border-color 0.2s;
}

.hpt-filter-clear:hover {
	background: #f5f5f5;
	border-color: #ccc;
}
