/* 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(--surface) 0%, #f0f9ff 100%);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.fundo-claro:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 122, 255, 0.15);
    border-color: rgba(0, 122, 255, 0.2);
}

/* Melhorias nos botões (MIGRADO PARA components/buttons.css) */
/*
.botao-fundo-escuro {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.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(0, 122, 255, 0.4);
}

.botao-fundo-claro {
    background: linear-gradient(135deg, var(--surface) 0%, #f0f9ff 100%);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.botao-fundo-claro:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}
*/

/* Melhorias nos formulários (MIGRADO PARA components/forms.css) */
/*
.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    background-color: var(--surface);
    font-size: 1rem;
    color: var(--text-main);
}

.form-select {
    padding-right: 2.5rem;
    background-position: right 1rem center;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background-color: var(--surface);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
*/

/* Melhorias nos modais */
.modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background-color: var(--surface);
}

.modal-header {
    background: var(--surface);
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
    color: var(--text-main);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    background-color: var(--bg-body);
}

/* Melhorias nos cards de intimações */
.intimacao-card,
.resultado-card,
.processo-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background-color: var(--surface);
}

.intimacao-card:hover,
.resultado-card:hover,
.processo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.intimacao-card .card-header,
.resultado-card .card-header,
.processo-card .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    color: #ffffff;
}

.card-body {
    padding: 1.5rem;
}

/* Melhorias na navegação breadcrumb */
.breadcrumb {
    background: var(--surface);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

/* Melhorias nos ícones */
.icone {
    color: var(--text-main) !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* Melhorias na tipografia */
.titulo {
    color: var(--text-main) !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    position: relative;
    font-weight: 700;
}

.titulo-branco {
    background: unset;
    color: #ffffff !important;
}

.titulo::after {
    display: none !important;
}

/* Melhorias nos alertas */
.error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 12px;
    color: #991B1B;
}

.success {
    background: #ECFDF5;
    border: 1px solid #6EE7B7;
    border-radius: 12px;
    color: #065F46;
}

/* 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: none;
    box-shadow: 0 0 0 4px var(--primary-soft);
    border-color: var(--primary);
}

/* 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);
}

/* Estilo para rolagem do teor da publicação */
.teor-scrollable {
    max-height: 250px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--cor-primaria) #e9ecef;
}

.teor-scrollable::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.teor-scrollable::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.teor-scrollable::-webkit-scrollbar-thumb {
    background-color: var(--cor-primaria);
    border-radius: 4px;
}

/* Aumenta a área de rolagem em telas maiores (desktop) */
@media (min-width: 768px) {
    .teor-scrollable {
        max-height: 400px;
    }
}

/* ==========================================================================
   Apple Style Notifications (Glassmorphism)
   ========================================================================== */

.apple-notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
    /* Permite clicar através do container */
}

.apple-notification {
    pointer-events: auto;
    /* Reativa cliques no toast */
    width: 380px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    color: #1d1d1f !important;
}

.apple-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.apple-notification.hide {
    transform: translateX(120%);
    opacity: 0;
}



/* Tipos de Notificação */
.apple-notification-icon {
    font-size: 1.25rem;
    padding-top: 2px;
}

.apple-notification-success .apple-notification-icon {
    color: var(--success, #28a745);
}

.apple-notification-error .apple-notification-icon {
    color: var(--danger, #dc3545);
}

.apple-notification-warning .apple-notification-icon {
    color: var(--warning-text, #ffc107);
}

.apple-notification-info .apple-notification-icon {
    color: var(--primary, #0d6efd);
}

.apple-notification-content {
    flex: 1;
}

.apple-notification-message {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1d1d1f !important;
    font-weight: 500;
}



.apple-notification-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-secondary, #86868b);
    cursor: pointer;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-left: 8px;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.apple-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-main, #1d1d1f);
    transform: scale(1.1);
}

.apple-notification-close:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.15);
}



/* Barra de Progresso */
.apple-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    transform-origin: left;
    animation: notificationProgress 5s linear forwards;
}

.apple-notification-success .apple-notification-progress {
    color: var(--success, #28a745);
}

.apple-notification-error .apple-notification-progress {
    color: var(--danger, #dc3545);
}

.apple-notification-warning .apple-notification-progress {
    color: var(--warning, #ffc107);
}

.apple-notification-info .apple-notification-progress {
    color: var(--primary, #0d6efd);
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 576px) {
    .apple-notification-container {
        top: 24px;
        bottom: auto;
        right: 16px;
        left: 16px;
        align-items: center;
    }

    .apple-notification {
        width: 100%;
        transform: translateY(-150%);
    }

    .apple-notification.show {
        transform: translateY(0);
    }

    .apple-notification.hide {
        transform: translateY(-150%);
    }
}

/* Utilities */
@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* Process modal helpers (legacy-safe global fallback) */
.process-modal-lock-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
}

.process-cumprimento-toggle-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
}

.process-cumprimento-toggle-label {
    cursor: pointer;
}

.process-cumprimento-alert {
    background: rgba(0, 122, 255, 0.05);
    color: #007aff;
    border: 1px solid rgba(0, 122, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.85rem;
}

.process-client-card {
    background-color: #f9f9f9;
}

.process-add-client-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    box-shadow: none;
}

.process-remove-client-btn {
    padding: 4px 10px;
    font-size: 0.82rem;
    gap: 0.35rem;
    box-shadow: none;
}
