/* =========================================================================
   RACA Sync — RSGridStack v3 (Multi-column Pinterest Masonry)
   -------------------------------------------------------------------------
   CSS native multi-column layout + break-inside:avoid = perfect masonry
   ========================================================================= */

/* Multi-column masonry: her widget doğal yüksekliğini alır, boşluk kalmaz */
.rs-gs {
	column-count: 4;
	column-gap: 16px;
	width: 100%;
	box-sizing: border-box;
	position: relative;
}

/* Responsive breakpoint'ler */
@media (max-width: 1919px) { .rs-gs { column-count: 3; } }
@media (max-width: 1599px) { .rs-gs { column-count: 2; } }
@media (max-width: 1199px) { .rs-gs { column-count: 1; } }

.rs-gs-item {
	display: inline-block;
	width: 100%;
	margin: 0 0 16px 0;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	box-sizing: border-box;
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
	overflow: hidden;
	transition: box-shadow 150ms ease, transform 150ms ease;
	vertical-align: top;
}

.rs-gs-item:hover {
	box-shadow: 0 6px 20px rgba(17, 24, 39, 0.10);
}

.rs-gs-item--dragging {
	opacity: 0.5 !important;
	box-shadow: 0 12px 40px rgba(47, 91, 255, 0.35) !important;
}

/* rs-gs-body içeren widget'larda outer padding'i sıfırla */
.rs-gs-item:has(> .rs-gs-body) {
	padding: 0 !important;
}

.rs-gs-item > h4 {
	flex-shrink: 0;
	margin: 0 !important;
	padding: 12px 16px 8px !important;
	background: #fff;
	border-bottom: 1px solid #f0f2f8;
	font-size: 13px !important;
	font-weight: 700 !important;
	color: #1a237e;
	display: flex !important;
	align-items: center;
	gap: 6px;
}

/* ============================================================
   Widget Boyut Sınıfları (data-size="small|medium|large")
   İç scroll: sadece body scroll eder, widget dışa taşmaz
   ============================================================ */
.rs-gs-item > .rs-gs-body {
	padding: 10px 16px 14px;
	overflow-y: auto;
	scrollbar-width: thin;
	min-height: 120px;
}

.rs-gs-item[data-size="small"] > .rs-gs-body {
	max-height: 200px;
}
.rs-gs-item[data-size="medium"] > .rs-gs-body {
	max-height: 380px;
}
.rs-gs-item[data-size="large"] > .rs-gs-body {
	max-height: 560px;
}

/* Small = ~220-260 px total (h4 40 + body ≤200) */
/* Medium = ~350-450 px total (h4 40 + body ≤380) */
/* Large = ~600 px total (h4 40 + body ≤560) */

/* Mail/WhatsApp — kendi flex-body yapıları için özel */
.rs-gs-item.dash-mail-wrap,
.rs-gs-item.dash-wa-wrap {
	padding: 12px 16px !important;
}
.rs-gs-item.dash-mail-wrap[data-size="small"]  { max-height: 260px; }
.rs-gs-item.dash-mail-wrap[data-size="medium"] { max-height: 420px; }
.rs-gs-item.dash-mail-wrap[data-size="large"]  { max-height: 620px; }
.rs-gs-item.dash-wa-wrap[data-size="small"]  { max-height: 260px; }
.rs-gs-item.dash-wa-wrap[data-size="medium"] { max-height: 420px; }
.rs-gs-item.dash-wa-wrap[data-size="large"]  { max-height: 620px; }
.rs-gs-item.dash-mail-wrap,
.rs-gs-item.dash-wa-wrap {
	display: flex;
	flex-direction: column;
	max-height: 420px;
}
.rs-gs-item.dash-mail-wrap > .dash-mail-body,
.rs-gs-item.dash-wa-wrap > .dash-wa-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

