/*
 * HIOW Notice Board — Styles
 * Refined: dynamic, tactile, DCC-i design system
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ============================================================
 * Wrapper — softened, floating feel
 * ========================================================== */
.hiow-nb-wrap {
	position: relative;
	width: 100%;
	min-height: 480px;
	/* Height grows with content — no cap */
	height: auto;
	overflow: visible;
	font-family: Montserrat, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	border-radius: 22px;
	/* Lighter, softer shadow — feels open rather than boxed */
	box-shadow: 0 6px 32px rgba(62,30,103,0.10), 0 2px 8px rgba(62,30,103,0.06);
	background: transparent;
}

/* No background, no blobs — section provides all depth */
.hiow-nb-wrap::before { content: none; }
.hiow-nb-wrap::after  { content: none; }

.hiow-nb-wrap > * {
	position: relative;
	z-index: 2;
}

/* ============================================================
 * Header bar (hidden in hub embed via hub-css.php)
 * ========================================================== */
.hiow-nb-header {
	position: absolute;
	top: 0; left: 0; right: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 24px;
	background: linear-gradient(135deg, rgba(74,45,107,0.96), rgba(107,63,160,0.96));
	box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.hiow-nb-header-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hiow-nb-title-wrap { text-align: center; }
.hiow-nb-title { font-weight: 600; color: #fff; font-size: 18px; line-height: 1.2; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.hiow-nb-subtitle { display: block; font-weight: 400; color: rgba(255,255,255,0.92); font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.3); margin-top: 4px; line-height: 1.2; }

/* ============================================================
 * Notes area
 * ========================================================== */
.hiow-nb-notes-area {
	position: relative;
	min-height: 480px;
	padding-bottom: 100px; /* space for toolbar */
	z-index: 10;
}
.hiow-nb-notes-area::-webkit-scrollbar { display: none; }

/* ── Loading / Empty ── */
.hiow-nb-loading {
	position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
	background: rgba(255,255,255,0.9); border-radius: 10px; padding: 14px 24px;
	font-size: 14px; color: #6b3fa0; font-weight: 600;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 200;
	display: none; align-items: center; gap: 8px;
}
.hiow-nb-empty-state {
	position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
	text-align: center; font-weight: 500; color: #6b3fa0; font-size: 18px;
	pointer-events: none; display: none; white-space: nowrap;
}

/* ── Welcome note ── */
.hiow-nb-welcome-note {
	position: absolute; top: 40px; left: 40px; width: 260px; min-height: 140px;
	padding: 16px 14px 20px;
	background: linear-gradient(135deg, #e1bee7 0%, #f3e5f5 100%);
	border-radius: 3px;
	box-shadow: 3px 6px 18px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.15);
	font-weight: 500; font-size: 13px; line-height: 1.45; color: #2d2d2d;
	z-index: 15; border: 2px solid #ce93d8;
	transform: rotate(-1.5deg);
}
.hiow-nb-welcome-note::before {
	content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
	width: 44px; height: 14px;
	background: rgba(255,255,255,0.6);
	border-radius: 3px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}
.hiow-nb-welcome-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #f57f17; margin-bottom: 8px; }

/* ============================================================
 * Sticky notes — dynamic, tactile
 * ========================================================== */
@keyframes noteDropIn {
	0%   { opacity: 0; transform: var(--note-rotate, rotate(0deg)) translateY(-24px) scale(0.92); }
	60%  { opacity: 1; transform: var(--note-rotate, rotate(0deg)) translateY(4px) scale(1.02); }
	100% { opacity: 1; transform: var(--note-rotate, rotate(0deg)) translateY(0) scale(1); }
}

.hiow-nb-note {
	width: 240px;
	min-height: 160px;
	padding: 20px 18px 48px;
	border-radius: 4px;
	box-shadow:
		4px 8px 28px rgba(0,0,0,0.50),
		0 2px 8px rgba(0,0,0,0.32),
		inset 0 1px 0 rgba(255,255,255,0.65),
		inset 0 0 0 1px rgba(255,255,255,0.08);
	cursor: grab;
	position: absolute;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
	font-weight: 500;
	font-size: 14px;
	line-height: 1.55;
	color: #2d2d2d;
	user-select: none;
	z-index: 10;
	animation: noteDropIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
	--note-rotate: rotate(-1deg);
	transform: var(--note-rotate, rotate(-1deg));
	transition: box-shadow 0.22s ease, transform 0.22s ease;
}

/* Rotation variants — 5 cycling patterns, ±2–4° */
.hiow-nb-note:nth-child(5n+1) { --note-rotate: rotate(-2.5deg); transform: var(--note-rotate); }
.hiow-nb-note:nth-child(5n+2) { --note-rotate: rotate(1.8deg);  transform: var(--note-rotate) translateX(-28px); }
.hiow-nb-note:nth-child(5n+3) { --note-rotate: rotate(-1.2deg); transform: var(--note-rotate) translateX(-18px); }
.hiow-nb-note:nth-child(5n+4) { --note-rotate: rotate(3.1deg);  transform: var(--note-rotate); }
.hiow-nb-note:nth-child(5n+5) { --note-rotate: rotate(-0.6deg); transform: var(--note-rotate) translateX(-12px); }

/* Focal note — clearly primary, anchor of composition */
.hiow-nb-note:first-child {
	width: 270px;
	min-height: 190px;
	font-size: 14.5px;
	z-index: 14;
	--note-rotate: rotate(-1deg);
	transform: var(--note-rotate);
	box-shadow:
		6px 14px 38px rgba(0,0,0,0.52),
		0 4px 14px rgba(0,0,0,0.32),
		inset 0 1px 0 rgba(255,255,255,0.7);
}

/* Second note — sits slightly behind first (overlap effect) */
.hiow-nb-note:nth-child(2) {
	z-index: 11;
	--note-rotate: rotate(2.4deg);
	transform: var(--note-rotate);
	/* Pushed slightly back — smaller shadow, lower opacity */
	box-shadow:
		2px 4px 12px rgba(0,0,0,0.18),
		0 1px 3px rgba(0,0,0,0.10);
	opacity: 0.92;
}

/* Third note — background layer, softest shadow */
.hiow-nb-note:nth-child(3) {
	z-index: 9;
	opacity: 0.88;
	box-shadow:
		1px 3px 10px rgba(0,0,0,0.14),
		0 1px 2px rgba(0,0,0,0.08);
}

/* Tape strip — bright white, clearly visible */
.hiow-nb-note::before {
	content: '';
	position: absolute;
	top: -10px; left: 50%;
	transform: translateX(-50%);
	width: 52px; height: 16px;
	background: rgba(255,255,255,0.88);
	border-radius: 3px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,1), inset 0 -1px 0 rgba(0,0,0,0.05);
	background-image: repeating-linear-gradient(
		90deg,
		transparent, transparent 4px,
		rgba(0,0,0,0.025) 4px, rgba(0,0,0,0.025) 5px
	), linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.78));
}

