/* Sanje - paleta Pearl Aqua + tema claro/oscuro */
:root {
	--sanje-primary: #6EC9C0;
	--sanje-primary-dark: #3FA79C;
	--sanje-primary-light: #B8ECE4;
	--sanje-primary-pearl: #E4F7F3;

	--bg: #F5FBFA;
	--bg-elevated: #FFFFFF;
	--bg-sidebar: #0F2C28;
	--text: #14302C;
	--text-muted: #5B7A75;
	--border: #D3ECE7;
	--bubble-mine: var(--sanje-primary);
	--bubble-mine-text: #06211D;
	--bubble-other: #FFFFFF;
	--bubble-other-text: #14302C;
	--shadow: 0 2px 10px rgba(20, 48, 44, .08);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0F1E1C;
		--bg-elevated: #17302C;
		--bg-sidebar: #0A1D1A;
		--text: #EAF7F4;
		--text-muted: #8FB3AD;
		--border: #21403A;
		--bubble-mine: var(--sanje-primary-dark);
		--bubble-mine-text: #EAF7F4;
		--bubble-other: #1E3A34;
		--bubble-other-text: #EAF7F4;
		--shadow: 0 2px 10px rgba(0, 0, 0, .35);
	}
}

:root[data-theme="dark"] {
	--bg: #0F1E1C;
	--bg-elevated: #17302C;
	--bg-sidebar: #0A1D1A;
	--text: #EAF7F4;
	--text-muted: #8FB3AD;
	--border: #21403A;
	--bubble-mine: var(--sanje-primary-dark);
	--bubble-mine-text: #EAF7F4;
	--bubble-other: #1E3A34;
	--bubble-other-text: #EAF7F4;
	--shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

a { color: var(--sanje-primary-dark); }

.btn-sanje {
	background: var(--sanje-primary);
	border-color: var(--sanje-primary);
	color: #06211D;
}
.btn-sanje:hover { background: var(--sanje-primary-dark); border-color: var(--sanje-primary-dark); color: #fff; }

.text-sanje { color: var(--sanje-primary-dark) !important; }
.bg-sanje-pearl { background: var(--sanje-primary-pearl); }

/* ---- shell: sidebar + topbar ---- */
.sanje-shell { display: flex; min-height: 100vh; }
.sanje-sidebar {
	width: 240px; flex-shrink: 0; background: var(--bg-sidebar); color: #DFF4F0;
	display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
	transition: transform .2s ease; z-index: 1040;
}
.sanje-sidebar .brand { padding: 1.1rem 1.25rem; font-weight: 700; letter-spacing: .5px; color: #fff; }
.sanje-sidebar .nav-link {
	color: #BFE6DF; padding: .65rem 1.25rem; border-radius: 0; display: flex; gap: .6rem; align-items: center;
}
.sanje-sidebar .nav-link:hover, .sanje-sidebar .nav-link.active { background: rgba(255,255,255,.08); color: #fff; }
.sanje-main { margin-left: 240px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sanje-topbar {
	background: var(--bg-elevated); border-bottom: 1px solid var(--border);
	padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030;
}
.sanje-content { padding: 1.5rem; flex: 1; }
.sanje-sidebar-toggle { display: none; }

@media (max-width: 900px) {
	.sanje-sidebar { transform: translateX(-100%); }
	.sanje-sidebar.abierto { transform: translateX(0); }
	.sanje-main { margin-left: 0; }
	.sanje-sidebar-toggle { display: inline-flex; }
}

.sanje-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--shadow); }

/* ---- publico (login/registro) ---- */
/* Bloque (no flex) a proposito: un item flex/grid no se encoge bajo el ancho
   minimo de su contenido salvo min-width:0, y aun forzandolo se veia mal en
   headless Chrome movil - margin:auto en un bloque normal no tiene esa trampa. */
.sanje-publico {
	min-height: 100vh;
	background: linear-gradient(160deg, var(--sanje-primary-pearl), var(--bg));
	padding: 1.5rem;
	box-sizing: border-box;
}
.sanje-publico .sanje-card { max-width: 420px; margin: 6vh auto; padding: 2rem; box-sizing: border-box; }

/* ---- chat ---- */
.chat-scroll { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.burbuja { max-width: 75%; padding: .5rem .85rem; border-radius: 1rem; box-shadow: var(--shadow); }
.burbuja.mia { align-self: flex-end; background: var(--bubble-mine); color: var(--bubble-mine-text); border-bottom-right-radius: .25rem; }
.burbuja.otra { align-self: flex-start; background: var(--bubble-other); color: var(--bubble-other-text); border-bottom-left-radius: .25rem; }
.burbuja .hora { font-size: .7rem; opacity: .65; display: block; margin-top: .15rem; }
.burbuja img, .burbuja video { max-width: 220px; border-radius: .5rem; display: block; }

/* ---- galeria ---- */
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; }
.galeria-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: .6rem; overflow: hidden; }
.galeria-item .thumb { aspect-ratio: 1/1; background: var(--sanje-primary-pearl); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.galeria-item .thumb img, .galeria-item .thumb video { width: 100%; height: 100%; object-fit: cover; }
.galeria-item .thumb i { font-size: 2.5rem; color: var(--sanje-primary-dark); }

/* ---- historial / timeline ---- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: .55rem; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
	content: ''; position: absolute; left: -1.55rem; top: .3rem; width: .9rem; height: .9rem;
	border-radius: 50%; background: var(--sanje-primary); border: 2px solid var(--bg);
}

/* ---- toasts / notificaciones ---- */
.notif-dot {
	position: absolute; top: 2px; right: 2px; background: #E85D5D; color: #fff; border-radius: 50%;
	font-size: .65rem; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
