:root {
	--bg-main: #313338;
	--bg-card: #2b2d31;
	--bg-input: #1e1f22;
	--bg-hover: #35373c;
	--text-main: #dbdee1;
	--text-muted: #949ba4;
	--text-heading: #f2f3f5;
	--border-color: #3f4147;
	--accent: #5865F2;
	--accent-hover: #4752C4;
	--accent-success: #23a559;
}

body { 
	font-family: 'Inter', 'Nunito', sans-serif; 
	background-color: var(--bg-main); 
	color: var(--text-main); 
	margin: 0; 
	padding: 0; 
}

/* Nav tipo Toolkit */
nav {
	background-color: #1e1f22;
	border-bottom: 1px solid var(--border-color);
	padding: 0 40px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 100;
}

.nav-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--text-heading);
	text-decoration: none;
	font-weight: 700;
	font-size: 18px;
}
.nav-logo .icon {
	background-color: var(--accent);
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}

.nav-tabs {
	display: flex;
	gap: 30px;
	height: 100%;
}
.nav-tab {
	display: flex;
	align-items: center;
	color: var(--text-muted);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	border-bottom: 3px solid transparent;
	transition: color 0.2s;
}
.nav-tab:hover { color: var(--text-main); }
.nav-tab.active {
	color: var(--text-heading);
	border-bottom-color: var(--accent);
}

.container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

/* Breadcrumb */
.breadcrumb {
	display: flex;
	gap: 10px;
	font-size: 14px;
	color: var(--text-muted);
	margin-bottom: 24px;
	align-items: center;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--text-main); }

