/**
 * Filament Tooltip CSS
 * Archivo: /modules/filamenttooltip/views/css/filament-tooltip.css
 */

/* Tooltip container */
.filament-tooltip {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 99999;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.filament-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.filament-tooltip.error {
    background: #fee;
    border-color: #f88;
}

/* Tamaños del tooltip */
.filament-tooltip.size-small {
    width: 120px;
}

.filament-tooltip.size-medium {
    width: 180px;
}

.filament-tooltip.size-large {
    width: 240px;
}

/* Imagen del tooltip */
.tooltip-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tooltip-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s ease;
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contenido del tooltip */
.tooltip-content {
    padding: 12px;
    text-align: center;
}

.tooltip-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    display: block;
    word-break: break-word;
}

/* Efectos hover en el color original */
.color.texture {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color.texture:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color.texture::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-radius: inherit;
    transition: border-color 0.2s ease;
}

.color.texture:hover::after {
    border-color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
    .filament-tooltip.size-large {
        width: 160px;
    }

    .filament-tooltip.size-medium {
        width: 140px;
    }

    .filament-tooltip.size-small {
        width: 120px;
    }

    .tooltip-content {
        padding: 8px;
    }

    .tooltip-name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .filament-tooltip {
        max-width: calc(100vw - 20px);
    }

    .filament-tooltip.size-large,
    .filament-tooltip.size-medium {
        width: 120px;
    }

    .filament-tooltip.size-small {
        width: 100px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .filament-tooltip {
        background: rgba(45, 55, 72, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .tooltip-name {
        color: #e2e8f0;
    }

    .tooltip-image {
        background: #2d3748;
    }

    .spinner {
        border-color: #4a5568;
        border-top-color: #63b3ed;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .filament-tooltip,
    .color.texture,
    .tooltip-image img {
        transition: none;
    }

    .spinner {
        animation: none;
        border-top-color: #007bff;
    }
}

/* Estados adicionales */
.filament-tooltip.loading .tooltip-image img {
    opacity: 0;
}

.filament-tooltip.loaded .loading-spinner {
    display: none;
}

.filament-tooltip.loaded .tooltip-image img {
    opacity: 1;
}

/* Efecto glassmorphism mejorado */
.filament-tooltip {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

/* Flecha del tooltip (opcional) */
.filament-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: inherit;
    border: inherit;
    border-top: none;
    border-left: none;
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
}

/* Ocultar flecha si el tooltip está en la parte inferior */
.filament-tooltip.position-bottom::before {
    top: -6px;
    bottom: auto;
    border-top: inherit;
    border-bottom: none;
    border-left: inherit;
    border-right: none;
    transform: translateX(-50%) rotate(-45deg);
}
