/*!
 * LUW Combined Styles v1.0
 * Complete CSS for WindLUW, MenuLUW, and CardLUW
 * Includes window management, menus, and card components
 */

/* ============================================
   CSS VARIABLES FOR THEMING AND RESPONSIVENESS
   ============================================ */

:root {
	--window-bg: white;
	--header-bg: #f8f9fa;
	--border-color: #dcdcdc;
	--primary-color: #0066cc;
	--primary-hover: #0052a3;
	--success-color: #4CAF50;
	--error-color: #f44336;
	--shadow: 0 4px 12px rgba(0,0,0,0.15);
	--transition: 0.2s ease;
	--z-index-base: 100;
	--z-index-modal: 9999;
	--min-width-desktop: 600px;
	--min-height-desktop: 600px;
	--min-width-mobile: 90vw;
	--min-height-mobile: 50vh;	
	--button-size: 36px;
	--button-icon-size: 18px;
	--button-hover-bg: #e0f7fa;
	
	
	
}

/* ============================================
   WINDOW MANAGEMENT STYLES (WindLUW)
   ============================================ */

.window {
	position: fixed;
	background: var(--window-bg);
	border-radius: 8px;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	left: 220px;
	top: 60px;
	min-width: var(--min-width-desktop);
	min-height: var(--min-height-desktop);
	overflow-y: auto;
	z-index: var(--z-index-base);
}

.window.minimized {
	width: 200px;
	height: 100px;
	position: fixed;
	bottom: 0;
	top: auto;
	overflow: hidden;
	transition: width var(--transition), height var(--transition), bottom var(--transition);
	z-index: 1000;
	min-width: auto;
	min-height: auto;
}

.window.maximized {
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	position: fixed;
	border-radius: 0;
	z-index: 1000;
}

.header {
	height: 40px;
	background-color: var(--header-bg);
	cursor: move;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 10px;
	border-bottom: 1px solid var(--border-color);
	border-radius: 8px 8px 0 0;
}

.header-text {
	margin-right: auto;
	width: 66%;
	background-color: #f7f9f9;
	color: rgb(44, 62, 80);
	text-align: center;
}

/* Reset any inherited line-height and fix font rendering */
.maximize-button,
.minimize-button,
.restore-button,
.close-button {
	width: var(--button-size);
	height: var(--button-size);
	margin-left: 6px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--button-icon-size);
	line-height: 1; /* Prevent vertical misalignment */
	background: transparent;
	color: #333;
	transition: background 0.2s, color 0.2s;
	border: none;
	padding: 0;  /* Remove any internal spacing */
	font-family: 'Segoe UI Symbol', 'Segoe UI', sans-serif;
}

/* Hover state */
.maximize-button:hover,
.minimize-button:hover,
.restore-button:hover,
.close-button:hover {
	background-color: var(--button-hover-bg);
	color: #000;
}

/* Unicode Icons (nicely balanced ones) */
.maximize-button::before { content: "⛶"; }   /* U+26F6 - Square with diagonals */
.minimize-button::before { content: "–"; }   /* U+2013 - En Dash for balanced line */
.restore-button::before  { content: "▢"; }   /* U+25A2 - White Square with small center */
.close-button::before    { content: "✖"; }   /* U+2716 - Multiplication X */



.window-content {
	padding: 4px;
	flex-grow: 1;
	overflow: auto;
	position: relative;
}

.resizer {
	width: var(--resizer-size);
	height: var(--resizer-size);
	background: var(--header-bg);
	position: absolute;
	right: 0;
	bottom: 0;
	cursor: se-resize;
	touch-action: none;
}

/* Form Styles */
.form-group {
	margin-bottom: 15px;
}

label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 8px;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

/* Button Container Styles */
.button-container {
	padding: 10px 20px;
	border-top: 1px solid #dee2e6;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.window-button {
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	border: none;
	background: var(--primary-color);
	color: white;
}

.window-button:hover {
	background: var(--primary-hover);
}

/* Message Styles */
.success-message {
	position: absolute;
	bottom: 60px;
	left: 20px;
	font-size: 14px;
	color: var(--success-color);
}

.error-message {
	position: absolute;
	bottom: 60px;
	left: 20px;
	font-size: 14px;
	color: var(--error-color);
}

.window.saving .window-button {
	opacity: 0.6;
	pointer-events: none;
	cursor: not-allowed;
}

.window.saving .window-content::after {
	content: 'Saving...';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 10px 20px;
	border-radius: 4px;
	z-index: 10;
}

/* Hidden Template Forms */
.hidden {
	display: none;
}

