/* =================================
   TICOHOST - ESTILOS PERSONALIZADOS
   ================================= */

/* Optimización de fonts */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-display: swap;
}

@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-display: swap;
}

/* Animaciones generales */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Clases de animación */
.animate-fade-in-down {
    animation: fadeInDown 1s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade-in al hacer scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover zoom mejorado */
.hover-zoom {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.hover-zoom:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Patrón de fondo para headers */
.bg-pattern {
    background-image: 
        linear-gradient(30deg, #f0f0f0 12%, transparent 12.5%, transparent 87%, #f0f0f0 87.5%, #f0f0f0),
        linear-gradient(150deg, #f0f0f0 12%, transparent 12.5%, transparent 87%, #f0f0f0 87.5%, #f0f0f0),
        linear-gradient(30deg, #f0f0f0 12%, transparent 12.5%, transparent 87%, #f0f0f0 87.5%, #f0f0f0),
        linear-gradient(150deg, #f0f0f0 12%, transparent 12.5%, transparent 87%, #f0f0f0 87.5%, #f0f0f0);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

/* Toggle Switch Moderno Mejorado */
.toggle-switch-modern {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 40px;
}

.toggle-switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-modern {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 40px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.slider-modern:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 32px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.slider-modern .slider-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.toggle-switch-modern input:checked + .slider-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
}

.toggle-switch-modern input:checked + .slider-modern:before {
    transform: translateX(40px) rotate(360deg);
}

/* Efecto de resplandor en el toggle */
.toggle-switch-modern input:checked + .slider-modern {
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
    }
    50% {
        box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8);
    }
}

/* Etiquetas de precios mejoradas */
#monthly-label,
#annual-label {
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.toggle-switch-modern input:not(:checked) ~ #monthly-label {
    color: #4f46e5;
    transform: scale(1.1);
}

.toggle-switch-modern input:checked ~ #annual-label {
    color: #4f46e5;
    transform: scale(1.1);
}

/* Animación de precios mejorada */
.price-wrapper {
    position: relative;
    height: 80px;
    overflow: hidden;
}

.price-display {
    position: absolute;
    width: 100%;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateY(30px) scale(0.8);
}

.price-display.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.price-display.monthly {
    position: relative;
}

.price-display.annual {
    position: absolute;
    top: 0;
}

/* Tarjetas de precios mejoradas */
.pricing-card {
    position: relative;
    overflow: hidden;
}

/* Contenedor de grid de precios con espacio para badge */
.grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    padding-top: 2rem;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.pricing-card:hover::before {
    left: 100%;
}

.pricing-card.featured {
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.08) translateY(-8px);
}

/* Badge más popular con z-index y posición mejorada */
.relative > .absolute.-top-4 {
    z-index: 50;
    top: -1rem;
    pointer-events: none;
}

.relative:hover > .absolute.-top-4 {
    top: -1.2rem;
    transition: top 0.3s ease;
}

/* Badge de descuento mejorado */
#discount-badge {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

/* FAQ mejorado */
.faq-item {
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.faq-item:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.faq-question {
    padding: 1.5rem;
    background: white;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.faq-question:hover {
    background-color: #f7fafc;
    color: #4f46e5;
}

.faq-question svg {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex-shrink: 0;
}

.faq-answer {
    padding: 0 1.5rem;
    background: #f9fafb;
    border-top: 2px solid #e2e8f0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-item.active {
    border-color: #4f46e5;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
}

/* Navbar mejorado con efecto scroll */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Contador animado */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Botones mejorados */
button, .button, a[class*="bg-"] {
    position: relative;
    overflow: hidden;
}

button::after, .button::after, a[class*="bg-"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button:active::after, .button:active::after, a[class*="bg-"]:active::after {
    width: 300px;
    height: 300px;
}

/* Mejoras de accesibilidad */
*:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loader/Spinner */
.spinner {
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive mejoras */
@media (max-width: 768px) {
    .toggle-switch-modern {
        width: 70px;
        height: 35px;
    }
    
    .slider-modern:before {
        height: 28px;
        width: 28px;
    }
    
    .toggle-switch-modern input:checked + .slider-modern:before {
        transform: translateX(35px) rotate(360deg);
    }
    
    #monthly-label,
    #annual-label {
        font-size: 1rem;
    }
    
    .price-wrapper {
        height: 70px;
    }
    
    .pricing-card.featured {
        transform: scale(1);
    }
}

/* Efectos de partículas en el fondo (opcional) */
.particle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-50px) translateX(50px);
    }
    50% {
        transform: translateY(-100px) translateX(-50px);
    }
    75% {
        transform: translateY(-50px) translateX(50px);
    }
}

/* Gradientes animados */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

/* Sombras personalizadas */
.shadow-custom {
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.1);
}

.shadow-custom-lg {
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1f2937;
    color: white;
    border-radius: 0.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

/* Personalización del scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Efectos de texto */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animación de escritura */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid #4f46e5;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Efectos de glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Impresión */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
