/* =============================================================================
   ✨ MICRO-ANIMAÇÕES E EFEITOS MODERNOS
   Adiciona sutileza e polish à interface
   ============================================================================= */

/* Animações de entrada suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Aplicar animações */
.card {
    animation: fadeIn 0.4s ease-out;
}

.modal-content {
    animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert {
    animation: slideInRight 0.3s ease-out;
}

/* Efeito de ripple em botões */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    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, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Skeleton loading para estados de carregamento */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-tertiary) 0%,
        var(--color-hover) 50%,
        var(--color-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Scroll suave */
* {
    scroll-behavior: smooth;
}

/* Focus visible moderno */
*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Melhorar seleção de texto */
::selection {
    background-color: var(--color-accent);
    color: #FFFFFF;
}

::-moz-selection {
    background-color: var(--color-accent);
    color: #FFFFFF;
}

/* Efeito hover em links */
a {
    position: relative;
    transition: color 0.2s ease;
}

a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):hover::after {
    width: 100%;
}

/* Glassmorphism para elementos destacados */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .glass-effect {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Efeito parallax suave em cards */
.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl) !important;
}

/* Pulse effect para notificações */
.pulse-notification {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading spinner moderno */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Tooltip style moderno */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--color-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Badge pulsante para novidades */
.badge-new {
    position: relative;
    overflow: visible;
}

.badge-new::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: var(--color-accent);
    opacity: 0.3;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Transition delays para listas */
.list-item:nth-child(1) { animation-delay: 0.05s; }
.list-item:nth-child(2) { animation-delay: 0.1s; }
.list-item:nth-child(3) { animation-delay: 0.15s; }
.list-item:nth-child(4) { animation-delay: 0.2s; }
.list-item:nth-child(5) { animation-delay: 0.25s; }

/* Smooth transition global */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Performance - usar GPU para animações */
.card,
.btn,
.modal-content,
.table tbody tr {
    will-change: transform;
    transform: translateZ(0);
}

/* Desabilitar animações se o usuário preferir */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.offline {
    background: var(--color-muted);
}

.status-dot.busy {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

/* Divider moderno */
.divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-border) 50%,
        transparent 100%
    );
    margin: 2rem 0;
}

/* Card com gradiente sutil */
.card-gradient {
    background: linear-gradient(
        135deg,
        var(--color-secondary) 0%,
        var(--color-tertiary) 100%
    ) !important;
}

/* Efeito neon para elementos especiais */
.neon-accent {
    text-shadow: 0 0 10px var(--color-accent),
                 0 0 20px var(--color-accent),
                 0 0 30px var(--color-accent);
}

/* Progress bar animado */
@keyframes progress {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 0;
    }
}

.progress-bar-animated {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: progress 1s linear infinite;
}
