/* =============================================
   Birthday Widget — Estilos do front-end
   Baseado no layout: card branco, borda roxa,
   badge roxo com data, foto circular, e-mail teal
   ============================================= */

/* Cores do widget */
:root {
    --bw-purple:      #7b2d8b;
    --bw-purple-dark: #5e1f6e;
    --bw-teal:        #2a9d8f;
    --bw-teal-dark:   #1f7a6e;
    --bw-bg:          #f4f4f8;
    --bw-card-bg:     #ffffff;
    --bw-border:      #e5e5ef;
    --bw-text:        #333333;
    --bw-muted:       #888888;
    --bw-radius:      14px;
}

/* Container geral do widget (sidebar clássica e Elementor) */
.widget.widget_bw_birthday_widget,
.bw-widget-wrap,
.bw-card {
    background-color: #ffffff;
    border-radius: var(--bw-radius);
    box-shadow: 0 2px 16px rgba(0,0,0,0.09);
    padding: 22px 18px 18px;
    font-family: inherit;
}

/* Título do widget (sidebar clássica e Elementor) */
.widget_bw_birthday_widget .widget-title,
.bw-widget-wrap .widgettitle,
.bw-card-title {
    font-size: 17px;
    font-weight: 700;
    display: block;
    margin: 0 0 16px;
}

.widget_bw_birthday_widget .widget-title::before,
.bw-widget-wrap .widgettitle::before {
    content: "🎂";
    font-size: 18px;
}

/* Lista com scroll — altura = ~3 itens visíveis por padrão */
.bw-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 252px;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #c0a0cc #f0f0f5;
    padding-right: 4px;
}

.bw-list::-webkit-scrollbar {
    width: 5px;
}

.bw-list::-webkit-scrollbar-track {
    background: #f0f0f5;
    border-radius: 10px;
}

.bw-list::-webkit-scrollbar-thumb {
    background: #c0a0cc;
    border-radius: 10px;
}

.bw-list::-webkit-scrollbar-thumb:hover {
    background: #7b2d8b;
}

/* Cada item */
.bw-item {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f9f9fb;
    border-radius: 12px;
    border-left: 4px solid var(--bw-purple);
    overflow: hidden;
    min-height: 72px;
    transition: box-shadow 0.2s;
}

.bw-item:hover {
    box-shadow: 0 2px 12px rgba(123,45,139,0.13);
}

/* Badge de data (dia + mês) */
.bw-badge {
    flex-shrink: 0;
    background-color: #7b2d8b;
    color: #fff;
    width: 54px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1.1;
    padding: 6px 0;
}

.bw-badge-dia {
    font-size: 20px;
    font-weight: 800;
}

.bw-badge-mes {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.92;
}

/* Avatar circular */
.bw-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px 0 10px;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.13);
}

.bw-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bw-avatar-initials {
    font-size: 16px;
    font-weight: 700;
    color: var(--bw-purple);
    user-select: none;
}

/* Nome */
.bw-info {
    flex: 1;
    min-width: 0;
}

.bw-nome {
    font-size: 15px;
    font-weight: 600;
    color: var(--bw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Ícone de e-mail (teal) */
.bw-email-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bw-teal);
    color: #fff;
    text-decoration: none;
    margin-right: 12px;
    transition: background 0.2s, transform 0.15s;
}

.bw-email-btn:hover {
    background: var(--bw-teal-dark);
    color: #fff;
    transform: scale(1.08);
}

.bw-email-btn svg {
    display: block;
}
.bw-email-btn * { pointer-events: none; }

/* Item sem data (sem badge nem foto) */
.bw-item.bw-no-date .bw-badge {
    display: none;
}

/* Estado vazio */
.bw-empty {
    color: var(--bw-muted);
    font-size: 13px;
    margin: 8px 0 0;
    text-align: center;
    padding: 16px 0;
}

/* =============================================
   Modal de e-mail
   ============================================= */

.bw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bw-modal-overlay.bw-open {
    display: flex;
}

.bw-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 420px;
    position: relative;
    animation: bwModalIn 0.22s ease;
}

@keyframes bwModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.bw-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.bw-modal-close:hover { color: #555; }

.bw-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bw-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0d0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--bw-purple);
    flex-shrink: 0;
}

.bw-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-modal-info { flex: 1; }

.bw-modal-nome {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    display: block;
}

.bw-modal-email-addr {
    font-size: 12px;
    color: #888;
    display: block;
    margin-top: 2px;
}

.bw-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.bw-modal textarea {
    width: 100%;
    min-height: 110px;
    border: 1.5px solid #e0e0e8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.bw-modal textarea:focus {
    outline: none;
    border-color: var(--bw-purple);
}

.bw-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

.bw-btn-cancel {
    background: #f0f0f5;
    color: #555;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bw-btn-cancel:hover { background: #e4e4ec; }

.bw-btn-send {
    background: var(--bw-teal);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s, transform 0.15s;
}

.bw-btn-send:hover {
    background: var(--bw-teal-dark);
    transform: scale(1.03);
}

/* =============================================
   Paginação / Navegação por setas
   ============================================= */

.bw-hidden {
    display: none !important;
}

.bw-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 14px;
    padding-top: 10px;
}

.bw-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bw-teal, #2a9d8f);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    vertical-align: middle;
    text-align: center;
}

.bw-nav-btn i,
.bw-nav-btn svg {
    display: block;
    margin: auto;
    width: 16px;
    height: 16px;
}

.bw-nav-btn:hover {
    background: var(--bw-teal-dark, #1f7a6e);
    transform: scale(1.05);
}

.bw-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: #cccccc;
}

.bw-nav-info {
    display: none;
}

/* Título multilinha */
.bw-card-title {
    display: block;
    line-height: 1.5;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 700;
}

.bw-card-title br {
    display: block;
    content: '';
}

/* =============================================
   Botão Ver Todos + Nav row
   ============================================= */

.bw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bw-nav-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.bw-ver-todos {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--bw-purple, #7b2d8b);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.bw-ver-todos:hover {
    text-decoration: underline;
}
