/**
 * ═══════════════════════════════════════════════════════════════════════════════════════
 * FILTERS STYLES - Sistema de Filtros v2
 * ═══════════════════════════════════════════════════════════════════════════════════════
 * 
 * Estilos para os componentes de filtros que COMPLEMENTAM o design existente.
 * NÃO substitui estilos - apenas adiciona estados de loading, mensagens, etc.
 * 
 * Compatível com: Semantic UI 2.4.1
 * 
 * @package DecisaoEmendas
 * @version 3.1.0 - Phase 3
 * @author @vitor-jotave
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Container com loading overlay
 * Usado por: UIUtils.showLoading()
 */
.vcpm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
    animation: vcpm-fade-in 0.2s ease-out;
}

.vcpm-loading-overlay .ui.loader {
    position: relative;
    margin-top: 0 !important;
}

/**
 * Loading inline (para textos pequenos)
 */
.vcpm-loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #767676;
    font-size: 14px;
}

.vcpm-loading-inline::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #2185d0;
    border-radius: 50%;
    animation: vcpm-spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. SKELETON SCREENS
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Skeleton loader animado
 * Usado enquanto conteúdo carrega
 */
.vcpm-skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: vcpm-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.vcpm-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    width: 100%;
}

.vcpm-skeleton-text:last-child {
    margin-bottom: 0;
    width: 60%;
}

.vcpm-skeleton-row {
    height: 60px;
    margin-bottom: 1px;
    width: 100%;
}

.vcpm-skeleton-button {
    height: 36px;
    width: 120px;
    display: inline-block;
    margin-right: 8px;
}

/**
 * Container de skeleton para tabela
 */
.vcpm-skeleton-table {
    padding: 16px;
}

.vcpm-skeleton-table .vcpm-skeleton-row:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. MENSAGENS (ERROR, SUCCESS, WARNING)
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Container de mensagens
 * Compatível com Semantic UI .message
 */
.vcpm-message {
    position: relative;
    min-height: 1em;
    margin: 1em 0;
    padding: 1em 1.5em;
    line-height: 1.4285em;
    color: rgba(0, 0, 0, 0.87);
    border-radius: 0.28571429rem;
    box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.22) inset, 0 0 0 0 transparent;
    animation: vcpm-slide-down 0.3s ease-out;
}

/**
 * Mensagem de sucesso
 */
.vcpm-message.success {
    background-color: #fcfff5;
    color: #2c662d;
    box-shadow: 0 0 0 1px #a3c293 inset, 0 0 0 0 transparent;
}

.vcpm-message.success .vcpm-message-icon {
    color: #2c662d;
}

/**
 * Mensagem de erro
 */
.vcpm-message.error {
    background-color: #fff6f6;
    color: #9f3a38;
    box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent;
}

.vcpm-message.error .vcpm-message-icon {
    color: #9f3a38;
}

/**
 * Mensagem de aviso
 */
.vcpm-message.warning {
    background-color: #fffaf3;
    color: #573a08;
    box-shadow: 0 0 0 1px #c9ba9b inset, 0 0 0 0 transparent;
}

.vcpm-message.warning .vcpm-message-icon {
    color: #573a08;
}

/**
 * Mensagem de informação
 */
.vcpm-message.info {
    background-color: #f8ffff;
    color: #276f86;
    box-shadow: 0 0 0 1px #a9d5de inset, 0 0 0 0 transparent;
}

.vcpm-message.info .vcpm-message-icon {
    color: #276f86;
}

/**
 * Conteúdo da mensagem
 */
