/*
 * sinagoga-chat — estilos para integração no Beit Tikvá
 * Cores extraídas do site: washi #F2EDE2, ink #1A2436, pop #C44536, ink-soft #5F6470
 * Incluir este arquivo no site e adicionar o widget via chat-widget.html
 */

.beit-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.beit-chat-widget__toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 0;
    background: var(--pop, #C44536);
    color: var(--washi-bright, #FAF6EC);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(196, 69, 54, 0.35),
        inset 0 0 0 1px rgba(250, 246, 236, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.beit-chat-widget__toggle::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(250, 246, 236, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

.beit-chat-widget__toggle-letter {
    font-family: 'Frank Ruhl Libre', 'SBL Hebrew', serif;
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1;
    color: var(--washi-bright, #FAF6EC);
    transform: translateY(-1px);
    user-select: none;
}

.beit-chat-widget__toggle:hover,
.beit-chat-widget__toggle:focus-visible {
    transform: scale(1.05);
    box-shadow:
        0 8px 24px rgba(196, 69, 54, 0.45),
        inset 0 0 0 1px rgba(250, 246, 236, 0.25);
}

.beit-chat-widget__toggle:focus-visible {
    outline: 2px solid var(--ink, #1A2436);
    outline-offset: 3px;
}

.beit-chat-widget__panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--washi-bright, #FAF6EC);
    border: 1px solid rgba(26, 36, 54, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(26, 36, 54, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.beit-chat-widget.is-open .beit-chat-widget__panel {
    display: flex;
}

.beit-chat-widget__header {
    background: var(--washi, #F2EDE2);
    border-bottom: 1px solid rgba(26, 36, 54, 0.1);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.beit-chat-widget__title {
    font-family: 'Shippori Mincho', 'Frank Ruhl Libre', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink, #1A2436);
    margin: 0;
}

.beit-chat-widget__subtitle {
    font-size: 0.74rem;
    color: var(--ink-soft, #5F6470);
    margin-top: 2px;
}

.beit-chat-widget__close {
    background: none;
    border: 0;
    color: var(--ink-soft, #5F6470);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.beit-chat-widget__close:hover,
.beit-chat-widget__close:focus-visible {
    color: var(--pop, #C44536);
    background: rgba(196, 69, 54, 0.08);
}

.beit-chat-widget__close:focus-visible {
    outline: 2px solid var(--pop, #C44536);
    outline-offset: 2px;
}

.beit-chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.beit-chat-widget__message {
    max-width: 80%;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.92rem;
    animation: beit-fadeIn 0.3s ease;
}

.beit-chat-widget__message--assistant {
    align-self: flex-start;
    background: var(--washi, #F2EDE2);
    color: var(--ink, #1A2436);
    border-bottom-left-radius: 4px;
}

.beit-chat-widget__message--user {
    align-self: flex-end;
    background: var(--pop, #C44536);
    color: var(--washi-bright, #FAF6EC);
    border-bottom-right-radius: 4px;
}

.beit-chat-widget__typing::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--pop, #C44536);
    margin-left: 4px;
    animation: beit-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes beit-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes beit-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.beit-chat-widget__form {
    display: flex;
    gap: 8px;
    padding: 14px 20px 20px;
    border-top: 1px solid rgba(26, 36, 54, 0.1);
    background: var(--washi-bright, #FAF6EC);
}

.beit-chat-widget__input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(26, 36, 54, 0.16);
    border-radius: 24px;
    background: white;
    color: var(--ink, #1A2436);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.beit-chat-widget__input:focus {
    border-color: var(--pop, #C44536);
}

.beit-chat-widget__send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--pop, #C44536);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.beit-chat-widget__send:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.03);
}

.beit-chat-widget__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .beit-chat-widget__panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        right: 0;
    }
}