/* Hover — lift off the surface */
.hiow-nb-note:hover {
	box-shadow:
		8px 18px 40px rgba(0,0,0,0.55),
		0 4px 12px rgba(0,0,0,0.35),
		inset 0 1px 0 rgba(255,255,255,0.7);
	transform: var(--note-rotate, rotate(-1deg)) translateY(-6px) scale(1.025);
	z-index: 20;
}

.hiow-nb-note.dragging {
	cursor: grabbing;
	box-shadow: 8px 18px 40px rgba(0,0,0,0.42), 0 4px 12px rgba(0,0,0,0.2);
	z-index: 100; opacity: 0.95;
	transform: var(--note-rotate, rotate(-1deg)) scale(1.04);
}

.hiow-nb-note.completed { opacity: 0.5; }
.hiow-nb-note.completed .hiow-nb-note-text { text-decoration: line-through; }

.hiow-nb-note-category { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; margin-bottom: 6px; }
.hiow-nb-note-text { white-space: pre-wrap; font-size: 13px; }
.hiow-nb-note-author { position: absolute; bottom: 10px; left: 14px; font-size: 12px; opacity: 0.5; font-style: italic; }
.hiow-nb-note-date { font-size: 10px; opacity: 0.6; margin-top: 8px; }
.hiow-nb-note-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.hiow-nb-note:hover .hiow-nb-note-actions { opacity: 1; }
.hiow-nb-note-actions button { width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ============================================================
 * Bottom toolbar — + as primary FAB, secondary actions lighter
 * ========================================================== */
.hiow-nb-toolbar {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	padding: 14px 24px 16px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	z-index: 150;
	background: linear-gradient(to top, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.3) 100%);
	backdrop-filter: blur(6px);
	border-top: 1px solid rgba(62,30,103,0.06);
}

