/**
 * FichiandoApp - Manual de Usuario
 * Estilos para la documentación
 */

:root {
	--primary: #3b82f6;
	--primary-dark: #2563eb;
	--primary-light: #60a5fa;
	--secondary: #64748b;
	--success: #16a34a;
	--warning: #d97706;
	--error: #dc2626;
	--info: #0891b2;

	--bg-dark: #ffffff;
	--bg-card: #f8fafc;
	--bg-hover: #f1f5f9;
	--text-primary: #1e293b;
	--text-secondary: #475569;
	--text-muted: #94a3b8;
	--border-color: #e2e8f0;

	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;

	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

	--transition: all 0.2s ease;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Iconos SVG */
.icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex-shrink: 0;
}

.icon-lg {
	width: 24px;
	height: 24px;
}

.icon-xl {
	width: 32px;
	height: 32px;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	background: var(--bg-dark);
	color: var(--text-primary);
	line-height: 1.6;
	min-height: 100vh;
}

/* Layout Principal */
.manual-container {
	display: flex;
	min-height: 100vh;
}

/* Sidebar / Índice */
.manual-sidebar {
	width: 280px;
	background: var(--bg-card);
	border-right: 1px solid var(--border-color);
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	overflow-y: auto;
	z-index: 100;
	transition: transform 0.3s ease;
}

.sidebar-header {
	padding: 24px 20px;
	border-bottom: 1px solid var(--border-color);
	text-align: center;
}

.sidebar-logo {
	width: 60px;
	height: 60px;
	margin-bottom: 12px;
	border-radius: 12px;
}

.sidebar-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
}

.sidebar-version {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 4px;
}

/* Búsqueda */
.sidebar-search {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border-color);
}

.search-input {
	width: 100%;
	padding: 10px 14px;
	padding-left: 38px;
	background: var(--bg-dark);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	color: var(--text-primary);
	font-size: 0.9rem;
	transition: var(--transition);
}

.search-input:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-wrapper {
	position: relative;
}

.search-wrapper i {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
}

/* Navegación */
.sidebar-nav {
	padding: 16px 0;
}

.nav-section {
	margin-bottom: 8px;
}

.nav-section-title {
	padding: 8px 20px;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	font-weight: 600;
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px;
	color: var(--text-secondary);
	text-decoration: none;
	transition: var(--transition);
	border-left: 3px solid transparent;
}

.nav-link:hover {
	background: var(--bg-hover);
	color: var(--text-primary);
}

.nav-link.active {
	background: rgba(59, 130, 246, 0.1);
	color: var(--primary);
	border-left-color: var(--primary);
}

.nav-link i {
	width: 20px;
	text-align: center;
	font-size: 0.95rem;
}

.nav-link span {
	font-size: 0.9rem;
}

/* Subnav */
.nav-subitems {
	display: none;
	padding-left: 32px;
}

.nav-section.expanded .nav-subitems {
	display: block;
}

.nav-sublink {
	display: block;
	padding: 6px 20px;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.85rem;
	transition: var(--transition);
}

.nav-sublink:hover {
	color: var(--text-primary);
}

.nav-sublink.active {
	color: var(--primary);
}

/* Contenido Principal */
.manual-content {
	flex: 1;
	margin-left: 280px;
	padding: 40px 60px;
	max-width: 900px;
}

/* Header del contenido */
.content-header {
	margin-bottom: 40px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
	font-size: 2.25rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 12px;
}

.content-header .breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.content-header .breadcrumb a {
	color: var(--primary);
	text-decoration: none;
}

.content-header .breadcrumb a:hover {
	text-decoration: underline;
}

/* Secciones de contenido */
.content-section {
	margin-bottom: 48px;
}

.content-section h2 {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--primary);
	display: inline-block;
}

.content-section h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 24px 0 12px;
}

.content-section p {
	color: var(--text-secondary);
	margin-bottom: 16px;
}

.content-section ul, .content-section ol {
	margin: 16px 0;
	padding-left: 24px;
	color: var(--text-secondary);
}

.content-section li {
	margin-bottom: 8px;
}

/* Cards informativos */
.info-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 20px;
	margin: 20px 0;
}

.info-card.tip {
	border-left: 4px solid var(--success);
	background: rgba(34, 197, 94, 0.05);
}

.info-card.warning {
	border-left: 4px solid var(--warning);
	background: rgba(245, 158, 11, 0.05);
}

.info-card.danger {
	border-left: 4px solid var(--error);
	background: rgba(239, 68, 68, 0.05);
}

.info-card.info {
	border-left: 4px solid var(--info);
	background: rgba(6, 182, 212, 0.05);
}

.info-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	font-weight: 600;
	color: var(--text-primary);
}

.info-card.tip .info-card-header { color: var(--success); }
.info-card.warning .info-card-header { color: var(--warning); }
.info-card.danger .info-card-header { color: var(--error); }
.info-card.info .info-card-header { color: var(--info); }

/* Pasos / Steps */
.steps {
	counter-reset: step;
	margin: 24px 0;
}

.step {
	position: relative;
	padding-left: 60px;
	padding-bottom: 32px;
	border-left: 2px solid var(--border-color);
	margin-left: 20px;
}

.step:last-child {
	border-left-color: transparent;
	padding-bottom: 0;
}

.step::before {
	counter-increment: step;
	content: counter(step);
	position: absolute;
	left: -21px;
	top: 0;
	width: 40px;
	height: 40px;
	background: var(--primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1rem;
	color: white;
}

.step-title {
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 8px;
	font-size: 1.1rem;
}

.step-content {
	color: var(--text-secondary);
}

/* Imágenes / Screenshots */
.screenshot-container {
	margin: 24px 0;
	text-align: center;
}

.screenshot {
	max-width: 500px;
	margin: 0 auto;
	border-radius: var(--radius-md);
	overflow: hidden;
	border: 1px solid var(--border-color);
	box-shadow: var(--shadow-md);
	display: block;
}

.screenshot img {
	width: 100%;
	display: block;
}

img.screenshot {
	max-width: 500px;
	margin: 0 auto 8px;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-color);
	box-shadow: var(--shadow-md);
}

