/* ========================================
   Search Modal - Búsqueda de Página Completa
   Hermoso, Rápido y Ligero
   ======================================== */

/* 
   CÓMO USAR:
   1. Haz clic en el icono 🔍 en el navbar
   2. O presiona Ctrl+K (Cmd+K en Mac)
   3. Escribe tu búsqueda y presiona Enter
   4. Para cerrar: ESC o clic fuera del modal
   
   PERSONALIZACIÓN RÁPIDA:
   - Línea 27: Color de fondo del overlay
   - Línea 72: Color del input
   - Línea 109: Color del botón (gradient)
   - Línea 51: Tamaño del modal (max-width)
*/

/* Modal Overlay */
.search-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
	            visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 20px;
}

.search-modal.active {
	opacity: 1;
	visibility: visible;
}

/* Modal Container */
.search-modal__container {
	width: 100%;
	max-width: 800px;
	transform: translateY(30px) scale(0.95);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}

.search-modal.active .search-modal__container {
	transform: translateY(0) scale(1);
}

/* Close Button */
.search-modal__close {
	position: absolute;
	top: -60px;
	right: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: #fff;
	font-size: 0;
}

.search-modal__close:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.4);
	transform: rotate(90deg);
}

.search-modal__close::before,
.search-modal__close::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 2px;
	background: #fff;
	border-radius: 2px;
}

.search-modal__close::before {
	transform: rotate(45deg);
}

.search-modal__close::after {
	transform: rotate(-45deg);
}

/* Search Form */
.search-modal__form {
	position: relative;
	width: 100%;
	margin-bottom: 30px;
}

.search-modal__input-wrapper {
	position: relative;
	width: 100%;
}

.search-modal__input {
	width: 100%;
	height: 75px;
	padding: 0 75px 0 30px;
	font-size: 22px;
	font-weight: 500;
	color: #1e293b;
	background: #ffffff;
	border: 3px solid transparent;
	border-radius: 20px;
	outline: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: 'DM Sans', sans-serif;
}

.search-modal__input::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.search-modal__input:focus {
	border-color: #006aff;
	box-shadow: 0 0 0 4px rgba(0, 106, 255, 0.1),
	            0 10px 40px rgba(0, 106, 255, 0.15);
}

/* Search Icon Button */
.search-modal__submit {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #006aff 0%, #0080ff 100%);
	border: none;
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: #fff;
}

.search-modal__submit:hover {
	transform: translateY(-50%) scale(1.05);
	box-shadow: 0 8px 25px rgba(0, 106, 255, 0.3);
}

.search-modal__submit:active {
	transform: translateY(-50%) scale(0.98);
}

.search-modal__submit svg {
	width: 24px;
	height: 24px;
}

/* Quick Suggestions */
.search-modal__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	animation: fadeInUp 0.5s ease 0.2s backwards;
}

.search-modal__suggestion-label {
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	font-weight: 500;
	margin-right: 8px;
	align-self: center;
}

.search-modal__suggestion-item {
	padding: 10px 20px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 25px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.25s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.search-modal__suggestion-item:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.3);
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-modal__suggestion-item svg {
	width: 14px;
	height: 14px;
	opacity: 0.7;
}

/* Popular Searches / Recent Posts */
.search-modal__popular {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 20px;
	animation: fadeInUp 0.5s ease 0.3s backwards;
}

.search-modal__popular-title {
	color: rgba(255, 255, 255, 0.9);
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 15px 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.search-modal__popular-title svg {
	width: 20px;
	height: 20px;
	opacity: 0.7;
}

.search-modal__popular-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.search-modal__popular-item {
	margin: 0;
	padding: 0;
}

.search-modal__popular-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	border-radius: 10px;
	transition: all 0.25s ease;
	font-size: 15px;
	font-weight: 500;
	position: relative;
}

.search-modal__popular-link:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	padding-left: 20px;
}

