/* assets/css/frontend-styles.css */

/* Bloqueia scroll do fundo quando o modal está aberto */
body.wpun-modal-is-open {
    overflow: hidden;
    touch-action: none;
}

/* Painel lateral (modal) */
.wpun-modal {
    position: fixed;
    top: 0;
    right: -320px; /* Inicia fora da tela */
    width: 300px;
    height: 100%;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000001;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    pointer-events: auto;

    /* Garante que nada “vaze” na horizontal do painel */
    overflow: hidden;
}

/* Reset interno para evitar interferência do tema */
.wpun-modal, .wpun-modal * {
    box-sizing: border-box;
}

/* Overlay (película) */
.wpun-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000000; /* Abaixo do modal */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* Estados Abertos */
body.wpun-modal-is-open .wpun-modal { right: 0; }
body.wpun-modal-is-open .wpun-modal-overlay { opacity: 1; visibility: visible; }

/* Conteúdo do Modal */
.wpun-modal-content {
    padding: 15px 15px 15px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* a rolagem fica só na lista */
    position: relative;
    z-index: 2;
}

.wpun-modal-title {
    margin: 40px 40px 12px 40px;
    font-size: 20px;
    color: #333;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    cursor: pointer; /* permite fechar tocando no título */
}

/* Botão X (fechar) */
.wpun-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 19px;
    background: transparent;
    color: #666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .1s ease;
    z-index: 3;
}
.wpun-close-btn:hover { background: rgba(0,0,0,.06); color: #222; }
.wpun-close-btn:active { transform: scale(.96); }

/* LISTA: força coluna, desativa floats e SCROLL VERTICAL */
.wpun-notification-list {
    list-style: none;
    padding: 0 15px 15px 15px;
    margin: 0;

    display: block !important;          /* evita grid/flex do tema */
    overflow-y: auto !important;        /* rolagem vertical */
    overflow-x: hidden !important;      /* nunca scroll horizontal */
    -webkit-overflow-scrolling: touch;  /* rolagem suave no iOS */
    flex-grow: 1;
    max-width: 100%;
}

/* Itens da lista sempre em bloco, sem float nem posicionamento */
.wpun-notification-list > li {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px 0 !important;
}

/* CARD DA NOTIFICAÇÃO */
.wpun-notification-bubble {
    display: block;
    position: relative;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    width: 100%;
    max-width: 100%;
    /* Evita textos enormes “estourarem” pra direita */
    white-space: normal;
    word-break: break-word;     /* padrão */
    word-break: break-all;      /* força quebra se necessário */
    overflow-wrap: anywhere;    /* quebra em qualquer ponto */
    hyphens: auto;
}
.wpun-notification-bubble::after {
    content: "";
    display: block;
    clear: both; /* caso algum CSS do tema use float lá dentro */
}

.wpun-notification-bubble h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    line-height: 1.3;
}
.wpun-notification-bubble p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.45;
}
.wpun-notification-bubble small {
    display: block;
    font-size: 12px;
    color: #999;
}

/* Estado: notificação lida */
.wpun-notification-bubble.is-read {
    opacity: .8;
}

/* Estado: removendo/excluída */
.wpun-notification-bubble.is-deleted {
    opacity: 0.3;
}

/* Estado vazio */
.wpun-empty-state {
    text-align: center;
    color: #777;
    padding: 20px 10px;
    font-size: 14px;
}

/* Ações (botões) – garante que apareçam SEMPRE */
.wpun-actions {
    display: flex !important;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    margin-top: 10px;
    border-top: 1px solid #eee;
}
.wpun-actions button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid currentColor;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
    line-height: 1;
}
.wpun-mark-read {
    color: #0073aa;
    border-color: #0073aa;
}
.wpun-mark-read:hover {
    background-color: #0073aa;
    color: #ffffff;
}
.wpun-delete {
    color: #e60050;
    border-color: #e60050;
}
.wpun-delete:hover {
    background-color: #e60050;
    color: #ffffff;
}

/* ================================== */
/* === ÍCONE/BOTÃO DO ALERTA ======== */
/* ================================== */

@keyframes wpun-pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.wpun-notification-icon.has-notifications {
    -webkit-animation: wpun-pulse-animation 1.5s infinite;
    animation: wpun-pulse-animation 1.5s infinite;
}

/* Ícone/botão inativo (sem notificações) */
.wpun-notification-icon.inactive .wpun-custom-alert-button {
    filter: grayscale(1) opacity(0.6);
    animation: none !important;
}

/* Garantia: quando há notificações, remove o filtro cinza */
.wpun-notification-icon.has-notifications .wpun-custom-alert-button {
    filter: none !important;
}

/* Botão personalizado do ícone */
.wpun-custom-alert-button {
    height: auto;
    cursor: pointer;
    vertical-align: middle;
    width: 100%;
    transition: filter 0.3s ease;
}

/* Wrapper clicável do ícone */
.wpun-notification-icon-wrapper {
    display: inline-block;
    cursor: pointer;
}

/* Badge do ícone (se existir no seu HTML) */
.wpun-notification-icon .wpun-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e60050;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    vertical-align: top;
    margin-left: 6px;
}
.wpun-badge.is-hidden { display: none; }

/* Responsividade: painel mais largo em celulares estreitos */
@media (max-width: 420px) {
    .wpun-modal { width: 85vw; }
}


/* ================================== */
/* === ESTILOS DO FORMULÁRIO DE ENVIO === */
/* ================================== */

/* Container de cada campo do formulário */
.wpun-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Rótulos dos campos */
.wpun-form-group label {
    display: block; /* Força o rótulo a ocupar uma linha completa */
    margin-bottom: 5px;
    font-weight: bold;
    width: 100%; /* Garante que o label ocupe toda a largura */
}

/* Campos de texto e editor */
.wpun-form-group input[type="text"],
.wpun-form-group textarea,
.wpun-form-group .wp-editor-wrap {
    width: 100%; /* Faz com que os campos ocupem a largura total */
    box-sizing: border-box; /* Inclui padding e borda na largura total */
}

/* Campo de rádio (opções "Quem Notificar?") */
.wpun-form-group input[type="radio"],
.wpun-form-group input[type="checkbox"] {
    margin-right: 8px; /* Adiciona um pequeno espaço à direita */
}

/* Mensagem de sucesso */
.wpun-success-message {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    padding: 10px;
    margin-top: 15px;
    border-radius: 4px;
    text-align: center;
}

/* Campo "75 caracteres restantes" */
#subject_counter {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}