/*
Theme Name: Asambleas Acción Eficaz
Theme URI: https://accioneficaz.com
Author: Acción Eficaz - Christian Ostos
Author URI: https://accioneficaz.com
Description: Tema optimizado para el plugin Asambleas AE. Diseñado para alto rendimiento con soporte para 1000+ usuarios concurrentes. Compatible con sistema de login personalizado, dark mode y totalmente responsive.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: asambleas-ae-theme
Tags: custom-header, custom-menu, featured-images, threaded-comments, translation-ready, dark-mode, performance-optimized
*/

/**
 * CSS Variables - Light Mode (Default)
 */
:root {
	/* Colores principales del plugin */
	--wvp-primary: #2271b1;
	--wvp-primary-dark: #135e96;
	--wvp-secondary: #646970;
	--wvp-success: #00a32a;
	--wvp-warning: #dba617;
	--wvp-danger: #d63638;
	--wvp-info: #72aee6;

	/* Colores de fondo y texto */
	--wvp-bg-light: #f6f7f7;
	--wvp-bg-white: #ffffff;
	--wvp-border: #dcdcde;
	--wvp-text: #1d2327;
	--wvp-text-light: #646970;

	/* Sombras */
	--wvp-shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
	--wvp-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
	--wvp-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

	/* Bordes redondeados */
	--wvp-radius: 8px;
	--wvp-radius-sm: 4px;
	--wvp-radius-lg: 12px;

	/* Header y Footer */
	--header-height: 60px;
	--footer-height: 50px;
}

/**
 * Dark Mode Variables
 */
body.dark-mode {
	--wvp-primary: #4a9eff;
	--wvp-primary-dark: #2271b1;
	--wvp-secondary: #a0a5aa;
	--wvp-success: #00d936;
	--wvp-warning: #ffca28;
	--wvp-danger: #ff5252;
	--wvp-info: #40c4ff;

	--wvp-bg-light: #1a1a1a;
	--wvp-bg-white: #2d2d2d;
	--wvp-border: #3d3d3d;
	--wvp-text: #e4e4e7;
	--wvp-text-light: #a0a5aa;

	--wvp-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
	--wvp-shadow-md: 0 4px 6px rgba(0,0,0,0.3);
	--wvp-shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
}

/**
 * Reset y Base
 */
* {
	box-sizing: border-box;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--wvp-text);
	background-color: var(--wvp-bg-light);
	overflow-x: hidden;
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout Principal */
.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--header-height);
	background: var(--wvp-bg-white);
	border-bottom: 2px solid var(--wvp-border);
	box-shadow: var(--wvp-shadow-sm);
	z-index: 999;
	transition: all 0.3s ease;
}

/* Ajuste cuando hay admin bar visible */
body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

.site-content {
	flex: 1;
	margin-top: var(--header-height);
	margin-bottom: var(--footer-height);
	width: 100%;
	padding: 0;
}

.site-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: var(--footer-height);
	background: var(--wvp-bg-white);
	border-top: 2px solid var(--wvp-border);
	box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
	z-index: 999;
	transition: all 0.3s ease;
}

/**
 * Header Styles
 */
.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 20px;
	max-width: 100%;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 10px;
}

.site-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--wvp-text);
	white-space: nowrap;
}

.site-title a {
	color: var(--wvp-text);
	text-decoration: none;
	transition: color 0.3s ease;
}

.site-title a:hover {
	color: var(--wvp-primary);
}

.header-controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Dark Mode Toggle Button - Estilo minimalista */
.dark-mode-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: transparent;
	color: #646970;
	border: 1px solid #dcdcde;
	border-radius: var(--wvp-radius);
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.dark-mode-toggle:hover {
	background: #f6f7f7;
	border-color: #2271b1;
	color: #2271b1;
}

.dark-mode-toggle svg,
.dark-mode-toggle .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
	transition: color 0.2s ease;
}

/* Dark mode activo */
body.dark-mode .dark-mode-toggle {
	background: rgba(255,255,255,0.05);
	border-color: #a0a5aa;
	color: #e4e4e7;
}

body.dark-mode .dark-mode-toggle:hover {
	background: rgba(255,255,255,0.1);
	border-color: #ffffff;
	color: #ffffff;
}

/* Menu Toggle Button (Hamburger) - Estilo minimalista */
.menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: transparent;
	color: #646970;
	border: 1px solid #dcdcde;
	border-radius: var(--wvp-radius);
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.menu-toggle:hover {
	background: #f6f7f7;
	border-color: #2271b1;
}

.menu-toggle:hover .hamburger span {
	background: #2271b1;
}

.menu-toggle .hamburger {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 20px;
}

.menu-toggle .hamburger span {
	display: block;
	width: 100%;
	height: 2px;
	background: #646970;
	border-radius: 2px;
	transition: all 0.3s ease;
}

/* Dark mode */
body.dark-mode .menu-toggle {
	background: rgba(255,255,255,0.05);
	border-color: #a0a5aa;
}