.vcpm-message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.vcpm-message-icon {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.vcpm-message-text {
    flex: 1;
}

.vcpm-message-title {
    font-weight: bold;
    margin-bottom: 0.25em;
}

/**
 * Botão de fechar mensagem
 */
.vcpm-message-close {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 1.2em;
    line-height: 1;
    padding: 0.25em;
}

.vcpm-message-close:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. PAGINAÇÃO
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Container de paginação
 * Usa classes do Semantic UI mas adiciona animações
 */
.vcpm-pagination-wrapper {
    margin-top: 24px;
    text-align: center;
}

/**
 * Animação suave ao mudar de página
 */
.vcpm-pagination-wrapper .ui.pagination.menu {
    animation: vcpm-fade-in 0.3s ease-out;
}

/**
 * Estilo para página atual (ativa)
 */
.vcpm-pagination-wrapper .ui.pagination.menu .active.item {
    background-color: #2185d0;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

/**
 * Hover nos botões de página
 */
.vcpm-pagination-wrapper .ui.pagination.menu .item:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/**
 * Ellipsis (...)
 */
.vcpm-pagination-wrapper .ui.pagination.menu .disabled.item {
    opacity: 0.5;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. ESTADOS DE TRANSIÇÃO
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Fade in/out suave
 */
.vcpm-fade-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.vcpm-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

.vcpm-fade-exit {
    opacity: 1;
}

.vcpm-fade-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease-in;
}

/**
 * Slide para baixo (mensagens)
 */
.vcpm-slide-down {
    opacity: 0;
    transform: translateY(-20px);
    animation: vcpm-slide-down 0.3s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. ESTADOS DISABLED/EMPTY
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Estado vazio (sem resultados)
 */
.vcpm-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #767676;
}

.vcpm-empty-state-icon {
    font-size: 48px;
    color: #d4d4d5;
    margin-bottom: 16px;
}

.vcpm-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #1b1c1d;
    margin-bottom: 8px;
}

.vcpm-empty-state-message {
    font-size: 14px;
    color: #767676;
    max-width: 400px;
    margin: 0 auto;
}

/**
 * Botões e inputs desabilitados (mantém estilo Semantic UI)
 */
.vcpm-disabled {
    opacity: 0.45 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. ANIMAÇÕES KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes vcpm-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes vcpm-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes vcpm-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes vcpm-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. ACESSIBILIDADE
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Foco visível para teclado
 */
.vcpm-focusable:focus {
    outline: 2px solid #2185d0;
    outline-offset: 2px;
}

/**
 * Redução de movimento (respeita preferências do usuário)
 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .vcpm-loading-overlay {
        animation: none;
    }
    
    .vcpm-skeleton {
        animation: none;
        background: #f0f0f0;
    }
    
    .vcpm-message {
        animation: none;
    }
}

/**
 * Screen reader only
 */
.vcpm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. RESPONSIVIDADE
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Mobile (< 768px)
 */
@media (max-width: 767px) {
    .vcpm-message {
        padding: 0.75em 1em;
        font-size: 0.9em;
    }
    
    .vcpm-message-content {
        gap: 8px;
    }
    
    .vcpm-message-icon {
        font-size: 1.2em;
    }
    
    .vcpm-empty-state {
        padding: 32px 16px;
    }
    
    .vcpm-empty-state-icon {
        font-size: 36px;
    }
    
    .vcpm-pagination-wrapper .ui.pagination.menu .item {
        min-width: 2.5em;
        padding: 0.5em;
    }
}

/**
 * Tablet (768px - 991px)
 */
@media (min-width: 768px) and (max-width: 991px) {
    .vcpm-empty-state {
        padding: 40px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. DARK MODE (OPCIONAL - PREPARADO PARA FUTURO)
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Dark mode (se ativado no futuro)
 */
@media (prefers-color-scheme: dark) {
    .vcpm-dark-mode-ready .vcpm-skeleton {
        background: linear-gradient(
            90deg,
            #2a2a2a 0%,
            #3a3a3a 20%,
            #2a2a2a 40%,
            #2a2a2a 100%
        );
    }
    
    .vcpm-dark-mode-ready .vcpm-loading-overlay {
        background: rgba(0, 0, 0, 0.85);
    }
    
    .vcpm-dark-mode-ready .vcpm-empty-state {
        color: #a0a0a0;
    }
    
    .vcpm-dark-mode-ready .vcpm-empty-state-title {
        color: #e0e0e0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. UTILS (CLASSES AUXILIARES)
   ═══════════════════════════════════════════════════════════════════════════ */

/**
 * Espaçamentos consistentes
 */
.vcpm-mt-1 { margin-top: 8px; }
.vcpm-mt-2 { margin-top: 16px; }
.vcpm-mt-3 { margin-top: 24px; }
.vcpm-mb-1 { margin-bottom: 8px; }
.vcpm-mb-2 { margin-bottom: 16px; }
.vcpm-mb-3 { margin-bottom: 24px; }

/**
 * Display utilities
 */
.vcpm-hidden { display: none !important; }
.vcpm-visible { display: block !important; }
.vcpm-flex { display: flex !important; }
.vcpm-inline-flex { display: inline-flex !important; }

/**
 * Text utilities
 */
.vcpm-text-center { text-align: center; }
.vcpm-text-left { text-align: left; }
.vcpm-text-right { text-align: right; }

/**
 * Position utilities
 */
.vcpm-relative { position: relative; }
.vcpm-absolute { position: absolute; }

/* ═══════════════════════════════════════════════════════════════════════════
   FIM DO ARQUIVO
   ═══════════════════════════════════════════════════════════════════════════ */
