/* Global UX/UI Improvements - Aplicando melhorias em todo o site */

/* Melhorias gerais de layout e espaçamento */
.page-header {
    position: relative;
    z-index: 1;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

/* Melhorias nos cards de resumo */
.fundo-claro {
    background: linear-gradient(135deg, var(--fundo-claro) 0%, #f0f9ff 100%);
    box-shadow: 0 4px 20px rgba(23, 115, 207, 0.08);
    border: 1px solid rgba(23, 115, 207, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fundo-claro:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(23, 115, 207, 0.15);
    border-color: rgba(23, 115, 207, 0.2);
}

/* Melhorias nos botões */
.botao-fundo-escuro {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    box-shadow: 0 4px 15px rgba(23, 115, 207, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.botao-fundo-escuro::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.botao-fundo-escuro:hover::before {
    left: 100%;
}

.botao-fundo-escuro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 115, 207, 0.4);
}

.botao-fundo-claro {
    background: linear-gradient(135deg, var(--fundo-claro) 0%, #f0f9ff 100%);
    border: 2px solid var(--cor-primaria);
    box-shadow: 0 2px 10px rgba(23, 115, 207, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.botao-fundo-claro:hover {
    background: var(--cor-primaria);
    color: var(--texto-claro);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 115, 207, 0.3);
}

/* Melhorias nos formulários */
.form-control {
    border: 2px solid var(--borda);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.form-control:focus {
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(23, 115, 207, 0.1);
    background-color: var(--texto-claro);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--cor-secundaria);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Melhorias nos modais */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: var(--texto-claro);
    border-bottom: none;
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--borda);
    padding: 1.5rem 2rem;
    background-color: #fafbfc;
}

/* Melhorias nos cards de intimações */
.intimacao-card,
.resultado-card,
.processo-card {
    border: 1px solid rgba(23, 115, 207, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.intimacao-card:hover,
.resultado-card:hover,
.processo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(23, 115, 207, 0.2);
}

.intimacao-card .card-header,
.resultado-card .card-header,
.processo-card .card-header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%) !important;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Melhorias na navegação breadcrumb */
.breadcrumb {
    background: linear-gradient(135deg, var(--fundo-claro) 0%, #f0f9ff 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(23, 115, 207, 0.1);
}

.breadcrumb-item a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--hover);
}

/* Melhorias nos ícones */
.icone {
    background: linear-gradient(135deg, #7DB2E4 0%, var(--cor-primaria) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(125, 178, 228, 0.3));
}

/* Melhorias na tipografia */
.titulo {
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, var(--cor-primaria) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.titulo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    border-radius: 2px;
}

/* Melhorias nos alertas */
.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1);
}

.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
}

/* Melhorias na responsividade */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .titulo::after {
        width: 40px;
        height: 2px;
    }
}

/* Animações suaves para transições de página */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container-sm,
.container-fluid {
    animation: fadeInUp 0.6s ease-out;
}

/* Melhorias no loading state */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Melhorias na acessibilidade */
.btn:focus,
.form-control:focus,
.botao-fundo-escuro:focus,
.botao-fundo-claro:focus {
    outline: 2px solid var(--cor-primaria);
    outline-offset: 2px;
}

/* Melhorias nos estados hover para touch devices */
@media (hover: none) {
    .fundo-claro:hover,
    .botao-fundo-escuro:hover,
    .botao-fundo-claro:hover,
    .intimacao-card:hover,
    .resultado-card:hover,
    .processo-card:hover {
        transform: none;
    }
}

/* Melhorias no scroll suave */
html {
    scroll-behavior: smooth;
}

/* Melhorias na seleção de texto */
::selection {
    background-color: rgba(23, 115, 207, 0.2);
    color: var(--cor-secundaria);
}

::-moz-selection {
    background-color: rgba(23, 115, 207, 0.2);
    color: var(--cor-secundaria);
}