/**
 * Estilos para el plugin AF App Notificaciones
 */

/* ===================================================================
   TOASTS — sistema de notificaciones flotantes (contexto global)
   =================================================================== */
.notifications-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 9999;
	width: 420px !important;
	box-sizing: border-box !important;
}

.notification {
	background: var(--af-usuario-card, #fff);
	border-radius: var(--af-app-radius-md, 0);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	margin-bottom: 0.75rem;
	padding: 1.25rem;
	border-left: 4px solid #0078d4;
	animation: slideInRight 0.3s ease;
	position: relative;
	width: 100% !important;
	box-sizing: border-box !important;
	min-height: 75px;
	max-width: none !important;
	min-width: 0 !important;
	display: block !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	left: 0 !important;
	right: auto !important;
	text-align: left !important;
}

.notification.success { border-left-color: #28a745; padding: 1.25rem !important; }
.notification.error { border-left-color: #dc3545; padding: 1.25rem !important; }
.notification.warning { border-left-color: #ffc107; padding: 1.25rem !important; }

.notification-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem !important;
	width: 100% !important;
	box-sizing: border-box !important;
	text-align: left !important;
	margin-top: 0 !important;
	padding: 0 !important;
}

.notification-title {
	font-weight: 600;
	margin: 0 !important;
	font-size: 1rem;
	word-wrap: break-word;
	flex: 1;
	margin-right: 0.5rem !important;
	text-align: left !important;
	padding: 0 !important;
}

.notification-close {
	background: none;
	border: none;
	font-size: 1.4rem;
	cursor: pointer;
	color: #999;
	padding: 0 !important;
	line-height: 1;
	margin: 0 !important;
}
.notification-close:hover { color: #666; }

.notification-body {
	font-size: 0.95rem;
	color: #666;
	margin: 0 !important;
	word-wrap: break-word;
	line-height: 1.4;
	width: 100% !important;
	box-sizing: border-box !important;
	text-align: left !important;
	padding: 0 !important;
}

@keyframes slideInRight {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

@media screen and (max-width: 768px) {
	.notifications-container {
		left: 1rem;
		right: 1rem;
		width: calc(100% - 2rem);
		max-width: 360px;
	}
}
@media screen and (max-width: 480px) {
	.notifications-container {
		left: 0.5rem;
		right: 0.5rem;
		width: calc(100% - 1rem);
		max-width: 320px;
	}
	.notification { padding: 1rem; min-height: 65px; }
}

.wp-admin .notifications-container { top: 32px; width: 420px !important; }
.wp-admin .notification,
.wp-admin .notification.success,
.wp-admin .notification.warning,
.wp-admin .notification.error {
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	display: block !important;
	float: none !important;
	clear: both !important;
}
@media (max-width: 782px) {
	.wp-admin .notifications-container { top: 46px; width: 420px !important; }
}

/* ===================================================================
   WIDGET FLOTANTE
   =================================================================== */
.af-app-notif-widget {
	position: fixed; right: 20px; bottom: 20px; z-index: 9999;
	background: var(--af-usuario-card, #fff);
	border-left: 4px solid var(--af-usuario-primary, #0073aa);
	box-shadow: var(--af-usuario-shadow-soft, 0 4px 12px rgba(0,0,0,.15));
	padding: 12px 14px;
	border-radius: var(--af-app-radius-md, 0);
	cursor: pointer;
	display: flex; align-items: center; gap: 8px;
	transition: var(--af-usuario-transition, all 0.2s ease);
}
.af-app-notif-widget:hover {
	box-shadow: var(--af-usuario-shadow, 0 6px 16px rgba(0,0,0,.18));
}
.af-app-notif-icon { margin-right: 4px; }
.af-app-notif-minimize {
	background: transparent;
	border: none;
	color: #555;
	font-size: 16px;
	line-height: 1;
	margin-left: 4px;
	cursor: pointer;
	padding: 2px 4px;
}
.af-app-notif-minimize:hover { color: #111; }
.af-app-notif-enable{
	background: rgba(0, 115, 170, 0.08);
	border: 1px solid rgba(0, 115, 170, 0.22);
	color: #065a87;
	font-size: 12px;
	font-weight: 700;
	padding: 6px 10px;
	border-radius: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}
.af-app-notif-enable:hover{
	background: rgba(0, 115, 170, 0.14);
}
.af-app-notif-widget.is-minimized { padding: 10px 12px; }
.af-app-notif-widget.is-minimized .af-app-notif-text { display: none; }
.af-app-notif-widget.is-minimized .af-app-notif-enable { display: none; }
.af-app-notif-icon { position: relative; }
.af-app-notif-count {
	position: absolute; top: -6px; right: -8px;
	min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
	background: #d63638; color: #fff;
	border-radius: 0;
	font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ===================================================================
   LAYOUT LEGACY (fallbacks si el tema no los define)
   =================================================================== */
.af-app-layout { display: flex; gap: 24px; }
.af-app-card {
	background: var(--af-usuario-card, #fff);
	padding: 16px;
	border-radius: var(--af-app-radius-md, 0);
	box-shadow: var(--af-usuario-shadow-soft, 0 1px 3px rgba(0,0,0,.08));
}
.af-table { width:100%; border-collapse: collapse; }
.af-table th, .af-table td {
	padding: 10px;
	border-bottom: 1px solid var(--af-usuario-border, #eee);
	text-align: left;
}

/* ===================================================================
   PAGINACION
   =================================================================== */
.af-pagination { margin-top: 12px; }
.af-page {
	display: inline-block;
	margin-right: 6px;
	padding: 6px 10px;
	border: 1px solid var(--af-usuario-border, #ddd);
	border-radius: var(--af-app-radius-sm, 0);
	text-decoration: none;
	color: var(--af-usuario-text, #333);
}
.af-page.active {
	background: var(--af-usuario-primary, #0073aa);
	color: #fff;
	border-color: var(--af-usuario-primary, #0073aa);
}
.af-page--disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ===================================================================
   TABLA (hereda af-app-table del tema app-pages)
   =================================================================== */
.af-notificaciones-wrapper .af-app-table-wrapper {
	margin-top: 24px;
}

/* ===================================================================
   LAYOUT EMBEDDED (cuando se renderiza dentro del menú del tema)
   =================================================================== */
.af-notificaciones--embedded .af-app-usuario-shell{
	grid-template-columns: 1fr;
}
.af-notificaciones--embedded.af-app-usuario-wrapper{
	padding: clamp(16px, 1.2vw + 10px, 28px);
}
.af-notificaciones--embedded,
.af-notificaciones--embedded .af-app-usuario-main{
	min-width: 0;
}

/* ===================================================================
   BOTONES — overrides scoped para el plugin
   =================================================================== */
.af-notificaciones-wrapper .af-app-usuario-button,
.af-notificaciones-wrapper button.af-app-notif-enable,
.af-notificaciones-wrapper button.af-ges-notif-enable{
	appearance: none;
	border-radius: var(--af-app-radius-xl, 0);
	font: 600 13px/1.1 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
	padding: 10px 14px;
	border: 1px solid var(--af-usuario-border);
	background: rgba(255,255,255,.72);
	color: var(--af-usuario-text);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
	box-shadow: none;
	user-select: none;
}

.af-notificaciones-wrapper .af-app-usuario-button:hover,
.af-notificaciones-wrapper button.af-app-notif-enable:hover,
.af-notificaciones-wrapper button.af-ges-notif-enable:hover{
	transform: translateY(-1px);
	box-shadow: var(--af-usuario-shadow-soft, 0 10px 24px rgba(15,23,42,.10));
	border-color: rgba(9,174,184,.35);
	background: rgba(9,174,184,.08);
}

.af-notificaciones-wrapper .af-app-usuario-button:active,
.af-notificaciones-wrapper button.af-app-notif-enable:active,
.af-notificaciones-wrapper button.af-ges-notif-enable:active{
	transform: translateY(0);
	box-shadow: none;
}

.af-notificaciones-wrapper .af-app-usuario-button:focus,
.af-notificaciones-wrapper button.af-app-notif-enable:focus,
.af-notificaciones-wrapper button.af-ges-notif-enable:focus{
	outline: none;
	box-shadow: 0 0 0 3px var(--af-app-focus-ring-soft, rgba(9,174,184,.22));
	border-color: rgba(9,174,184,.55);
}

.af-notificaciones-wrapper .af-app-usuario-button--outline{
	background: rgba(255,255,255,.72);
	border-color: rgba(9,174,184,.35);
}

.af-notificaciones-wrapper .af-app-usuario-button--ghost,
.af-notificaciones-wrapper .af-app-inline-actions .af-app-usuario-button{
	padding: 8px 12px;
	background: transparent;
	border-color: rgba(15,23,42,.12);
	color: var(--af-usuario-muted);
}
.af-notificaciones-wrapper .af-app-usuario-button--ghost:hover,
.af-notificaciones-wrapper .af-app-inline-actions .af-app-usuario-button:hover{
	color: var(--af-usuario-text);
	background: rgba(15,23,42,.04);
	border-color: rgba(15,23,42,.18);
	box-shadow: none;
}

.af-notificaciones-wrapper #af-app-enable-desktop-notifications,
.af-notificaciones-wrapper #af-ges-enable-desktop-notifications{
	padding: 9px 12px;
	border-radius: 0;
}

.af-notificaciones-wrapper select{
	border-radius: var(--af-app-radius-md, 0);
	border: 1px solid var(--af-usuario-border);
	padding: 8px 10px;
	background: rgba(255,255,255,.9);
}
.af-notificaciones-wrapper select:focus{
	outline: none;
	box-shadow: 0 0 0 3px var(--af-app-focus-ring-soft, rgba(9,174,184,.22));
	border-color: rgba(9,174,184,.55);
}

/* ===================================================================
   PANEL — tabla transparente dentro de tarjeta (evitar doble tarjeta)
   =================================================================== */
.af-usuario-card--panel .af-app-table-wrapper {
	background: transparent;
	box-shadow: none;
	border-radius: var(--af-app-radius-xl, 0);
	padding: 0;
}
.af-usuario-card--panel .af-app-table__empty {
	background: rgba(15,23,42,.04);
	border: 1px solid rgba(15,23,42,.06);
	border-radius: var(--af-app-radius-xl, 0);
	padding: 18px;
}

/* Fallback de título si el tema no define la clase */
.af-app-usuario-card__title{
	margin: 0 0 20px 0;
	font-weight: 800;
	letter-spacing: .2px;
	color: var(--af-usuario-text, rgba(15,23,42,.9));
}

/* Fallbacks mínimos para avatar/acciones si faltaran en el tema */
.af-app-usuario-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* ===================================================================
   SIDEBAR — tweaks para el menú lateral (mismos que af-app-servicios)
   =================================================================== */
.af-notificaciones-wrapper .af-app-usuario-profile-role {
	font-size: 18px;
	font-weight: 600;
	opacity: 0.9;
}

.af-notificaciones-wrapper .af-app-usuario-profile-card {
	gap: 16px;
}

.af-notificaciones-wrapper .af-app-usuario-nav__item {
	display: flex;
	align-items: center;
	min-height: 44px;
	line-height: 1.2;
	font-size: 16px;
	border-radius: 0;
}

.af-notificaciones-wrapper .af-app-usuario-nav__item span {
	line-height: 1.2;
}

/* Foundation aplica radius 0 a [type="button"] */
.af-notificaciones-wrapper .af-app-usuario-nav__item[type="button"]{
	border-radius: 0;
}

/* ===================================================================
   CLASES DE UTILIDAD — reemplazan inline styles del template
   =================================================================== */
.af-notif-per-page-wrapper { margin-top: 14px; }
.af-notif-per-page-label {
	display: block;
	font-size: 13px;
	opacity: .9;
	margin-bottom: 6px;
	color: var(--af-usuario-card, #eef2ff);
}
.af-notif-per-page-select { width: 100%; max-width: 220px; }
.af-notif-summary { margin-top: 8px; opacity: .8; }
