/**
 * Estilos específicos para a funcionalidade PJe TJBA - CEFamílias
 * Versão: UX/UI Refined (Branding Updated)
 */

/* --- Overlay --- */
.pje-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

/* --- Janela Flutuante --- */
.pje-window {
    width: 96%;
    height: 94%;
    max-width: 1600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Header Toolbar --- */
.pje-toolbar {
    background: #f8fcf9;
    padding: 12px 20px;
    border-bottom: 2px solid #1a633e;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

/* --- Branding (Atualizado) --- */
.pje-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    margin-right: 10px;
}
.pje-brand-title {
    color: #1a633e;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}
.pje-brand-subtitle {
    color: #6b7280; /* Cinza suave */
    font-size: 0.75rem;
    font-weight: 500;
    /* Removido uppercase para exibir o domínio corretamente */
    letter-spacing: 0.2px;
}

/* --- Grupos e Botões --- */
.pje-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-right: 1px solid #e0e0e0;
}
.pje-toolbar-group:last-child {
    border-right: none;
    margin-left: auto;
    padding-right: 0;
}

.pje-group-label {
    font-size: 0.65rem;
    color: #1a633e;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 4px;
    display: block;
}

.pje-btn-copy {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.pje-btn-copy:hover {
    border-color: #1a633e;
    color: #1a633e;
    background: #f0fdf4;
    transform: translateY(-1px);
}
.pje-btn-copy.copied {
    background: #1a633e;
    border-color: #1a633e;
    color: #fff;
}

.pje-value-highlight {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 700;
    color: #1a633e;
}

/* --- Ações --- */
.pje-btn-action {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.pje-btn-refresh {
    background: #eef2f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.pje-btn-refresh:hover { background: #e2e8f0; color: #1f2937; }

.pje-btn-petition {
    background: #1a633e;
    color: white;
    box-shadow: 0 4px 6px rgba(26, 99, 62, 0.2);
}
.pje-btn-petition:hover {
    background: #144d30;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(26, 99, 62, 0.25);
}

.pje-btn-close {
    background: #fee2e2;
    color: #dc2626;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 20px;
    padding: 0;
    justify-content: center;
}
.pje-btn-close:hover { background: #fecaca; color: #b91c1c; }

/* --- Iframe --- */
.pje-iframe-container {
    flex: 1;
    position: relative;
    background: #f3f4f6;
    width: 100%;
}
#pjeIframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* --- Loading --- */
.pje-loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #4b5563;
    pointer-events: none;
}
.pje-spinner {
    width: 40px; height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a633e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* --- Botão Principal (Etapa 6) --- */
.pje-btn-trigger {
    background-color: #fff;
    color: #1a633e;
    border: 2px solid #1a633e;
    padding: 0.55rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.pje-btn-trigger:hover {
    background-color: #1a633e;
    color: white;
    box-shadow: 0 4px 12px rgba(26, 99, 62, 0.25);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 
    from { opacity: 0; transform: scale(0.95); } 
    to { opacity: 1; transform: scale(1); } 
}

@media (max-width: 1024px) {
    .pje-window { width: 98%; height: 96%; }
}
@media (max-width: 768px) {
    .pje-toolbar { gap: 10px; padding: 10px; overflow-x: auto; }
    .pje-group-label { display: none; }
    .pje-btn-copy span { display: none; }
    .pje-toolbar-group { border-right: none; }
}