/* LF Consultas — Frontend */
.lfc-wrap {
	max-width: 720px;
	margin: 2rem auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1f2937;
}

.lfc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.lfc-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
	color: #111827;
}

.lfc-btn-new {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: #0d9488;
	color: #fff;
	border: none;
	padding: 0.55rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}
.lfc-btn-new:hover { background: #0f766e; }
.lfc-plus { font-size: 1.25rem; line-height: 1; font-weight: 300; }

/* Formulario */
.lfc-form {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.lfc-course-badge {
	display: inline-block;
	background: #ecfdf5;
	color: #065f46;
	padding: 0.4rem 0.75rem;
	border-radius: 6px;
	font-size: 0.85rem;
	margin-bottom: 1rem;
}
.lfc-course-badge .lfc-label { color: #6b7280; margin-right: 0.25rem; }

.lfc-field { margin-bottom: 1rem; }
.lfc-field label {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	margin-bottom: 0.4rem;
	color: #374151;
}

.lfc-field select,
.lfc-field textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
	font-family: inherit;
	color: #111827;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.lfc-field select:focus,
.lfc-field textarea:focus {
	outline: none;
	border-color: #0d9488;
	box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.lfc-field textarea { resize: vertical; min-height: 100px; }

/* Dropzone */
.lfc-dropzone {
	border: 2px dashed #d1d5db;
	border-radius: 8px;
	background: #fff;
	transition: border-color 0.15s, background 0.15s;
	cursor: pointer;
}
.lfc-dropzone.lfc-drag-over {
	border-color: #0d9488;
	background: #f0fdfa;
}
.lfc-dropzone-inner {
	padding: 1.5rem;
	text-align: center;
	color: #6b7280;
}
.lfc-dropzone-inner svg { color: #9ca3af; margin-bottom: 0.5rem; }
.lfc-dropzone-inner p { margin: 0; font-size: 0.9rem; }

.lfc-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0 0.75rem 0.75rem;
}
.lfc-previews:empty { padding: 0; }
.lfc-preview {
	position: relative;
	width: 70px;
	height: 70px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}
.lfc-preview img { width: 100%; height: 100%; object-fit: cover; }
.lfc-preview-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(0,0,0,0.7);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 0.75rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Actions */
.lfc-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1rem;
}
.lfc-btn-cancel {
	background: transparent;
	border: 1px solid #d1d5db;
	color: #6b7280;
	padding: 0.55rem 1rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
}
.lfc-btn-cancel:hover { background: #f3f4f6; }
.lfc-btn-submit {
	background: #0d9488;
	color: #fff;
	border: none;
	padding: 0.55rem 1.25rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
}
.lfc-btn-submit:hover { background: #0f766e; }
.lfc-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.lfc-form-msg { margin-top: 0.75rem; font-size: 0.85rem; }
.lfc-form-msg.ok { color: #065f46; }
.lfc-form-msg.err { color: #b91c1c; }

/* Listado */
.lfc-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lfc-empty {
	text-align: center;
	color: #9ca3af;
	padding: 2rem;
	font-style: italic;
}

.lfc-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1rem 1.25rem;
	transition: border-color 0.15s;
}
.lfc-card:hover { border-color: #d1d5db; }

.lfc-card-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
	font-size: 0.8rem;
	color: #6b7280;
}
.lfc-cat {
	background: #f3f4f6;
	color: #374151;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	font-weight: 500;
}
.lfc-estado {
	margin-left: auto;
	padding: 0.15rem 0.6rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 500;
}
.lfc-estado-pendiente { background: #fef3c7; color: #92400e; }
.lfc-estado-respondida { background: #d1fae5; color: #065f46; }

.lfc-card-msg { color: #111827; font-size: 0.95rem; line-height: 1.5; }

.lfc-card-adjuntos {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}
.lfc-card-adjuntos a {
	position: relative;
	display: inline-block;
}
.lfc-card-adjuntos img {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	cursor: zoom-in;
	transition: border-color 0.15s, box-shadow 0.15s;
	display: block;
}
.lfc-card-adjuntos a:hover img {
	border-color: #0d9488;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.lfc-card-adjuntos a::after {
	content: '';
	position: absolute;
	top: 0;
	left: calc(100% + 10px);
	width: 400px;
	height: 400px;
	background-image: var(--lfc-preview);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: top left;
	background-color: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.15s, visibility 0.15s;
	z-index: 9999;
}
.lfc-card-adjuntos a:hover::after {
	opacity: 1;
	visibility: visible;
}
.lfc-card-adjuntos a.lfc-preview-left::after {
	left: auto;
	right: calc(100% + 10px);
}

/* Mobile: desactivar hover preview (no tiene sentido con touch) */
@media (max-width: 768px) {
	.lfc-card-adjuntos a::after { display: none; }
}

.lfc-resp-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.75rem;
	background: transparent;
	border: 1px solid #d1d5db;
	color: #0d9488;
	padding: 0.45rem 0.85rem;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, border-color 0.15s;
}
.lfc-resp-toggle:hover {
	background: #f0fdfa;
	border-color: #0d9488;
}
.lfc-resp-arrow {
	font-size: 0.7rem;
	transition: transform 0.2s ease;
}
.lfc-resp-toggle[aria-expanded="true"] .lfc-resp-arrow {
	transform: rotate(180deg);
}

.lfc-card-respuestas {
	margin-top: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	animation: lfc-fade-in 0.2s ease;
}
.lfc-card-respuestas[hidden] { display: none !important; }
.lfc-thread-user {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* Mensaje del profesor (admin) — teal a la izquierda */
.lfc-card-respuestas .lfc-msg-admin {
	padding: 0.85rem 1rem;
	background: #f0fdfa;
	border-left: 3px solid #0d9488;
	border-radius: 0 8px 8px 0;
	margin-right: 2rem;
}
.lfc-card-respuestas .lfc-msg-admin .lfc-resp-label {
	color: #0d9488;
}

/* Mensaje del alumno (tú) — morado a la derecha */
.lfc-card-respuestas .lfc-msg-alumno {
	padding: 0.85rem 1rem;
	background: #f5f3ff;
	border-right: 3px solid #7c3aed;
	border-radius: 8px 0 0 8px;
	margin-left: 2rem;
}
.lfc-card-respuestas .lfc-msg-alumno .lfc-resp-label {
	color: #7c3aed;
	justify-content: flex-end;
	flex-direction: row-reverse;
}

.lfc-card-respuestas .lfc-resp-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.35rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
}
.lfc-card-respuestas .lfc-resp-fecha {
	color: #9ca3af;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	font-size: 0.75rem;
}
.lfc-card-respuestas .lfc-resp-body {
	color: #111827;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Caja de respuesta del alumno */
.lfc-user-reply-box {
	margin-top: 0.5rem;
	padding: 0.85rem;
	background: #fafafa;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}
.lfc-user-reply-box label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.35rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.lfc-user-reply-text {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
	font-family: inherit;
	color: #111827;
	box-sizing: border-box;
	resize: vertical;
	min-height: 60px;
}
.lfc-user-reply-text:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.lfc-user-reply-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.5rem;
}
.lfc-user-reply-msg { font-size: 0.85rem; }
.lfc-user-reply-msg.ok { color: #065f46; }
.lfc-user-reply-msg.err { color: #b91c1c; }
.lfc-user-reply-btn {
	background: #7c3aed;
	color: #fff;
	border: none;
	padding: 0.5rem 1.1rem;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
}
.lfc-user-reply-btn:hover { background: #6d28d9; }
.lfc-user-reply-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Legacy (compatibilidad con tarjeta de una sola respuesta) */
.lfc-card-respuesta {
	margin-top: 0.75rem;
	padding: 0.85rem 1rem;
	background: #f0fdfa;
	border-left: 3px solid #0d9488;
	border-radius: 0 6px 6px 0;
	animation: lfc-fade-in 0.2s ease;
}
@keyframes lfc-fade-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 500px) {
	.lfc-card-respuestas .lfc-msg-admin { margin-right: 0.5rem; }
	.lfc-card-respuestas .lfc-msg-alumno { margin-left: 0.5rem; }
}
.lfc-resp-label {
	font-size: 0.75rem;
	font-weight: 600;
	color: #0d9488;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.35rem;
}
.lfc-resp-body { color: #111827; font-size: 0.95rem; line-height: 1.5; }

.lfc-notice {
	padding: 1rem;
	background: #fef3c7;
	color: #92400e;
	border-radius: 6px;
	text-align: center;
}

/* Mobile */
@media (max-width: 600px) {
	.lfc-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
	.lfc-btn-new { justify-content: center; }
	.lfc-btn-text { display: inline; }
}

/* Lightbox */
.lfc-lightbox {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.9);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: lfc-lb-fade 0.15s ease;
}
@keyframes lfc-lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lfc-lightbox img {
	max-width: 95vw;
	max-height: 92vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lfc-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	background: rgba(255,255,255,0.15);
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 22px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.lfc-lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lfc-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	background: rgba(255,255,255,0.15);
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 28px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.lfc-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lfc-lightbox-prev { left: 20px; }
.lfc-lightbox-next { right: 20px; }
.lfc-lightbox-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	background: rgba(0,0,0,0.5);
	padding: 6px 14px;
	border-radius: 14px;
	font-size: 13px;
}

/* ===== Aviso de filtro de curso ===== */
.lfc-course-filter-notice {
	background: #ecfdf5;
	color: #065f46;
	padding: 0.6rem 1rem;
	border-radius: 6px;
	font-size: 0.85rem;
	margin-bottom: 1rem;
	border-left: 3px solid #0d9488;
}

/* ===== Pestañas del alumno ===== */
.lfc-user-tabs {
	display: flex;
	gap: 0.25rem;
	margin-bottom: 1rem;
	border-bottom: 1px solid #e5e7eb;
}
.lfc-user-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 0.75rem 1.1rem;
	font-size: 0.95rem;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	font-family: inherit;
	transition: color 0.15s, border-color 0.15s;
	margin-bottom: -1px;
}
.lfc-user-tab:hover { color: #0d9488; }
.lfc-user-tab-active {
	color: #0d9488;
	border-bottom-color: #0d9488;
}
.lfc-user-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 20px;
	padding: 0 7px;
	background: #e5e7eb;
	color: #374151;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}
.lfc-user-tab-active .lfc-user-tab-count-pend {
	background: #fef3c7;
	color: #92400e;
}
.lfc-user-tab-active .lfc-user-tab-count-resp {
	background: #d1fae5;
	color: #065f46;
}
.lfc-user-tab-content[hidden] { display: none; }

/* ===== Tarjetas plegables ===== */
.lfc-card-head-toggle {
	cursor: pointer;
	user-select: none;
	transition: background 0.15s;
	padding: 0.25rem 0;
	margin: -0.25rem 0;
	border-radius: 4px;
}
.lfc-card-head-toggle:hover {
	background: #fafafa;
}
.lfc-card-arrow {
	display: inline-block;
	font-size: 10px;
	color: #9ca3af;
	margin-right: 4px;
	transition: transform 0.15s ease;
}
.lfc-card-preview {
	flex: 1;
	color: #6b7280;
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
.lfc-card.lfc-card-collapsed .lfc-card-body {
	display: none;
}
.lfc-card.lfc-card-collapsed .lfc-card-head-toggle {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}
.lfc-card:not(.lfc-card-collapsed) .lfc-card-preview {
	display: none;
}

/* Imágenes adjuntas dentro de respuestas del hilo (vista alumno) */
.lfc-resp-adjuntos-front {
	margin-top: 8px;
	gap: 6px;
}
.lfc-resp-adjuntos-front img {
	width: 90px;
	height: 90px;
}

/* ===== Dropzone de adjuntos en respuestas del alumno ===== */
.lfc-user-reply-dropzone {
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
	border: 2px dashed #d1d5db;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.lfc-user-reply-dropzone.lfc-drag-over {
	border-color: #7c3aed;
	background: #f5f3ff;
}
.lfc-user-reply-dz-inner {
	padding: 10px 14px;
	color: #9ca3af;
	font-size: 0.85rem;
	text-align: center;
}
.lfc-user-reply-dz-inner svg {
	color: #9ca3af;
}
.lfc-user-reply-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 10px 10px;
}
.lfc-user-reply-previews:empty { padding: 0; }
.lfc-user-reply-preview {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}
.lfc-user-reply-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.lfc-user-reply-preview-rm {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: rgba(0,0,0,0.7);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 11px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