/* Scrollbar */
.rs-gs-item > .rs-gs-body::-webkit-scrollbar { width: 6px; }
.rs-gs-item > .rs-gs-body::-webkit-scrollbar-thumb { background: #d0d5e0; border-radius: 3px; }
.rs-gs-item > .rs-gs-body::-webkit-scrollbar-thumb:hover { background: #a8b0c2; }

/* Drag handle */
.rs-gs-drag {
	cursor: move;
	user-select: none;
}
.rs-gs--locked .rs-gs-drag { cursor: default; }

/* Widget aksiyon barı — başlık sağında */
.rs-gs-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: auto;
	opacity: 0.55;
	transition: opacity 150ms;
}
.rs-gs-item:hover .rs-gs-actions { opacity: 1; }
.rs-gs-action {
	background: transparent;
	border: 1px solid transparent;
	color: #8a92a6;
	width: 22px;
	height: 22px;
	border-radius: 4px;
	font-size: 11px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 120ms, color 120ms, border-color 120ms;
	line-height: 1;
	padding: 0;
}
.rs-gs-action:hover {
	background: #f0f3f9;
	color: #1a237e;
	border-color: #d0d5e0;
}
.rs-gs-action--danger:hover {
	background: #ffebee;
	color: #c62828;
	border-color: #ef9a9a;
}
.rs-gs-item--pinned .rs-gs-action--pin {
	color: #c62828;
	background: #ffebee;
	border-color: #ef9a9a;
}

/* Boyut Cycling Butonu Görsel */
.rs-gs-action--size[data-current="small"] { color: #2e7d32; }
.rs-gs-action--size[data-current="medium"] { color: #f9a825; }
.rs-gs-action--size[data-current="large"] { color: #c62828; }

/* Tam ekran */
.rs-gs-item--fullscreen {
	position: fixed !important;
	inset: 20px !important;
	max-height: none !important;
	z-index: 99997 !important;
	margin: 0 !important;
	width: auto !important;
	break-inside: unset !important;
}
.rs-gs-item--fullscreen > .rs-gs-body {
	max-height: none !important;
}

/* Boş içerik placeholder */
.rs-gs-item > .rs-gs-body:empty::before,
.rs-gs-empty-msg {
	content: "Henüz veri yok";
	display: block;
	text-align: center;
	color: #a8b0c2;
	font-size: 13px;
	padding: 40px 20px;
	font-style: italic;
}

/* Toolbar */
.rs-gs-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #eef0f5;
	border-radius: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
	box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
}
.rs-gs-toolbar__title {
	font-size: 14px;
	font-weight: 700;
	color: #1a237e;
	margin-right: auto;
}
.rs-gs-toolbar__btn {
	padding: 6px 12px;
	background: #f0f3f9;
	border: 1px solid #d0d5e0;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #1a237e;
	cursor: pointer;
	transition: background 120ms;
}
.rs-gs-toolbar__btn:hover { background: #e2e7f4; }
.rs-gs-toolbar__btn--primary {
	background: linear-gradient(180deg, #2F5BFF, #254BE8);
	color: #fff;
	border-color: transparent;
}
.rs-gs-toolbar__btn--primary:hover {
	background: linear-gradient(180deg, #3D6BFF, #2F5BFF);
}

/* Add Widget modal (aynı) */
.rs-gs-add-modal {
	position: fixed; inset: 0; background: rgba(17,24,39,0.5);
	z-index: 99998; display: none; align-items: center; justify-content: center; padding: 40px;
}
.rs-gs-add-modal.open { display: flex; }
.rs-gs-add-modal__panel {
	background: #fff; border-radius: 12px;
	box-shadow: 0 20px 60px rgba(17,24,39,0.35);
	width: 800px; max-width: 96vw; max-height: 80vh;
	overflow: hidden; display: flex; flex-direction: column;
	font-family: var(--rs-font, "Inter", "Segoe UI", sans-serif);
}
.rs-gs-add-modal__head {
	padding: 16px 20px; background: #fafbfd;
	border-bottom: 1px solid #eef0f5;
	display: flex; align-items: center; gap: 12px;
}
.rs-gs-add-modal__head h3 {
	margin: 0; color: #1a237e; font-size: 16px; font-weight: 700; flex: 1;
}
.rs-gs-add-modal__close {
	background: transparent; border: none; font-size: 20px; line-height: 1;
	cursor: pointer; color: #888; padding: 0 4px;
}
.rs-gs-add-modal__body {
	padding: 16px 20px; overflow-y: auto;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
}
.rs-gs-add-card {
	display: flex; flex-direction: column; gap: 6px; padding: 12px;
	background: #fafbfd; border: 1px solid #eef0f5; border-radius: 8px;
	cursor: pointer; text-align: center;
	transition: background 120ms, border-color 120ms, transform 120ms;
}
.rs-gs-add-card:hover {
	background: #eef2ff; border-color: #c7d2fe; transform: translateY(-2px);
}
.rs-gs-add-card__icon { font-size: 28px; }
.rs-gs-add-card__name { font-size: 12px; font-weight: 700; color: #1a237e; }
.rs-gs-add-card__desc { font-size: 10px; color: #8a92a6; }
.rs-gs-add-card.added {
	background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32;
	cursor: default; opacity: 0.7;
}