/* Primary FAB — warm clay glow, not neon */
.hiow-nb-add-btn {
	background: linear-gradient(135deg, #e91e63, #c2185b);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 64px; height: 64px;
	font-size: 32px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	box-shadow:
		0 0 48px 20px rgba(220,60,110,0.09),
		0 8px 24px rgba(180,20,70,0.24),
		0 2px 6px rgba(180,20,70,0.16);
	transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
	font-family: inherit;
	flex-shrink: 0;
}
.hiow-nb-add-btn:hover {
	transform: scale(1.09) translateY(-3px);
	box-shadow:
		0 0 64px 28px rgba(220,60,110,0.12),
		0 12px 32px rgba(180,20,70,0.28),
		0 3px 8px rgba(180,20,70,0.18);
}
.hiow-nb-add-btn:active { transform: scale(0.95); }

/* Secondary actions — reduced visual weight */
.hiow-nb-eraser-btn {
	background: rgba(40,20,60,0.65);
	color: rgba(230,210,255,0.85);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 40px;
	padding: 10px 18px;
	font-weight: 600;
	font-size: 12px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
	transition: background 0.15s, color 0.15s, box-shadow 0.15s;
	letter-spacing: 0.02em;
	backdrop-filter: blur(8px);
}
.hiow-nb-eraser-btn:hover {
	background: rgba(60,30,85,0.80);
	color: rgba(245,225,255,0.95);
	border-color: rgba(255,255,255,0.20);
	box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
.hiow-nb-eraser-btn.eraser-active {
	background: rgba(180,20,60,0.45);
	color: #ffb3c8;
	border-color: rgba(255,100,130,0.35);
}

/* ============================================================
 * Add-note panel
 * ========================================================== */
.hiow-nb-add-panel {
	background: rgba(255,255,255,0.97);
	backdrop-filter: blur(10px);
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.2);
	width: 320px;
	position: absolute;
	bottom: 86px; left: 50%;
	transform: translateX(-50%);
	z-index: 200;
	display: none;
}
.hiow-nb-add-panel.visible { display: block; }
.hiow-nb-field, .hiow-nb-select, .hiow-nb-textarea { width: 100%; border: 1.5px solid #ddd; border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 12px; outline: none; margin-top: 8px; box-sizing: border-box; }
.hiow-nb-textarea { height: 80px; resize: none; font-size: 14px; }
.hiow-nb-field:focus, .hiow-nb-select:focus, .hiow-nb-textarea:focus { border-color: #6b3fa0; box-shadow: 0 0 0 2px rgba(107,63,160,0.15); }
.hiow-nb-color-option { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.12s; }
.hiow-nb-color-option:hover { transform: scale(1.15); }
.hiow-nb-color-option.selected { border-color: #4a2d6b; }
.hiow-nb-emoji-picker { display: none; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px; margin-top: 8px; max-height: 150px; overflow-y: auto; }
.hiow-nb-emoji-btn { border: none; background: #fff; font-size: 20px; cursor: pointer; padding: 4px; border-radius: 4px; display: inline-block; width: 32px; height: 32px; }
.hiow-nb-emoji-btn:hover { background: #f0f0f0; }
.hiow-nb-limit-warning { background: #fee2e2; color: #991b1b; padding: 8px 14px; border-radius: 8px; font-size: 12px; margin-top: 8px; display: none; }
.hiow-nb-btn-primary { padding: 8px 20px; border: none; border-radius: 8px; background: linear-gradient(135deg, #4a2d6b, #6b3fa0); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.hiow-nb-btn-primary:hover { opacity: 0.9; }
.hiow-nb-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.hiow-nb-btn-secondary { padding: 8px 16px; border: 1.5px solid #ddd; border-radius: 8px; background: #fff; color: #333; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.hiow-nb-btn-secondary:hover { background: #f5f5f5; }
.hiow-nb-btn-danger { padding: 8px 20px; border: none; border-radius: 8px; background: #cc3333; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.hiow-nb-btn-danger:hover { background: #aa2222; }

/* ============================================================
 * Overlays / Toast
 * ========================================================== */
.hiow-nb-confirm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 300; }
.hiow-nb-confirm-overlay.visible { display: flex; }
.hiow-nb-confirm-box { background: #fff; border-radius: 14px; padding: 28px; max-width: 340px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.hiow-nb-toast { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(16px); background: rgba(62,30,103,0.88); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity 0.28s, transform 0.28s; z-index: 500; pointer-events: none; white-space: nowrap; }
.hiow-nb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
 * Embedded mode
 * ========================================================== */
.hiow-nb-embed {
	position: relative; width: 100%; height: 500px; min-height: 300px;
	overflow: hidden;
	font-family: Montserrat, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	border-radius: 20px;
	background: rgba(248,244,255,0.6);
	border: 1px solid rgba(62,30,103,0.08);
	box-shadow: 0 4px 24px rgba(62,30,103,0.10);
	margin-bottom: 36px;
}
.hiow-nb-notes-area--embed { position: absolute; top: 0; left: 0; right: 0; bottom: 68px; }
.hiow-nb-embed .hiow-nb-toolbar { position: absolute; bottom: 0; left: 0; right: 0; }
.hiow-nb-embed .hiow-nb-add-panel { bottom: 80px; }
.hiow-nb-embed .hiow-nb-confirm-overlay,
.hiow-nb-embed .hiow-nb-toast { position: absolute; }

/* ============================================================
 * Responsive
 * ========================================================== */
@media (max-width: 700px) {
	.hiow-nb-header { padding: 12px 16px; }
	.hiow-nb-frame, .hiow-nb-notes-area { top: 72px; }
	.hiow-nb-add-panel { width: calc(100% - 32px); }
	.hiow-nb-add-btn { width: 54px; height: 54px; font-size: 26px; }
}

/* Force Clear Done to match Eraser pill exactly */
#hiowNbClearDoneBtn {
	background: rgba(40,20,60,0.65) !important;
	color: rgba(230,210,255,0.85) !important;
	border: 1px solid rgba(255,255,255,0.12) !important;
	border-radius: 40px !important;
	padding: 10px 18px !important;
	font-weight: 600 !important;
	font-size: 12px !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08) !important;
	backdrop-filter: blur(8px) !important;
}
#hiowNbClearDoneBtn:hover {
	background: rgba(60,30,85,0.80) !important;
	color: rgba(245,225,255,0.95) !important;
	border-color: rgba(255,255,255,0.20) !important;
}