/* Debug Window Styles */
.debug-window {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 600px;
	max-height: 400px;
	background-color: #f8f8f8;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.2);
	overflow: auto;
	padding: 20px;
	font-family: monospace;
	z-index: 10000;
}

.debug-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #ddd;
	padding-bottom: 10px;
	margin-bottom: 15px;
}

.debug-header h3 {
	margin: 0;
	color: #333;
}

.debug-close-btn {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
}

.debug-close-btn:hover {
	color: #333;
}

.debug-content {
	background-color: #f1f1f1;
	padding: 12px;
	border-radius: 4px;
	overflow: auto;
	max-height: 300px;
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.debug-copy-btn {
	background-color: var(--success-color);
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 4px;
	margin-top: 15px;
	cursor: pointer;
	font-size: 14px;
}

.debug-copy-btn:hover {
	background-color: #45a049;
}

/* Modal Styles */
.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: var(--z-index-modal);
	justify-content: center;
	align-items: center;
}

.modal-overlay[style*="display: block"] {
	display: flex;
}

.modal-content {
	background-color: white;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	text-align: center;
	max-width: 400px;
	width: 100%;
	margin: 0 auto;
	max-height: 80vh;
	overflow-y: auto;
}

.modal-buttons {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 20px;
}

.modal-button {
	padding: 8px 16px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	min-width: 100px;
}

.cancel-button {
	background-color: #6c757d;
	color: white;
}

.cancel-button:hover {
	background-color: #5a6268;
}

.close-anyway-button {
	background-color: #c82333;
	color: white;
}

.close-anyway-button:hover {
	background-color: #a71d2a;
}

/* Window Content Overrides */
.window-createNote .window-content {
	padding: 20px;
}

[class^="window-create"] .window-content,
[class*="window-create"] .window-content {
	padding: 20px;
}

/* Focus Styles for Accessibility */
input:focus, select:focus, textarea:focus, button:focus {
	outline: 2px solid var(--primary-color);
	outline-offset: 2px;
}

/* ============================================
   MENU STYLES (MenuLUW)
   ============================================ */

/* Base Menu Styling */
.luw-top-menu,
.luw-side-menu {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* TOP MENU (.luw-top-menu) - Horizontal navigation with dropdown submenus */
.luw-top-menu {
	background: #2c3e50;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	display: flex;
	position: relative;
}

.luw-top-menu > li {
	position: relative;
}

.luw-top-menu > li > a,
.luw-top-menu > li > span {
	display: block;
	padding: 15px 20px;
	text-decoration: none;
	color: white;
	transition: background-color 0.3s;
	white-space: nowrap;
}

.luw-top-menu > li > a:hover,
.luw-top-menu > li:hover > span {
	background-color: #34495e;
}

.luw-top-menu > li > span {
	font-weight: bold;
	cursor: default;
}

/* Top Menu Dropdown Styling */
.luw-top-menu ul {
	list-style: none;
	padding: 0;
	margin: 0;
	background: white;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	z-index: 1000;
}

.luw-top-menu li:hover > ul {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.luw-top-menu ul li {
	border-bottom: 1px solid #eee;
}

.luw-top-menu ul li:last-child {
	border-bottom: none;
}

.luw-top-menu ul a {
	display: block;
	padding: 12px 15px;
	text-decoration: none;
	color: #333;
	transition: background-color 0.2s;
}

.luw-top-menu ul a:hover {
	background-color: #f8f9fa;
	color: #007cba;
}

.luw-top-menu ul span {
	display: block;
	padding: 12px 15px;
	font-weight: bold;
	color: #495057;
	background-color: #f8f9fa;
}

/* Top Menu Multi-level dropdown positioning */
.luw-top-menu ul ul {
	top: 0;
	left: 100%;
	border-radius: 4px;
}

/* SIDE MENU (.luw-side-menu) - Vertical navigation with nested indentation */
.luw-side-menu {
	background: white;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	width: 250px;
}

.luw-side-menu ul {
	list-style: none;
	padding-left: 20px;
	margin: 5px 0;
	background: #f8f9fa;
	border-left: 2px solid #007cba;
	border-radius: 0 4px 4px 0;
}

.luw-side-menu li {
	border-bottom: 1px solid #eee;
}

.luw-side-menu li:last-child {
	border-bottom: none;
}

.luw-side-menu a {
	display: block;
	padding: 12px 15px;
	text-decoration: none;
	color: #333;
	transition: background-color 0.2s;
}

.luw-side-menu a:hover {
	background-color: #e9ecef;
	color: #007cba;
}

.luw-side-menu span {
	display: block;
	padding: 12px 15px;
	font-weight: bold;
	color: #495057;
	background-color: #f8f9fa;
}

/* Menu Utility Classes */
.luw-top-menu.full-width {
	width: 100%;
	border-radius: 0;
}

.luw-side-menu.compact {
	width: 200px;
}

.luw-side-menu.compact a,
.luw-side-menu.compact span {
	padding: 8px 12px;
	font-size: 14px;
}

/* Dark side menu theme */
.luw-side-menu.dark {
	background: #2c3e50;
	color: white;
}

.luw-side-menu.dark a {
	color: #ecf0f1;
}

.luw-side-menu.dark a:hover {
	background-color: #34495e;
	color: white;
}

.luw-side-menu.dark span {
	background-color: #34495e;
	color: white;
}

.luw-side-menu.dark ul {
	background: #34495e;
	border-left-color: #3498db;
}

/* ============================================
   CARD STYLES (CardLUW)
   ============================================ */

.cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 2rem;
	margin-bottom: 3rem;
}

.card {
	background: white;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #667eea, #764ba2);
}

.card:hover {
	transform: translateY(-8px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
	display: flex;
	align-items: center;
	margin-bottom: 1rem;
}

.card-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea, #764ba2);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
	font-size: 1.2rem;
	margin-right: 1rem;
}

.card-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 0.25rem;
}