/* Header e inputs unificados */
form.new-thread-form { background-color: var(--bg-card); padding: 24px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
form.new-thread-form h3 { margin-top: 0; color: #b5bac1; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.input-group { display: flex; gap: 15px; margin-bottom: 15px; }
.input-group input { flex: 1; }
input[type="text"], textarea { width: 100%; padding: 12px 14px; border-radius: 8px; border: none; background-color: var(--bg-input); color: var(--text-main); font-family: inherit; font-size: 15px; outline: none; box-sizing: border-box; }
input[type="text"]:focus, textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
button { background-color: var(--accent); color: white; border: none; padding: 10px 20px; border-radius: 4px; font-weight: 600; cursor: pointer; font-size: 14px; transition: background 0.2s; width: 100%; box-sizing: border-box; }
button:hover { background-color: var(--accent-hover); }

/* Listado de hilos */
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-card { background-color: var(--bg-card); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; transition: background 0.1s, transform 0.1s; text-decoration: none; color: inherit; border: 1px solid transparent; }
.thread-card:hover { background-color: var(--bg-hover); border-color: var(--border-color); }
.thread-card .info { display: flex; flex-direction: column; gap: 6px; }
.thread-card h3 { margin: 0; color: var(--text-heading); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.thread-card h3::before { content: '#'; color: #80848e; font-size: 18px; font-weight: 400; }
.thread-card .meta { font-size: 13px; color: var(--text-muted); }
.thread-card .stats { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #b5bac1; background: var(--bg-input); padding: 6px 12px; border-radius: 16px; font-weight: 500; }
.stats span { color: var(--text-heading); }

/* Dentro del hilo */
.thread-header { 
	background: var(--bg-card);
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 24px;
	border: 1px solid var(--border-color);
}
.thread-header h2 { margin: 0 0 12px 0; color: var(--text-heading); font-size: 24px; display: flex; align-items: center; gap: 8px; }
.thread-header .meta-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: var(--text-muted);
}
.meta-avatar {
	width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
	display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 11px;
}

/* Post Layout inspirado en Toolkit */
.messages { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
.post {
	display: flex;
	background: var(--bg-card);
	border-radius: 12px;
	border: 1px solid var(--border-color);
	overflow: hidden;
}

.post-sidebar {
	width: 140px;
	background: rgba(30, 31, 34, 0.5);
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	border-right: 1px solid var(--border-color);
	flex-shrink: 0;
}
.post-avatar {
	width: 64px; height: 64px; border-radius: 12px; background: var(--accent);
	display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 28px;
	margin-bottom: 12px;
}
.post-username { color: var(--text-heading); font-weight: 700; text-align: center; margin-bottom: 4px; word-break: break-all;}
.post-role { font-size: 11px; text-transform: uppercase; background: var(--accent); color: white; padding: 2px 8px; border-radius: 4px; font-weight: 700; margin-bottom: 12px; }
.my-message .post-role { background: var(--accent-success); content: "TÚ"; }

.post-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}
.post-header {
	padding: 12px 20px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: var(--text-muted);
}
.ai-btn {
	background: transparent;
	border: 1px solid var(--accent);
	color: var(--accent);
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	cursor: pointer;
	transition: all 0.2s;
	font-weight: 600;
	width: auto;
}
.ai-btn:hover {
	background: var(--accent);
	color: white;
}
.post-content {
	padding: 20px;
	color: var(--text-main);
	line-height: 1.6;
	font-size: 15px;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Modificadores de Mi Mensaje */
.post.my-message {
	border-color: rgba(88, 101, 242, 0.5);
}
.post.my-message .post-sidebar {
	background: rgba(88, 101, 242, 0.05);
}
.post.my-message .post-avatar {
	background: var(--accent-success);
}

.highlight-new { animation: fadeInHighlight 1.5s ease-out; }
@keyframes fadeInHighlight { 
	0% { opacity: 0; transform: translateY(10px); box-shadow: 0 0 0 2px #f1c40f; } 
	20% { opacity: 1; transform: translateY(0); box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } 
	100% { box-shadow: 0 0 0 0 transparent; } 
}

/* Adjuntos */
.attachment { background-color: var(--bg-input); padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); display: inline-flex; align-items: center; gap: 10px; max-width: max-content; margin-top: 10px; }
.attachment a { color: var(--accent); text-decoration: none; font-weight: 600; }
.attachment a:hover { text-decoration: underline; }
.attachment-img { max-width: 100%; max-height: 400px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border-color); margin-top: 10px; display: block; }

/* Reply Form (estilo foro profesional) */
.reply-form-container { background-color: var(--bg-card); padding: 24px; border-radius: 12px; margin-top: 30px; border: 1px solid var(--border-color); }
.reply-form-container h3 { margin-top: 0; color: var(--text-heading); margin-bottom: 20px; display: flex; align-items: center; gap: 8px;}
.reply-textarea-wrapper { background: var(--bg-input); border-radius: 8px; border: 1px solid transparent; transition: border-color 0.2s; overflow: hidden; margin-bottom: 15px;}
.reply-textarea-wrapper:focus-within { border-color: var(--accent); }
.reply-textarea-wrapper textarea { background: transparent; border: none; border-radius: 0; outline: none; margin-bottom: 0; resize: vertical; min-height: 120px;}
.reply-tools { display: flex; gap: 10px; padding: 10px 14px; background: rgba(0,0,0,0.1); border-top: 1px solid var(--border-color); }

.file-upload-wrapper { position: relative; overflow: hidden; display: inline-block; cursor: pointer; }
.file-upload-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.tool-btn { background: transparent; color: var(--text-muted); border: none; padding: 6px 12px; border-radius: 4px; font-weight: 500; cursor: pointer; font-size: 13px; transition: all 0.2s; width: auto; }
.tool-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }

.form-actions-bottom { display: flex; justify-content: space-between; align-items: center; }
.btn-submit { width: auto; padding: 10px 30px; font-size: 15px; }
#file-name-display { font-size: 13px; color: var(--text-muted); margin-left: 10px; font-weight: 500; }

.empty { text-align: center; color: var(--text-muted); padding: 40px; background: var(--bg-card); border-radius: 12px; border: 1px dashed var(--border-color); font-style: italic;}
.user-badge { background: var(--bg-input); padding: 6px 12px; border-radius: 8px; font-size: 13px; color: #b5bac1; display: inline-block; margin-bottom: 15px; border: 1px solid var(--border-color); }
.user-badge span { color: var(--text-heading); font-weight: 600; }
