/* =======================================
   UI Animations Stylesheet
   Autor: Copilot for Marcelo Macedo (Farol Operacional)
   Descrição: Animações avançadas para a interface do usuário
   ======================================= */

/* Animações para elementos em scroll */
.scroll-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Efeitos para labels flutuantes */
.floating-label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #6c757d;
    pointer-events: none;
    transition: all 0.2s ease;
}

.floating-label.active {
    top: 0;
    font-size: 12px;
    color: #0d6efd;
    background-color: inherit;
    padding: 0 5px;
}

/* Efeitos de hover aprimorados */
.hover-effect {
    position: relative;
    overflow: hidden;
}

.hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 80%
    );
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.5s ease;
    pointer-events: none;
}

.hover-effect:hover::before {
    transform: scale(2);
    opacity: 1;
}

/* Animações para barras de progresso */
.progress-bar {
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animações para tabs */
.tab-animated {
    animation: tabFadeIn 0.5s forwards;
}

@keyframes tabFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeitos para linhas de tabelas */
.row-highlight {
    background-color: rgba(13, 110, 253, 0.05);
}

.cell-animated {
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.row-highlight .cell-animated {
    background-color: rgba(13, 110, 253, 0.08);
    transform: translateZ(0) scale(1.01);
    position: relative;
    z-index: 2;
}

/* Animação de destaque para botões */
.btn,
.dbc-btn {
    position: relative;
    overflow: hidden;
}

.btn::after,
.dbc-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
}

.btn:hover::after,
.dbc-btn:hover::after {
    animation: buttonShimmer 1.5s infinite;
}

@keyframes buttonShimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Efeitos de destaque para cartões importantes */
.important-card {
    position: relative;
    overflow: hidden;
}

.important-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(13, 110, 253, 0.1), transparent 30%);
    animation: rotateBorder 4s linear infinite;
    z-index: -1;
}

@keyframes rotateBorder {
    100% {
        transform: rotate(1turn);
    }
}

/* Animações para números/estatísticas */
.counter {
    font-weight: bold;
    transition: color 0.3s ease;
}

.counter:hover {
    color: #0d6efd;
}

/* Transições para modais */
.modal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Loader customizado */
.custom-loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(13, 110, 253, 0.2);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s infinite linear;
    margin: 20px auto;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Animação para alertas */
@keyframes alertPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.alert-danger {
    animation: alertPulse 2s infinite;
}

/* Efeitos para badges */
.badge {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.badge:hover {
    transform: scale(1.1);
}

/* Efeitos para ícones */
.icon-animate {
    transition: transform 0.3s ease;
}

.icon-animate:hover {
    transform: rotate(15deg);
}

/* Animação para elementos drag & drop */
.draggable {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draggable:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Efeito de texto typing */
.typing-text {
    border-right: 2px solid #0d6efd;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from,
    to {
        border-color: transparent;
    }
    50% {
        border-color: #0d6efd;
    }
}

/* Tema escuro - ajustes específicos */
.theme-dark .floating-label.active {
    color: #58a6ff;
}

.theme-dark .row-highlight {
    background-color: rgba(88, 166, 255, 0.08);
}

.theme-dark .row-highlight .cell-animated {
    background-color: rgba(88, 166, 255, 0.12);
}

.theme-dark .counter:hover {
    color: #58a6ff;
}

.theme-dark .custom-loader {
    border-color: rgba(88, 166, 255, 0.2);
    border-top-color: #58a6ff;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .floating-label {
        font-size: 14px;
    }

    .floating-label.active {
        font-size: 10px;
    }

    .hover-effect::before {
        display: none;
    }
}
