/* Explain: Styles for chat features like emoji picker, audio cards, recorder, and chat window controls within tabs. */
/* Seletor de emojis, cartões de áudio, gravador e janela de conversa estilo MSN da Liga PDB. */

/* ---------- Seletor de emojis ---------- */
.pdb-emoji-picker {
    position: fixed;
    z-index: 120;
    width: min(20rem, calc(100vw - 1rem));
    border: 1px solid var(--menu-border);
    border-radius: 1rem;
    background: var(--menu-bg);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.pdb-emoji-tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--menu-bg-alt);
    padding: 0.35rem;
    overflow-x: auto;
}

.pdb-emoji-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    background: transparent;
    font-size: 1.05rem;
    cursor: pointer;
}

.pdb-emoji-tab:hover { background: var(--menu-hover-bg); }
.pdb-emoji-tab.is-active { border-color: var(--accent-color); background: var(--menu-active-bg); }

.pdb-emoji-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.1rem;
    max-height: 12rem;
    overflow-y: auto;
    padding: 0.35rem;
}

.pdb-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.pdb-emoji-btn:hover { background: var(--menu-hover-bg); }

/* ---------- Cartões de áudio ---------- */
.pdb-audio {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pdb-audio-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: var(--terracotta-soft);
    color: var(--logo-subtitle-color);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.pdb-audio-play:hover { transform: scale(1.06); }
.pdb-audio-dur { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; }
.pdb-audio-el { display: none; }
.pdb-audio.is-expired { display: block; }
.pdb-audio-expired { display: block; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }

.pdb-bubble-who {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--sage-dark);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- Gravador de áudio ---------- */
.pdb-rec-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--accent-color);
    border-radius: 0.85rem;
    background: var(--menu-bg);
    padding: 0.5rem 0.7rem;
}

.pdb-rec-dot {
    width: 0.65rem;
    height: 0.65rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #FF4433;
    animation: pdbRecPulse 1s infinite;
}

@keyframes pdbRecPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pdb-rec-label { color: var(--text-color); font-size: 0.82rem; font-weight: 700; }
.pdb-rec-left { margin-left: auto; color: var(--logo-subtitle-color); font-size: 0.82rem; font-weight: 700; }

.pdb-rec-track {
    height: 4px;
    margin-top: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.pdb-rec-bar { height: 100%; width: 0; background: var(--accent-color); transition: width 200ms linear; }

.pdb-rec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--menu-bg-alt);
    color: var(--text-color);
    padding: 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.pdb-rec-stop { border-color: #FF6A5A; color: #FF6A5A; }
.pdb-rec-send { border: 0; background: var(--button-color); color: var(--text-color); }
.pdb-rec-send:hover { background: var(--primary-hover); }
.pdb-rec-cancel { color: var(--text-muted); }
.pdb-rec-audio { height: 2.4rem; max-width: 12rem; flex: 1; }
.pdb-rec-hint, .pdb-rec-error { color: var(--text-muted); font-size: 0.8rem; }
.pdb-rec-error { color: #FF6A5A; }

.pdb-chat-tool.is-recording,
#pdbMsgMic.is-recording {
    border-color: #FF4433;
    color: #FF4433;
    box-shadow: 0 0 10px rgba(255, 68, 51, 0.6);
}

/* ---------- Cabeçalho interno das conversas ---------- */
.pdb-tab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--menu-bg-alt);
    border-bottom: 1px solid var(--glass-border);
}

.pdb-tab-head-info { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.pdb-tab-head-avatar { width: 1.8rem; height: 1.8rem; border-radius: 999px; object-fit: cover; }
.pdb-tab-head-names { display: flex; flex-direction: column; min-width: 0; }
.pdb-tab-head-name { font-size: 0.85rem; font-weight: 700; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdb-tab-head-sub { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.pdb-chat-controls { display: inline-flex; gap: 0.3rem; }

.pdb-chat-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.7rem;
    cursor: pointer;
}

.pdb-chat-ctrl:hover { background: rgba(255, 255, 255, 0.28); }
.pdb-chat-ctrl.is-close:hover { background: rgba(0, 0, 0, 0.4); }

.pdb-chat-body { display: flex; flex-direction: column; min-height: 0; flex: 1; background: var(--menu-bg); }
.pdb-chat-list { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; overflow-y: auto; padding: 0.75rem; }
.pdb-chat-empty { color: var(--text-muted); font-size: 0.85rem; }

.pdb-chat-foot { border-top: 1px solid var(--glass-border); background: var(--menu-bg-alt); padding: 0.5rem 0.6rem 0.55rem; }
.pdb-chat-composer { display: flex; align-items: flex-end; gap: 0.35rem; }

.pdb-chat-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--menu-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease;
}

.pdb-chat-tool:hover { border-color: var(--accent-color); }

.pdb-chat-input {
    width: 100%;
    min-height: 2.4rem;
    max-height: 6rem;
    resize: none;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: var(--field-bg);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.pdb-chat-input:focus { border-color: var(--accent-color); outline: none; }

.pdb-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: var(--button-color);
    color: var(--text-color);
    cursor: pointer;
}

.pdb-chat-send:hover { background: var(--primary-hover); }
.pdb-chat-notice { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.66rem; line-height: 1.4; }
.pdb-chat-status { margin-top: 0.25rem; font-size: 0.74rem; }
.pdb-chat-status.success { color: #57D98C; }
.pdb-chat-status.error { color: #FF6A5A; }

/* ---------- Janela de amigos: não lidas e perfil Steam ---------- */
.pdb-msn-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--button-color);
    color: var(--text-color);
    padding: 0 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
}

.pdb-msn-steam {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    background: transparent;
    color: #66C0F4;
    cursor: pointer;
}

.pdb-msn-steam:hover { background: var(--menu-hover-bg); }

/* ---------- Bloqueio de piloto ---------- */
.pdb-chat-ctrl.is-active {
    border-color: #FF6A5A;
    background: rgba(255, 106, 90, 0.22);
    color: #FF6A5A;
}

.pdb-chat-composer.is-blocked { opacity: 0.55; }
.pdb-chat-composer.is-blocked .pdb-chat-input,
.pdb-chat-composer.is-blocked .pdb-chat-tool,
.pdb-chat-composer.is-blocked .pdb-chat-send { cursor: not-allowed; }