:root {
	--primary: #c2135f;
	--primary-light: #818cf8;
	--surface: #ffffff;
	--bg: #f5f3ff;
	--text: #1e1b4b;
	--text-light: #6b7280;
	--accent: #f59e0b;
	--radius: 1.5rem;
	--shadow: 0 20px 35px rgba(0,0,0,0.05), 0 10px 15px -5px rgba(0,0,0,0.02);
	--transition: 0.25s cubic-bezier(0.2, 0.0, 0, 1.0);
	--glass: rgba(255,255,255,0.7);
	--border-light: rgba(255,255,255,0.5);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Tajawal';
}

body {
	background: radial-gradient(circle at 10% 20%, #ede9fe, #e0e7ff);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.2rem;
	color: var(--text);
	backdrop-filter: blur(2px);
	padding: 0;
	margin: 0;
}

body:not(.joined) .container {
	max-width: 600px;
	width: 100%;
	background: var(--glass);
	backdrop-filter: blur(25px);
	-webkit-backdrop-filter: blur(25px);
	border-radius: 6px;
	box-shadow: var(--shadow), 0 0 0 1px var(--border-light);
	padding: 2rem 1.8rem;
	transition: all var(--transition);
	border: 1px solid rgba(255,255,255,0.4);
}

body.joined .container {
	max-width: 100%;
	width: 100vw;
	min-height: 100vh;
	background: var(--glass);
	backdrop-filter: blur(25px);
	-webkit-backdrop-filter: blur(25px);
	border-radius: 0;
	box-shadow: none;
	padding: 2rem 2.5rem;
	transition: all var(--transition);
	border: none;
	display: flex;
	flex-direction: column;
}

.grid-posts {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 0;
}

h1, h2 {
	font-weight: 700;
}

h1 { font-size: 2.4rem; margin-bottom: 0.2rem; }
h2 { font-size: 1.7rem; }

.header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 2rem;
}

.board-code-badge {
	padding: 0.5rem 1.2rem;
	border-radius: 6px;
	font-weight: 600;
	background: rgba(255,255,255,0.8);
	backdrop-filter: blur(12px);
	box-shadow: 0 8px 18px rgba(0,0,0,0.04);
	display: flex;
	align-items: end;
	gap: 0.3rem;
	font-size: 2rem;
}

.grid-posts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.5rem;
	margin: 2rem 0 1.8rem;
	min-height: 220px;
}

.post-card {
	background: rgba(255,255,255,0.75);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 6px;
	padding: 1.5rem 1rem 1.2rem;
	box-shadow: 0 15px 30px rgba(0,0,0,0.04), 0 1px 0 rgba(255,255,255,0.7) inset;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	border: 1px solid rgba(255,255,255,0.6);
	animation: postAppear 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
	transform-origin: center;
    border: 1px ridge #595959a6;
}

@keyframes postAppear {
	0% { opacity: 0; transform: scale(0.85) translateY(20px); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}

.post-card:hover {
	transform: translateY(-6px);
	background: rgba(255,255,255,0.9);
	box-shadow: 0 25px 35px rgba(79,70,229,0.12);
}

.avatar-img {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid white;
	box-shadow: 0 10px 18px rgba(0,0,0,0.1);
	margin-bottom: 0.8rem;
	background: #eef2ff;
}

.post-header {
	display: flex;
	gap: 15px;
	align-items: center;
	width: 100%;
}

.post-name {
	font-weight: 700;
	font-size: 1.2rem;
	color: #c2135f;
	margin-bottom: 0.3rem;
	text-align: right;

}

.post-content {
	color: #374151;
	font-size: 1.3rem;
	line-height: 1.5;
	word-break: break-word;
	margin: 0.5rem 0;
	margin-top: 1rem;
}

.post-time {
	font-size: 0.8rem;
	color: #9ca3af;
	margin-top: auto;
	font-weight: bold;
	text-align: right;
}

input, select {
	padding: 0.85rem 1.2rem;
	border-radius: 6px;
	border: 1px solid #e0e7ff;
	background: rgba(255,255,255,0.7);
	backdrop-filter: blur(8px);
	font-size: 1.2rem;
	outline: none;
	transition: var(--transition);
	min-width: 160px;
	color: #1e1b4b;
}

input:focus, select:focus {
	border-color: #818cf8;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
	background: white;
}

button {
	background: #c2135f;
	color: white;
	border: none;
	padding: 0.85rem 1.8rem;
	border-radius: 6px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	backdrop-filter: blur(10px);
	background: #5a8a70;
	box-shadow: 0 8px 20px rgba(79,70,229,0.35);
	transition: all 0.25s;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	border: 1px solid rgba(255,255,255,0.3);
	letter-spacing: 0.3px;
}

button:hover {
	transform: scale(1.03);
	box-shadow: 0 15px 25px rgba(79,70,229,0.45);
}

button.secondary {
	background: white;
	color: #c2135f;
	box-shadow: 0 8px 18px rgba(0,0,0,0.05);
	border: 1px solid #d4d4f7;
}

.loader-overlay {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(245, 243, 255, 0.7);
	backdrop-filter: blur(18px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	transition: opacity 0.3s;
}

.ai-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.8rem;
}

.spinner {
	width: 70px;
	height: 70px;
	border: 5px solid rgba(79,70,229,0.2);
	border-top: 5px solid #c2135f;
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.hidden {
	display: none;
}

@media (max-width: 600px) {
	.container { padding: 1.5rem 1rem; }
	input, select { width: 100%; }
}
