/* OmniPixy: Estilos unificados con animaciones divertidas y glassmorphism */

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.2); }
    50% { box-shadow: 0 20px 35px -5px rgba(124, 58, 237, 0.4); }
}

@keyframes bounceShort {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-bounce-short {
    animation: bounceShort 2s ease-in-out infinite;
}

/* Home Card Styling: Divertido, Tarjeta Premium */
.tool-card {
    position: relative;
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 2px solid #f3f4f6;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.dark .tool-card {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #6366f1;
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.25);
}

.dark .tool-card:hover {
    border-color: #818cf8;
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.4);
}

.tool-card .tool-emoji {
    display: inline-block;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-emoji {
    transform: scale(1.3) rotate(12deg);
}

/* Badges divertidos */
.badge-fun {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-ai {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
}

.badge-hot {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
}

.badge-pro {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
}

/* Slider comparativo Antes/Después */
.split-comparison-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
    overflow: hidden;
    border-radius: 1rem;
    border: 2px solid #e5e7eb;
    user-select: none;
}

.dark .split-comparison-container {
    border-color: #374151;
}

.split-comparison-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

.split-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.split-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #6366f1;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.split-handle::after {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Input range slider */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #4F46E5;
    cursor: pointer;
    margin-top: -9px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    transition: transform 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range]::-moz-range-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #4F46E5;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    border: none;
    transition: transform 0.15s ease;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #E5E7EB;
    border-radius: 3px;
}

input[type=range]::-moz-range-track {
    background: #E5E7EB;
    border-radius: 3px;
}

.dark input[type=range]::-webkit-slider-runnable-track {
    background: #4B5563;
}

.dark input[type=range]::-moz-range-track {
    background: #4B5563;
}

/* Drop zone styling */
.drop-zone {
    background-color: #F9FAFB;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='20' ry='20' stroke='%234F46E5FF' stroke-width='2.5' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
}

.dark .drop-zone {
    background-color: #111827;
}

.drop-zone:hover {
    background-color: rgba(79, 70, 229, 0.06);
    transform: scale(1.008);
}

.dark .drop-zone:hover {
    background-color: rgba(79, 70, 229, 0.12);
}

.drop-zone.drag-active,
.drop-zone.dragover {
    background-color: rgba(79, 70, 229, 0.15);
    transform: scale(1.015);
    border-color: #4F46E5;
}

.dark .drop-zone.drag-active,
.dark .drop-zone.dragover {
    background-color: rgba(79, 70, 229, 0.25);
}

/* Loader animation */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

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

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark .modal-content {
    background: #1f2937;
}

/* Nota: se usa el .hidden generado por Tailwind CDN (display:none, sin
   !important) para no romper "hidden md:inline-flex" y variantes responsive
   similares — un !important aquí les gana siempre por especificidad. */

/* Utility: Disabled button state */
button:disabled,
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Transición tipo tarjeta al navegar entre herramientas (router) */
@keyframes cardEnter {
    0% { opacity: 0; transform: translateY(18px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.page-enter {
    animation: cardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
    .page-enter {
        animation: none;
    }
}

/* Mobile & Tablet Safe-Area-Inset y Bottom Nav Spacing */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-pb {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: 4.5rem; /* Margen inferior para no tapar contenido con el bottom nav */
    }
}