.search-modal__popular-link::before {
	content: '';
	width: 4px;
	height: 0;
	background: linear-gradient(135deg, #006aff 0%, #0080ff 100%);
	border-radius: 2px;
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	transition: height 0.25s ease;
}

.search-modal__popular-link:hover::before {
	height: 60%;
}

.search-modal__popular-icon {
	width: 18px;
	height: 18px;
	opacity: 0.5;
	flex-shrink: 0;
}

/* Keyboard Shortcuts Hint */
.search-modal__hint {
	text-align: center;
	color: rgba(255, 255, 255, 0.4);
	font-size: 13px;
	margin-top: 25px;
	animation: fadeInUp 0.5s ease 0.4s backwards;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
}

.search-modal__hint-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.search-modal__hint kbd {
	padding: 4px 8px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	font-size: 11px;
	font-family: 'DM Sans', monospace;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Dark Mode Support */
[data-theme="dark"] .search-modal__input {
	background: #1e293b;
	color: #e2e8f0;
	border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-modal__input::placeholder {
	color: #64748b;
}

[data-theme="dark"] .search-modal__input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1),
	            0 10px 40px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .search-modal__submit {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

[data-theme="dark"] .search-modal__submit:hover {
	box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
	.search-modal {
		padding: 20px;
		align-items: flex-start;
		padding-top: 80px;
	}
	
	.search-modal__close {
		top: -70px;
		width: 44px;
		height: 44px;
	}
	
	.search-modal__input {
		height: 65px;
		padding: 0 65px 0 20px;
		font-size: 18px;
		border-radius: 16px;
	}
	
	.search-modal__submit {
		width: 52px;
		height: 52px;
		border-radius: 12px;
	}
	
	.search-modal__submit svg {
		width: 22px;
		height: 22px;
	}
	
	.search-modal__suggestions {
		gap: 10px;
	}
	
	.search-modal__suggestion-item {
		padding: 8px 16px;
		font-size: 13px;
	}
	
	.search-modal__popular {
		padding: 16px;
	}
	
	.search-modal__popular-title {
		font-size: 15px;
	}
	
	.search-modal__popular-link {
		padding: 10px 12px;
		font-size: 14px;
	}
	
	.search-modal__hint {
		flex-direction: column;
		gap: 10px;
		font-size: 12px;
	}
}

@media screen and (max-width: 480px) {
	.search-modal {
		padding: 15px;
		padding-top: 70px;
	}
	
	.search-modal__close {
		top: -60px;
		width: 42px;
		height: 42px;
	}
	
	.search-modal__input {
		height: 58px;
		padding: 0 60px 0 18px;
		font-size: 16px;
		border-radius: 14px;
	}
	
	.search-modal__submit {
		width: 48px;
		height: 48px;
		border-radius: 10px;
	}
	
	.search-modal__submit svg {
		width: 20px;
		height: 20px;
	}
	
	.search-modal__popular-link {
		padding: 9px 10px;
		font-size: 13px;
		gap: 10px;
	}
}

/* Smooth scrolling for modal */
.search-modal {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.search-modal::-webkit-scrollbar {
	width: 8px;
}

.search-modal::-webkit-scrollbar-track {
	background: transparent;
}

.search-modal::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}

.search-modal::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Prevent body scroll when modal is open */
body.search-modal-open {
	overflow: hidden;
}

/* Performance optimization */
.search-modal {
	will-change: opacity, visibility;
}

.search-modal__container {
	will-change: transform;
}

/* Accessibility - Focus styles */
.search-modal__input:focus-visible,
.search-modal__submit:focus-visible,
.search-modal__close:focus-visible,
.search-modal__suggestion-item:focus-visible,
.search-modal__popular-link:focus-visible {
	outline: 2px solid #006aff;
	outline-offset: 3px;
}

[data-theme="dark"] .search-modal__input:focus-visible,
[data-theme="dark"] .search-modal__submit:focus-visible,
[data-theme="dark"] .search-modal__close:focus-visible,
[data-theme="dark"] .search-modal__suggestion-item:focus-visible,
[data-theme="dark"] .search-modal__popular-link:focus-visible {
	outline-color: #6366f1;
}