body.dark-mode .menu-toggle:hover {
	background: rgba(255,255,255,0.1);
	border-color: #ffffff;
}

body.dark-mode .menu-toggle .hamburger span {
	background: #e4e4e7;
}

body.dark-mode .menu-toggle:hover .hamburger span {
	background: #ffffff;
}

.menu-toggle.active .hamburger span:nth-child(1) {
	transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger span:nth-child(2) {
	opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
	transform: rotate(-45deg) translate(6px, -6px);
}

/**
 * Sidebar Menu
 */
.sidebar-menu {
	position: fixed;
	top: var(--header-height);
	right: -300px;
	width: 300px;
	height: calc(100vh - var(--header-height) - var(--footer-height));
	background: var(--wvp-bg-white);
	box-shadow: -4px 0 10px rgba(0,0,0,0.1);
	overflow-y: auto;
	transition: right 0.3s ease;
	z-index: 998;
	padding: 20px 0;
}

/* Ajuste sidebar cuando hay admin bar */
body.admin-bar .sidebar-menu {
	top: calc(var(--header-height) + 32px);
	height: calc(100vh - var(--header-height) - var(--footer-height) - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .sidebar-menu {
		top: calc(var(--header-height) + 46px);
		height: calc(100vh - var(--header-height) - var(--footer-height) - 46px);
	}
}

.sidebar-menu.active {
	right: 0;
}

.sidebar-menu .menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sidebar-menu .menu li {
	margin: 0;
	border-bottom: 1px solid var(--wvp-border);
}

.sidebar-menu .menu li:last-child {
	border-bottom: none;
}

.sidebar-menu .menu a {
	display: block;
	padding: 15px 20px;
	color: var(--wvp-text);
	text-decoration: none;
	transition: all 0.2s ease;
	font-weight: 500;
}

.sidebar-menu .menu a:hover {
	background: var(--wvp-primary);
	color: white;
	padding-left: 30px;
}

.sidebar-menu .menu .current-menu-item > a,
.sidebar-menu .menu .current_page_item > a {
	background: var(--wvp-bg-light);
	border-left: 4px solid var(--wvp-primary);
	font-weight: 600;
}

/* Submenu */
.sidebar-menu .menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--wvp-bg-light);
}

.sidebar-menu .menu .sub-menu a {
	padding-left: 40px;
	font-size: 14px;
}

.sidebar-menu .menu .sub-menu a:hover {
	padding-left: 50px;
}

/* Menu Overlay */
.menu-overlay {
	position: fixed;
	top: var(--header-height);
	left: 0;
	right: 0;
	bottom: var(--footer-height);
	background: rgba(0,0,0,0.5);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 997;
}

.menu-overlay.active {
	opacity: 1;
	visibility: visible;
}

/**
 * Footer Styles
 */
.footer-container {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 0 20px;
	text-align: center;
}

.footer-content {
	font-size: 13px;
	color: var(--wvp-text-light);
	line-height: 1.4;
}

.footer-content a {
	color: var(--wvp-primary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.footer-content a:hover {
	color: var(--wvp-primary-dark);
	text-decoration: underline;
}

.footer-separator {
	margin: 0 8px;
	color: var(--wvp-border);
}

/**
 * Content Styles
 */
.content-area {
	width: 100%;
	padding: 20px;
	max-width: 100%;
}

/* Ocultar títulos de página */
.page .entry-title,
.single .entry-title {
	display: none;
}

.entry-content {
	width: 100%;
	max-width: 100%;
}

/* Asegurar que el contenido ocupe todo el ancho */
.entry-content > * {
	max-width: 100%;
}

/**
 * Optimizaciones de Rendimiento
 */
/* GPU Acceleration para animaciones */
.dark-mode-toggle,
.menu-toggle,
.sidebar-menu,
.menu-overlay {
	transform: translateZ(0);
	backface-visibility: hidden;
	perspective: 1000px;
}

/* Optimizar scrolling */
.sidebar-menu {
	-webkit-overflow-scrolling: touch;
	will-change: transform;
}

/* Reducir repaints */
.site-header,
.site-footer {
	will-change: transform;
}

/**
 * Responsive Design
 */
@media (max-width: 768px) {
	:root {
		--header-height: 55px;
		--footer-height: auto;
	}

	.site-title {
		font-size: 16px;
	}

	.footer-container {
		padding: 10px 15px;
		flex-direction: column;
		gap: 5px;
	}

	.footer-content {
		font-size: 11px;
	}

	.footer-separator {
		display: none;
	}

	.sidebar-menu {
		width: 280px;
		right: -280px;
	}

	.content-area {
		padding: 15px;
	}
}

@media (max-width: 480px) {
	.site-title {
		font-size: 14px;
		max-width: 200px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.header-controls {
		gap: 8px;
	}

	.dark-mode-toggle,
	.menu-toggle {
		width: 36px;
		height: 36px;
	}

	.sidebar-menu {
		width: 260px;
		right: -260px;
	}

	.content-area {
		padding: 10px;
	}
}

/**
 * Print Styles
 */
@media print {
	.site-header,
	.site-footer,
	.sidebar-menu,
	.menu-overlay,
	.dark-mode-toggle,
	.menu-toggle {
		display: none !important;
	}

	.site-content {
		margin: 0;
	}

	body {
		background: white;
		color: black;
	}
}

/**
 * Accesibilidad
 */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wvp-bg-white);
	border-radius: var(--wvp-radius-sm);
	box-shadow: var(--wvp-shadow-md);
	clip: auto !important;
	clip-path: none;
	color: var(--wvp-text);
	display: block;
	font-size: 14px;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Focus visible para mejor accesibilidad */
button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--wvp-primary);
	outline-offset: 2px;
}