.screenshot-caption {
	padding: 8px 16px;
	font-size: 0.85rem;
	color: var(--text-muted);
	text-align: center;
}

/* Tablas */
.table-container {
	overflow-x: auto;
	margin: 20px 0;
}

.manual-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--bg-card);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.manual-table th,
.manual-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--border-color);
}

.manual-table th {
	background: var(--bg-hover);
	font-weight: 600;
	color: var(--text-primary);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.manual-table td {
	color: var(--text-secondary);
}

.manual-table tr:last-child td {
	border-bottom: none;
}

.manual-table tr:hover td {
	background: var(--bg-hover);
}

/* Código */
code {
	background: var(--bg-hover);
	padding: 2px 8px;
	border-radius: 4px;
	font-family: 'Consolas', 'Monaco', monospace;
	font-size: 0.9em;
	color: var(--primary-dark);
}

pre {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	padding: 20px;
	border-radius: var(--radius-md);
	overflow-x: auto;
	margin: 16px 0;
}

pre code {
	padding: 0;
	background: transparent;
}

/* Teclas */
kbd {
	display: inline-block;
	padding: 3px 8px;
	font-size: 0.8em;
	font-family: inherit;
	background: var(--bg-hover);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	box-shadow: 0 2px 0 var(--border-color);
	color: var(--text-primary);
}

/* Botón de acción */
.action-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: var(--radius-md);
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: var(--transition);
}

.action-btn:hover {
	background: var(--primary-dark);
	transform: translateY(-1px);
}

.action-btn.secondary {
	background: var(--bg-hover);
	color: var(--text-primary);
}

.action-btn.secondary:hover {
	background: var(--secondary);
}

/* FAQ */
.faq-item {
	margin-bottom: 16px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.faq-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--bg-card);
	cursor: pointer;
	font-weight: 500;
	color: var(--text-primary);
	transition: var(--transition);
}

.faq-question:hover {
	background: var(--bg-hover);
}

.faq-question i {
	transition: transform 0.3s ease;
}

.faq-item.open .faq-question i {
	transform: rotate(180deg);
}

.faq-answer {
	display: none;
	padding: 16px 20px;
	color: var(--text-secondary);
	border-top: 1px solid var(--border-color);
}

.faq-item.open .faq-answer {
	display: block;
}

/* Fichi Ayudante */
.fichi-helper {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 1000;
}

.fichi-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-lg);
	transition: var(--transition);
}

.fichi-btn:hover {
	transform: scale(1.1);
}

.fichi-btn i {
	font-size: 1.5rem;
	color: white;
}

.fichi-chat {
	position: absolute;
	bottom: 70px;
	right: 0;
	width: 350px;
	background: var(--bg-card);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	display: none;
	overflow: hidden;
}

.fichi-chat.open {
	display: block;
	animation: slideUp 0.3s ease;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fichi-chat-header {
	padding: 16px 20px;
	background: var(--primary);
	display: flex;
	align-items: center;
	gap: 12px;
}

.fichi-chat-header img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.fichi-chat-header-text h4 {
	color: white;
	font-size: 1rem;
}

.fichi-chat-header-text span {
	color: rgba(255,255,255,0.8);
	font-size: 0.8rem;
}

.fichi-chat-body {
	padding: 20px;
	max-height: 300px;
	overflow-y: auto;
}

.fichi-message {
	background: var(--bg-dark);
	padding: 12px 16px;
	border-radius: var(--radius-md);
	margin-bottom: 12px;
	color: var(--text-secondary);
	font-size: 0.9rem;
}

.fichi-chat-input {
	display: flex;
	padding: 16px;
	border-top: 1px solid var(--border-color);
	gap: 10px;
}

.fichi-chat-input input {
	flex: 1;
	padding: 10px 14px;
	background: var(--bg-dark);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	color: var(--text-primary);
	font-size: 0.9rem;
}

.fichi-chat-input input:focus {
	outline: none;
	border-color: var(--primary);
}

.fichi-chat-input button {
	padding: 10px 16px;
	background: var(--primary);
	border: none;
	border-radius: var(--radius-md);
	color: white;
	cursor: pointer;
}

/* Mobile Toggle */
.sidebar-toggle {
	display: none;
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 200;
	width: 44px;
	height: 44px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	cursor: pointer;
	align-items: center;
	justify-content: center;
}

.sidebar-toggle i {
	font-size: 1.2rem;
	color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
	.manual-content {
		padding: 40px 30px;
	}
}

@media (max-width: 768px) {
	.sidebar-toggle {
		display: flex;
	}

	.manual-sidebar {
		transform: translateX(-100%);
	}

	.manual-sidebar.open {
		transform: translateX(0);
	}

	.manual-content {
		margin-left: 0;
		padding: 80px 20px 40px;
	}

	.content-header h1 {
		font-size: 1.75rem;
	}

	.fichi-chat {
		width: calc(100vw - 48px);
		right: -12px;
	}
}

/* Print styles */
@media print {
	.manual-sidebar,
	.fichi-helper,
	.sidebar-toggle {
		display: none !important;
	}

	.manual-content {
		margin-left: 0;
		padding: 20px;
		max-width: 100%;
	}

	body {
		background: white;
		color: black;
	}

	.info-card {
		border: 1px solid #ccc;
		background: #f9f9f9;
	}
}
