/**
 * Portal do Servidor - Cadastro360
 * Arquivo de animações e estilos personalizados
 * Versão: 1.1.0
 * Data: 22/09/2025
 */

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Classes de animação */
.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.slide-up-fade-in {
    animation: slideUp 0.5s ease-out forwards;
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Transições */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Efeitos de hover */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Estilos para acessibilidade */
.focus-visible:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}

/* Efeitos para os itens do menu lateral */
.sidebar-link {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background-color: rgba(3, 105, 161, 0.5); /* primary-700 com opacidade */
}

.sidebar-link:hover .w-8.h-8 {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Efeito para o botão de logout */
.sidebar-link:has(.bg-red-600):hover .bg-red-600 {
    background-color: #dc2626; /* red-600 mais intenso */
    transform: scale(1.05);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Efeito de destaque para o item ativo */
.sidebar-link.active {
    background-color: rgba(3, 105, 161, 0.7); /* primary-700 com opacidade */
    border-right: 3px solid white;
}

/* Efeito de pulso para o indicador do item ativo */
.sidebar-link.active .w-1\.5.h-1\.5 {
    animation: pulse 2s infinite;
}

/* Ajustes para o layout principal */
.min-h-screen {
    min-height: 100vh;
}

main {
    padding-top: 1.5rem;
}

/* Ajustes para dispositivos móveis */
@media (max-width: 1024px) {
    .min-h-screen {
        padding-bottom: 2rem;
    }
    
    main {
        width: 100%;
        padding-top: 5rem; /* Espaço para o cabeçalho fixo */
    }
}

/* Ajustes para desktop */
@media (min-width: 1025px) {
    aside {
        width: 16rem; /* w-64 */
        min-width: 16rem;
    }
    
    main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Estilos para o menu lateral em dispositivos móveis */
@media (max-width: 1024px) {
    aside {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    aside.translate-x-0 {
        transform: translateX(0);
    }
    
    aside.-translate-x-full {
        transform: translateX(-100%);
    }
    
    .overlay {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }
    
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Ajustes para o conteúdo principal em dispositivos móveis */
    main {
        padding-top: 5rem !important;
    }
    
    /* Estilos para o cabeçalho móvel */
    header.lg\:hidden {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        background: linear-gradient(to right, #0284c7, #0369a1);
    }
    
    /* Ajustes para o botão do menu */
    .mobile-menu-button {
        color: white;
        border-radius: 0.375rem;
        padding: 0.625rem;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-menu-button:active {
        transform: translateY(1px);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-menu-button i {
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-button:hover i {
        transform: scale(1.1);
    }
    
    .menu-icon-pulse {
        animation: menuPulse 2s infinite;
    }
    
    @keyframes menuPulse {
        0% { transform: scale(1); }
        5% { transform: scale(1.2); }
        10% { transform: scale(1); }
        15% { transform: scale(1.1); }
        20% { transform: scale(1); }
        100% { transform: scale(1); }
    }
}

/* Estilos para notificações */
#notification-container {
    z-index: 9999;
}

/* Estilos para diálogos */
.dialog-overlay {
    backdrop-filter: blur(2px);
}

/* Estilos para campos de formulário */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

/* Estilos para botões */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.btn-hover-effect:hover:after {
    transform: translateX(0);
}

/* Estilos para cards */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Estilos para timeline */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
    transform: translateX(-50%);
}

.timeline-dot {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #0284c7;
    transform: translateX(-50%);
    z-index: 1;
}

/* Estilos para ícones pulsantes */
.icon-pulse {
    animation: pulse 2s infinite;
}

/* Estilos para botões de ajuda */
.help-button {
    cursor: help;
}

/* Estilos para tooltips */
.tooltip {
    position: absolute;
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    z-index: 50;
    max-width: 300px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tooltip:after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

/* Estilos para o indicador de carregamento */
#page-loader {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

#page-loader.fade-out {
    opacity: 0;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Estilos para skeletons (carregamento) */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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