/**
 * Submenu Toggle Button (Accessibility)
 */
.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 1px solid var(--wvp-border);
	border-radius: var(--wvp-radius-sm);
	cursor: pointer;
	margin-left: 8px;
	transition: all 0.2s ease;
	float: right;
	margin-top: 8px;
	margin-right: 8px;
}

.submenu-toggle:hover {
	background: var(--wvp-primary);
	border-color: var(--wvp-primary);
}

.submenu-toggle:hover .dashicons {
	color: white;
}

.submenu-toggle .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	color: var(--wvp-text-light);
	transition: color 0.2s ease;
}

/**
 * Smooth transitions para todo el tema
 */
* {
	transition-property: background-color, border-color, color, box-shadow;
	transition-duration: 0.3s;
	transition-timing-function: ease;
}

/* Excepciones a las transiciones (para mejor performance) */
*,
*::before,
*::after {
	transition-property: none;
}

body,
.site-header,
.site-footer,
.dark-mode-toggle,
.menu-toggle,
.sidebar-menu,
.menu-overlay,
button,
a,
.dashboard-widget,
.wvp-agenda-item {
	transition-property: background-color, border-color, color, box-shadow, transform, opacity;
	transition-duration: 0.3s;
	transition-timing-function: ease;
}

/**
 * Dark Mode - Estilos para el plugin dashboard
 */
body.dark-mode .wvp-assembly-dashboard,
body.dark-mode .wvp-agenda-list,
body.dark-mode .wvp-agenda-current,
body.dark-mode .dashboard-widget,
[data-dark-mode="true"] {
	background: var(--wvp-bg-white) !important;
	color: var(--wvp-text) !important;
}

/* Forzar dark mode con atributo data */
body.dark-mode [data-dark-mode="true"] {
	background-color: var(--wvp-bg-white) !important;
	color: var(--wvp-text) !important;
}

body.dark-mode .dashboard-header,
body.dark-mode .wvp-agenda-header,
body.dark-mode .widget-header {
	background: linear-gradient(135deg, var(--wvp-primary) 0%, var(--wvp-primary-dark) 100%) !important;
	border-color: var(--wvp-primary-dark) !important;
}

body.dark-mode .wvp-agenda-item,
body.dark-mode .dashboard-widget,
body.dark-mode .stat-item {
	background: var(--wvp-bg-light) !important;
	border-color: var(--wvp-border) !important;
	color: var(--wvp-text) !important;
}

body.dark-mode .agenda-item-title,
body.dark-mode .widget-title,
body.dark-mode .dashboard-title,
body.dark-mode .current-header h2,
body.dark-mode .point-title {
	color: var(--wvp-text) !important;
}

body.dark-mode .agenda-item-excerpt,
body.dark-mode .point-excerpt,
body.dark-mode .meta-item,
body.dark-mode .attendee-name,
body.dark-mode .stat-label {
	color: var(--wvp-text-light) !important;
}

body.dark-mode .wvp-agenda-current {
	background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
}

body.dark-mode .current-content,
body.dark-mode .stat-primary {
	background: rgba(255,255,255,0.05) !important;
}

body.dark-mode .current-timer,
body.dark-mode .point-timer {
	background: rgba(0,0,0,0.3) !important;
}

body.dark-mode .progress-bar-container {
	background: var(--wvp-bg-light) !important;
}

body.dark-mode .attendee-item {
	border-color: var(--wvp-border) !important;
}

body.dark-mode .attendee-item:hover {
	background: var(--wvp-border) !important;
}

/* Botones del dashboard en dark mode */
body.dark-mode .wvp-toggle-details,
body.dark-mode .dashboard-controls .button {
	background: var(--wvp-primary) !important;
	color: white !important;
}

body.dark-mode .wvp-toggle-details:hover,
body.dark-mode .dashboard-controls .button:hover {
	background: var(--wvp-primary-dark) !important;
}

/* Enlaces en dark mode */
body.dark-mode .documents-list a {
	background: var(--wvp-border) !important;
	color: var(--wvp-info) !important;
}

body.dark-mode .documents-list a:hover {
	background: var(--wvp-primary) !important;
	color: white !important;
}
