/* ============================================
   NOTIFICACIONES.CSS - Adaptado al tema
   Usa variables de theme.css para modo claro/oscuro
   ============================================ */

@import url("./theme.css");

.notifications {
	position: relative;
	display: inline-flex;
	align-items: center;
}

/* ============================================
   BOTÓN DE NOTIFICACIONES (campana)
   ============================================ */
.icon-btn--notifications {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--border-light, rgba(255, 255, 255, 0.12));
	border-radius: 14px;
	background: var(--glass-bg, rgba(255, 255, 255, 0.06));
	color: var(--text-strong, #ffffff);
	cursor: pointer;
	transition: var(--transition, all 0.3s ease);
}

.icon-btn--notifications:hover {
	background: var(--ghost-hover-bg, rgba(255, 255, 255, 0.1));
	border-color: rgba(243, 197, 0, 0.4);
}

.icon-btn--notifications svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* ============================================
   BADGE (contador)
   ============================================ */
.notifications__badge {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--yellow, #f3c500);
	color: var(--ink, #121212);
	font-size: 0.72rem;
	font-weight: 800;
	display: grid;
	place-items: center;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
	transition: var(--transition, all 0.3s ease);
}

/* ============================================
   PANEL DE NOTIFICACIONES - RESPETA EL TEMA
   ============================================ */
.notifications__panel {
    position: absolute !important;
    top: calc(100% + 0.75rem) !important;
    right: 0 !important;
    width: min(360px, calc(100vw - 1.5rem)) !important;
    max-height: 420px !important;
    
    /* === ESTILOS QUE RESPETAN EL TEMA === */
    background: var(--bg-secondary, rgba(16, 16, 16, 0.98)) !important;
    border-radius: 18px !important;
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1)) !important;
    box-shadow: var(--shadow-card, 0 18px 36px rgba(0, 0, 0, 0.35)) !important;
    
    z-index: 1000 !important;
    padding: 0.9rem !important;
    flex-direction: column !important;
    overflow: hidden !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* === EN MODO CLARO, EL PANEL USA FONDO CLARO === */
[data-theme="light"] .notifications__panel {
    background: var(--bg-secondary, #EDEDF2) !important;
    border-color: var(--border-light, rgba(26, 26, 30, 0.1)) !important;
    box-shadow: 0 18px 36px rgba(18, 18, 18, 0.12) !important;
}

/* Estados del panel */
.notifications__panel--hidden {
    display: none !important;
}

.notifications__panel--visible {
    display: flex !important;
}

/* ============================================
   HEADER DEL PANEL
   ============================================ */
.notifications__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	color: var(--text-strong, #ffffff);
	font-size: 0.92rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
	margin-bottom: 0.75rem;
	flex-shrink: 0;
}

.notifications__header span {
	color: var(--text-muted, rgba(255, 255, 255, 0.72));
	font-size: 0.78rem;
}

/* ============================================
   LISTA DE NOTIFICACIONES
   ============================================ */
.notifications__list {
	flex: 1;
	overflow-y: auto;
	max-height: 300px;
	padding-right: 5px;
}

/* Scrollbar personalizada - respeta el tema */
.notifications__list::-webkit-scrollbar {
	width: 5px;
}

.notifications__list::-webkit-scrollbar-track {
	background: var(--glass-bg, rgba(255, 255, 255, 0.1));
	border-radius: 3px;
}

.notifications__list::-webkit-scrollbar-thumb {
	background: rgba(243, 197, 0, 0.5);
	border-radius: 3px;
}

.notifications__list::-webkit-scrollbar-thumb:hover {
	background: rgba(243, 197, 0, 0.8);
}

/* ============================================
   ESTADO VACÍO
   ============================================ */
.notifications__empty {
	text-align: center;
	padding: 1rem;
	color: var(--text-muted, rgba(255, 255, 255, 0.6));
	font-size: 0.85rem;
}

/* ============================================
   ITEM DE NOTIFICACIÓN - RESPETA EL TEMA
   ============================================ */
.notifications__item {
	margin-bottom: 0.75rem;
	padding: 0.75rem;
	border-radius: 12px;
	
	/* === FONDO QUE RESPETA EL TEMA === */
	background: var(--glass-bg, rgba(255, 255, 255, 0.06));
	border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
	
	word-wrap: break-word;
	overflow-wrap: break-word;
	transition: background 0.2s ease, border-color 0.2s ease;
}

/* === MODO CLARO: fondo más claro y borde más visible === */
[data-theme="light"] .notifications__item {
	background: rgba(255, 255, 255, 0.8) !important;
	border: 1px solid rgba(26, 26, 30, 0.1) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Hover */
.notifications__item:hover {
	background: var(--ghost-hover-bg, rgba(255, 255, 255, 0.1));
	border-color: rgba(243, 197, 0, 0.3);
}

[data-theme="light"] .notifications__item:hover {
	background: rgba(243, 197, 0, 0.08) !important;
	border-color: rgba(243, 197, 0, 0.4) !important;
}

/* ============================================
   TEXTO DEL ITEM - RESPETA EL TEMA
   ============================================ */
.notifications__item strong {
	font-size: 0.9rem;
	line-height: 1.25;
	color: var(--text-strong, #ffffff);
}

[data-theme="light"] .notifications__item strong {
	color: var(--text-strong, #1a1a1e);
}

.notifications__item p {
	margin: 0.25rem 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--text-secondary, rgba(255, 255, 255, 0.82));
}

[data-theme="light"] .notifications__item p {
	color: var(--text-secondary, rgba(26, 26, 30, 0.75));
}

.notifications__item small {
	font-size: 0.72rem;
	color: var(--text-muted-soft, rgba(255, 255, 255, 0.55));
	display: block;
	margin-top: 0.25rem;
}

[data-theme="light"] .notifications__item small {
	color: var(--text-muted-soft, rgba(26, 26, 30, 0.45));
}

/* ============================================
   AVATAR / ICONO DEL USUARIO EN NOTIFICACIÓN
   ============================================ */
.notifications__item .avatar-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 0.9rem;
	flex-shrink: 0;
}

/* Avatar con foto */
.notifications__item img.avatar-img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

/* ============================================
   ANIMACIÓN DE ENTRADA
   ============================================ */
@keyframes notification-pop {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.notifications__item {
	animation: notification-pop 0.22s ease-out;
}

/* ============================================
   MODO CLARO - AJUSTES ADICIONALES
   ============================================ */
[data-theme="light"] .notifications__header {
	border-bottom-color: rgba(26, 26, 30, 0.08);
	color: var(--text-strong, #1a1a1e);
}

[data-theme="light"] .notifications__header span {
	color: var(--text-muted, rgba(26, 26, 30, 0.5));
}

[data-theme="light"] .notifications__empty {
	color: var(--text-muted, rgba(26, 26, 30, 0.5));
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
	.notifications__panel {
		width: min(340px, calc(100vw - 1rem)) !important;
		right: -10px !important;
	}
}