.card-subtitle {
	color: #666;
	font-size: 0.9rem;
}

.card-content {
	margin-bottom: 1.5rem;
}

.card-description {
	color: #555;
	line-height: 1.6;
	margin-bottom: 1rem;
}

.card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.meta-item {
	background: #f0f2f5;
	padding: 0.25rem 0.75rem;
	border-radius: 20px;
	font-size: 0.8rem;
	color: #666;
}

.card-actions {
	display: flex;
	gap: 0.75rem;
}

.btn {
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.btn-primary {
	background: linear-gradient(135deg, #667eea, #764ba2);
	color: white;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
	background: transparent;
	color: #667eea;
	border: 2px solid #667eea;
}

.btn-secondary:hover {
	background: #667eea;
	color: white;
}

#cardsContainer {
	margin: 20px 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile Menu Adaptations */
@media (max-width: 768px) {
	/* Window Responsiveness */
	.window {
		min-width: var(--min-width-mobile);
		min-height: var(--min-height-mobile);
		left: 5vw !important;
		top: 10vh !important;
		max-width: 90vw;
		max-height: 80vh;
	}

	.window.minimized {
		width: 150px;
		height: 35px;
		min-width: auto;
		min-height: auto;
	}

	.window.maximized {
		width: 100vw;
		height: 100vh;
	}

	.header {
		height: 50px;
		padding: 15px;
	}

	.maximize-button, .minimize-button, .restore-button, .close-button {
		width: 30px;
		height: 30px;
		margin-left: 8px;
	}

	.resizer {
		width: 20px;
		height: 20px;
	}

	.button-container {
		flex-direction: column;
		gap: 15px;
	}

	.window-button {
		width: 100%;
		padding: 12px;
		font-size: 16px;
	}

	.debug-window {
		width: 90vw;
		max-height: 70vh;
		padding: 15px;
	}

	.modal-content {
		width: 90vw;
		padding: 20px;
	}

	.modal-button {
		padding: 12px 20px;
		font-size: 16px;
		min-width: 120px;
	}

	.window-createNote {
		min-height: 250px;
	}

	[class^="window-create"] .window-content,
	[class*="window-create"] .window-content {
		padding: 15px;
	}

	/* Menu Responsiveness */
	.luw-top-menu {
		flex-direction: column;
	}
	
	.luw-top-menu ul {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: #ecf0f1;
		margin-left: 20px;
	}
	
	.luw-top-menu ul ul {
		margin-left: 40px;
	}

	/* Card Responsiveness */
	.cards-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
		margin-bottom: 2rem;
	}

	.card {
		padding: 1rem;
	}

	.card-actions {
		flex-direction: column;
		gap: 0.5rem;
	}

	.btn {
		width: 100%;
		text-align: center;
	}
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
	.header-text {
		width: 50%;
		font-size: 14px;
	}

	input[type="text"],
	input[type="email"],
	input[type="password"],
	input[type="tel"],
	select,
	textarea {
		font-size: 16px; /* Prevent zoom on focus */
	}

	.card-header {
		flex-direction: column;
		text-align: center;
	}

	.card-avatar {
		margin-right: 0;
		margin-bottom: 0.5rem;
	}
}