/* 
    OrionX Premium Design System
    Estilo Moderno / Glassmorphism / Mobile-First
*/

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #818cf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --msg-sent: #0ea5e9;
    --msg-received: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* Mantém a rolagem apenas nos containers internos */
    height: 100dvh;
    width: 100vw;
}

button {
    color: white !important;
}


/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Utilitários de Animação */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

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

/* Layout SPA */
#app-root {
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: row;
}

#app-main-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Telas (Ocultas por padrão) */
.screen {
    display: none;
    height: 100dvh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-dark);
    z-index: 50;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Estilo de Inputs */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

input[type="text"], input[type="tel"], input[type="password"], input[type="email"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Botões */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Login/Signup Visual */
.auth-container {
    padding: 2rem;
    max-width: 400px;
    margin: auto;
    width: 100%;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.chat-item:hover {
    background: var(--glass);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-border);
    margin-right: 12px;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    min-width: 0; /* Permite que o container encolha e o ellipsis funcione */
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-last-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Header */
.app-header {
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

/* FloatingActionButton */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 90;
}

#file-preview {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 15px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Imagens no Chat */
.msg-gif img {
    max-width: 320px;
    max-height: 400px;
    border-radius: 12px;
}

.chat-image {
    width: 250px;
    height: 180px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 8px;
    display: block;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-dark); /* Fundo placeholder escuro */
}

.chat-image:hover {
    filter: brightness(0.9);
}

/* Sidebar */
.sidebar {
    width: 80px;
    background: var(--bg-card);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 100;
    transition: var(--transition);
}

.sidebar.hidden-by-keyboard {
    display: none !important;
}

.sidebar-logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
}

.sidebar-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-tab {
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.sidebar-tab i {
    font-size: 1.4rem;
}

.sidebar-tab span {
    font-size: 0.65rem;
    font-weight: 600;
}

.sidebar-tab.active {
    color: var(--primary);
}

.sidebar-tab:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-bottom: 20px;
}

/* Grids */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 16px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 120px;
}

.album-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.album-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-dark);
}

.album-info {
    padding: 10px;
}

.album-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.photo-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-dark);
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.photo-item:hover img {
    transform: scale(1.05);
}

.note-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    position: relative;
    transition: var(--transition);
}
.note-card:hover {
    border-color: var(--primary);
}
.note-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.note-content {
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
}
.note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
    color: var(--text-muted);
}
.note-actions i:hover {
    color: var(--primary);
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 450px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
    #app-root {
        flex-direction: column-reverse;
    }
    .sidebar {
        width: 100%;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        flex-direction: row;
        padding: 0 10px env(safe-area-inset-bottom, 0px) 10px;
        border-right: none;
        border-top: 1px solid var(--glass-border);
    }
    .sidebar-logo { display: none; }
    .sidebar-tabs {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }
    .fab {
        bottom: 80px;
    }
    .sidebar-footer { display: none; }
    .sidebar-tab span { display: block; font-size: 0.6rem; }
    .sidebar.hidden-by-keyboard ~ .screen {
        padding-bottom: 0 !important;
    }
    body.keyboard-active .chat-input-section,
    .sidebar.hidden-by-keyboard ~ .screen .chat-input-section {
        bottom: 0 !important;
    }
    .chat-input-area {
        padding-bottom: 10px !important;
    }
    body.keyboard-active .chat-input-area,
    .sidebar.hidden-by-keyboard ~ .screen .chat-input-area {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .badge-dot {
        top: 2px;
        right: 15px;
    }
    #screen-main, #screen-albums, #screen-notes, #screen-contacts, #screen-new-group {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Ticks de Leitura */
.msg-status {
    font-size: 0.7rem;
    margin-left: 5px;
    opacity: 1; /* Aumentei opacidade para o preto ficar nítido */
    color: #000; /* Cor preta para ambos */
}

.msg-status.read {
    color: #000; /* Preto também quando lido */
}

/* Photo Management */
.photo-item {
    position: relative;
}

.photo-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

/* Archived Link */
.archived-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s;
}
.archived-link:hover { background: var(--glass); }
.archived-link i { color: var(--primary); font-size: 1.1rem; }
.archived-link .badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.badge-dot {
    position: absolute;
    top: -2px;
    right: 5px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 800;
    border: 2px solid var(--bg-card);
    z-index: 10;
}

/* Options Modal */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}
.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.option-item:hover { background: var(--glass); }
.option-item i { width: 20px; text-align: center; }
/* Status Stories */
.status-circle {
    position: relative;
    padding: 3px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-circle.unviewed {
    background: conic-gradient(#ef4444, #ffffff, #ef4444);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.status-circle .avatar {
    border: 2px solid var(--bg-dark);
    margin: 0;
    transform: rotate(0deg); /* Neutralizar o spin do pai na imagem */
}

.status-circle.unviewed .avatar {
    animation: spin-reverse 2s linear infinite;
}

@keyframes spin-reverse {
    100% { transform: rotate(-360deg); }
}

.status-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.status-progress-container {
    display: flex;
    gap: 4px;
    padding: 10px;
    position: absolute;
    top: 0;
    width: 100%;
}

.status-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.status-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
}

/* Photo Viewer */
.photo-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

.photo-viewer-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.5);
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

/* Mensagens e Balões */
.msg-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 8px;
}

.msg-group.sent {
    align-items: flex-end;
}

.msg-group.received {
    align-items: flex-start;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.95rem;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    word-wrap: break-word;
    color: white;
    max-width: 85%;
    min-width: 60px;
}

.msg-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-content img, 
.msg-content .file-msg {
    white-space: normal;
}

.msg-group.sent .msg-bubble {
    background: var(--msg-sent);
    border-bottom-right-radius: 4px;
}

.msg-group.received .msg-bubble {
    background: var(--msg-received);
    border-bottom-left-radius: 4px;
}

.msg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 4px;
    gap: 8px;
}

.msg-time {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Swipe to Reply */
.msg-group {
    position: relative;
}

.msg-bubble {
    transition: transform 0.1s ease-out;
    z-index: 2;
}

.swipe-reply-icon {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s, left 0.2s;
    z-index: 1;
}

.swipe-reply-icon.visible {
    opacity: 1;
    left: 10px;
}

.highlight-msg {
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0% { background-color: var(--primary); }
    100% { background-color: transparent; }
}

/* Gatilho de Reação Rápida */
.quick-react-trigger {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--bg-card);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.quick-react-trigger:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Reactions */
.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: -5px;
    margin-bottom: 10px;
    z-index: 6;
}

.reaction-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.reaction-pill:hover {
    background: rgba(255,255,255,0.2);
}

.reaction-pill.active {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.2);
}

/* Quick Reaction Bar */
.quick-reaction-bar {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 25px;
    display: flex;
    gap: 10px;
    box-shadow: var(--shadow);
    z-index: 100;
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { transform: translateX(-50%) scale(0); opacity: 0; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.quick-reaction-bar span {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.quick-reaction-bar span:hover {
    transform: scale(1.3);
}

/* Reply System */
.reply-quote {
    background: rgba(0,0,0,0.15);
    border-left: 3px solid var(--primary);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    overflow: hidden;
}

.reply-sender {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
}

.reply-text {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Swipe to Reply Animation */
.swipe-reply-hint {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.msg-bubble {
    transition: transform 0.2s;
    user-select: none;
}

/* Reply Preview Area above input */
#reply-preview-area {
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

@keyframes highlight {
    0% { transform: scale(1); filter: brightness(1.5); }
    50% { transform: scale(1.02); filter: brightness(1.8); }
    100% { transform: scale(1); filter: brightness(1); }
}

.highlight-msg {
    animation: highlight 1.5s ease-out;
}

/* Audio Player Custom */
.audio-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    min-width: 250px;
    white-space: normal;
}

.audio-avatar {
    flex-shrink: 0;
}

.audio-avatar .avatar {
    margin-right: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.audio-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    flex-shrink: 0;
}

.audio-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.audio-progress-container {
    flex: 1;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 17px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.audio-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(56, 189, 248, 0.15);
    width: 0%;
    border-radius: 0;
    z-index: 1;
}

.audio-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    padding: 0 10px;
}

.wave-bar {
    width: 3px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.playing .wave-bar {
    background: #fff;
    animation: waveAnim 0.6s infinite ease-in-out;
}

.playing .wave-bar:nth-child(2n) { animation-delay: 0.1s; }
.playing .wave-bar:nth-child(3n) { animation-delay: 0.2s; }
.playing .wave-bar:nth-child(4n) { animation-delay: 0.3s; }
.playing .wave-bar:nth-child(5n) { animation-delay: 0.4s; }

@keyframes waveAnim {
    0%, 100% { height: 6px; }
    50% { height: 18px; }
}

.audio-time {
    font-size: 0.65rem;
    opacity: 0.9;
    min-width: 35px;
    text-align: right;
    color: white;
}

.audio-speed-badge {
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    user-select: none;
}

.audio-speed-badge:active {
    transform: scale(0.9);
}

.audio-time-container {
    margin-left: auto;
    flex-shrink: 0;
}

/* Estabilizar botões de input */
#btn-send.hidden, #btn-mic.hidden {
    display: none !important;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Image Editor Visibility Fix */
#filerobot-editor-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    background: #000;
}
.filerobot-image-editor-root {
    width: 100% !important;
    height: 100% !important;
}

/* Media Picker Evolution */
.media-picker {
    position: relative;
    background: var(--bg-card);
    width: 100%;
    height: 400px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    box-shadow: var(--shadow);
    border-top: 1px solid var(--glass-border);
}

.picker-tabs-main {
    display: flex;
    background: var(--bg-card);
    border-bottom: 2px solid var(--glass-border);
    height: 65px;
    align-items: center;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
    font-size: 1.3rem;
}

.tab-item.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.backspace-item {
    color: var(--text-muted);
}

.backspace-item:active {
    color: white;
}

.picker-subtabs {
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    background: var(--bg-card);
}

.picker-subtabs i {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.picker-subtabs i.active {
    color: var(--primary);
}

.media-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
    align-content: start !important;
    overflow-y: auto !important;
    height: 350px !important;
}

.emoji-grid {
    grid-template-columns: repeat(7, 1fr) !important;
    padding-top: 0 !important;
}

.gif-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
}

.sticker-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
}

.sticker-grid .media-item {
    height: 100px !important;
    width: 100% !important;
    padding: 10px !important;
    background: rgba(255,255,255,0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sticker-grid .media-item img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.chat-gif {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    display: block;
    margin: 5px 0;
}

#gif-container input, 
#gif-container input:focus,
#gif-container input:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    border: none !important;
}


/* Sticker Message Styles */
.msg-bubble.msg-sticker {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 95% !important;
}

.msg-sticker .sticker-img {
    max-width: 100px;
    max-height: 100px;
}

.msg-sticker .lottie-container {
    width: 100px;
    height: 100px;
}

/* GIF in Chat */
.msg-bubble.msg-gif-bubble {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 95% !important;
}

.chat-gif {
    width: 320px !important;
    height: auto !important;
    max-width: 95% !important;
    max-height: 500px;
    border-radius: 12px;
    display: block;
}

.media-item {
    position: relative !important;
    width: 100% !important;
    height: 120px !important;
    background: var(--bg-dark) !important;
    border-radius: 12px !important;
    border: 1px solid var(--glass-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
    cursor: pointer;
    transition: all 0.2s;
}

.media-item:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.media-item img, .media-item div {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
}

.emoji-grid .media-item {
    height: 45px !important;
    background: transparent !important;
    border: none !important;
}

/* Photo Viewer Navigation */
.photo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: background 0.3s;
    font-size: 1.2rem;
}

.photo-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.photo-nav-prev { left: 10px; }
.photo-nav-next { right: 10px; }

.photo-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.photo-viewer-header {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.photo-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.photo-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- Multi-line Chat Input & Adjustments --- */
#msg-input {
    transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

#msg-input:focus {
    border-color: var(--primary);
    background: #1e293b;
}

/* Garante que o texto 'Editado' seja legível */
.msg-footer span[style*="color: #000"] {
    color: #000 !important;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Micro-animação de batida de coração para curtida de status */
@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.animate-beat {
    animation: heartBeat 0.8s ease-in-out;
}

/* Ajuste do visualizador de status para tela cheia (ocultando a barra inferior) */
#screen-status-view {
    z-index: 2000 !important;
    padding-bottom: 0 !important;
    height: 100dvh !important;
}

/* ============================================
   DICA 4 — INDICADOR DE DIGITAÇÃO (Typing Indicator)
   Aparece diretamente no #chat-status, no lugar do "online"
   ============================================ */

/* Pontinhos pulsantes que aparecem dentro do #chat-status */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%           { transform: translateY(-4px); opacity: 1; }
}

/* Estado do status quando está mostrando indicador de digitação */
#chat-status.is-typing {
    color: var(--primary);
    font-style: italic;
}

/* ============================================
   DICA 5 — TEMAS DE CHAT (Chat Themes)
   ============================================ */

/* Tema padrão */
#messages-container.theme-default {
    background: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-blend-mode: overlay;
    background-color: #0f172a;
}

/* Tema Pôr do Sol (Sunset) */
#messages-container.theme-sunset {
    background: linear-gradient(160deg, #1a0533 0%, #4a1030 30%, #8b2252 60%, #c4603a 100%);
    background-attachment: fixed;
}

/* Tema Neon Cyberpunk */
#messages-container.theme-neon {
    background: radial-gradient(ellipse at top left, #0d0630 0%, #110d2b 40%, #051a0d 100%);
    position: relative;
}
#messages-container.theme-neon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(159,0,255,0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0,255,163,0.10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
#messages-container.theme-neon > * { position: relative; z-index: 1; }

/* Tema Floresta (Forest) */
#messages-container.theme-forest {
    background: linear-gradient(180deg, #071a0e 0%, #0d2b16 40%, #153d20 100%);
    background-attachment: fixed;
}

/* Tema Oceano (Ocean) */
#messages-container.theme-ocean {
    background: linear-gradient(160deg, #030d1a 0%, #041e3c 40%, #0a3a5c 70%, #0e5070 100%);
    background-attachment: fixed;
}

/* Tema Galáxia (Galaxy) */
#messages-container.theme-galaxy {
    background: radial-gradient(ellipse at center, #1a0a3e 0%, #0d0620 50%, #000010 100%);
    position: relative;
    overflow: hidden;
}
#messages-container.theme-galaxy::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 70%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 80%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 90%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 60% 40%, rgba(167,139,250,0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 40% 60%, rgba(56,189,248,0.4) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}
#messages-container.theme-galaxy > * { position: relative; z-index: 1; }

/* Tema Minimal (Glass Frost) */
#messages-container.theme-minimal {
    background: linear-gradient(135deg, #0e1117 0%, #161b22 50%, #0e1117 100%);
    backdrop-filter: blur(10px);
}

/* Tema Aurora Rosa (Claro) */
#messages-container.theme-aurora {
    background: linear-gradient(160deg, #fff0f6 0%, #fce4ec 40%, #f8bbd0 70%, #ffdde9 100%);
    background-attachment: fixed;
}
#messages-container.theme-aurora .msg-group.sent .msg-bubble {
    background: #e91e8c;
    color: #fff;
}
#messages-container.theme-aurora .msg-group.received .msg-bubble {
    background: rgba(255,255,255,0.9);
    color: #2d2d2d;
    border: 1px solid rgba(0,0,0,0.08);
}
#messages-container.theme-aurora .msg-time { color: rgba(0,0,0,0.45); }
#messages-container.theme-aurora .reply-sender { color: #e91e8c; }

/* Tema Brisa do Mar (Claro) */
#messages-container.theme-breeze {
    background: linear-gradient(160deg, #e0f7fa 0%, #b2ebf2 35%, #e0f2f1 70%, #f1f8f9 100%);
    background-attachment: fixed;
}
#messages-container.theme-breeze .msg-group.sent .msg-bubble {
    background: #0097a7;
    color: #fff;
}
#messages-container.theme-breeze .msg-group.received .msg-bubble {
    background: rgba(255,255,255,0.9);
    color: #2d2d2d;
    border: 1px solid rgba(0,0,0,0.08);
}
#messages-container.theme-breeze .msg-time { color: rgba(0,0,0,0.45); }
#messages-container.theme-breeze .reply-sender { color: #0097a7; }

/* === MODAL DE SELECAO DE TEMAS === */

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.theme-card {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    aspect-ratio: 3/4;
    position: relative;
}

.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.theme-card.active-theme {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

.theme-card .theme-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 4px;
    justify-content: flex-end;
}

.theme-card .theme-bubble-sent {
    align-self: flex-end;
    background: rgba(14, 165, 233, 0.85);
    border-radius: 10px 10px 2px 10px;
    width: 65%;
    height: 10px;
}

.theme-card .theme-bubble-recv {
    align-self: flex-start;
    background: rgba(51, 65, 85, 0.85);
    border-radius: 10px 10px 10px 2px;
    width: 55%;
    height: 10px;
}

.theme-card .theme-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 4px 4px 6px;
    letter-spacing: 0.03em;
}

/* Pré-visualizações dos temas nos cards */
.theme-card[data-theme="default"] .theme-preview {
    background: #0f172a;
}
.theme-card[data-theme="sunset"] .theme-preview {
    background: linear-gradient(160deg, #1a0533 0%, #4a1030 30%, #8b2252 60%, #c4603a 100%);
}
.theme-card[data-theme="neon"] .theme-preview {
    background: radial-gradient(ellipse at top left, #0d0630 0%, #110d2b 40%, #051a0d 100%);
}
.theme-card[data-theme="forest"] .theme-preview {
    background: linear-gradient(180deg, #071a0e 0%, #0d2b16 40%, #153d20 100%);
}
.theme-card[data-theme="ocean"] .theme-preview {
    background: linear-gradient(160deg, #030d1a 0%, #041e3c 40%, #0a3a5c 70%, #0e5070 100%);
}
.theme-card[data-theme="galaxy"] .theme-preview {
    background: radial-gradient(ellipse at center, #1a0a3e 0%, #0d0620 50%, #000010 100%);
}
.theme-card[data-theme="minimal"] .theme-preview {
    background: linear-gradient(135deg, #0e1117 0%, #161b22 50%, #0e1117 100%);
}

.theme-card[data-theme="aurora"] .theme-preview {
    background: linear-gradient(160deg, #fff0f6 0%, #fce4ec 40%, #f8bbd0 100%);
}
.theme-card[data-theme="aurora"] .theme-bubble-sent {
    background: rgba(233, 30, 140, 0.85);
}
.theme-card[data-theme="aurora"] .theme-bubble-recv {
    background: rgba(255, 255, 255, 0.9);
}

.theme-card[data-theme="breeze"] .theme-preview {
    background: linear-gradient(160deg, #e0f7fa 0%, #b2ebf2 40%, #e0f2f1 100%);
}
.theme-card[data-theme="breeze"] .theme-bubble-sent {
    background: rgba(0, 151, 167, 0.85);
}
.theme-card[data-theme="breeze"] .theme-bubble-recv {
    background: rgba(255, 255, 255, 0.9);
}

/* Nos temas claros, o nome do tema precisa ser legível */
.theme-card[data-theme="aurora"] .theme-name,
.theme-card[data-theme="breeze"] .theme-name {
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    color: #fff;
}

/* Ícone de check no tema ativo */
.theme-card.active-theme::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary);
    color: #000;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    text-align: center;
}

/* Badge de "Claro" nos temas claros */
.theme-card[data-theme="aurora"]::before,
.theme-card[data-theme="breeze"]::before {
    content: '☀️';
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.7rem;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Pinned Message Bar styles */
#pinned-message-bar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.2s;
    max-height: 45px;
    box-sizing: border-box;
    overflow: hidden;
}

#pinned-message-bar:hover {
    background: rgba(45, 55, 75, 0.95);
}

@keyframes highlightFlash {
    0% { box-shadow: 0 0 20px 5px var(--primary); }
    100% { box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
}

.msg-bubble.highlight-pinned {
    animation: highlightFlash 2s ease-in-out;
}

/* --- Estilos para Menções (@Mentions) --- */
.mention-dropdown {
    position: absolute;
    bottom: 55px;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 6px 0;
    box-sizing: border-box;
}

.mention-dropdown::-webkit-scrollbar {
    width: 5px;
}
.mention-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.mention-item:hover, .mention-item.active {
    background: rgba(56, 189, 248, 0.15);
}

.mention-item:active {
    transform: scale(0.98);
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--glass-border);
}

.mention-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.mention-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.mention-username {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Destaque das Tags de Menção no Texto do Chat */
.mention-tag {
    color: #000000 !important;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.45);
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

.mention-tag:hover {
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.mention-tag.me {
    color: #000000 !important;
    background: rgba(251, 191, 36, 0.8) !important;
    border-color: rgba(251, 191, 36, 0.95);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(251, 191, 36, 0.3); }
    50% { border-color: rgba(251, 191, 36, 0.7); }
}

/* Badge de Menção no Balão de Mensagem no Chat */
.msg-group {
    position: relative;
}

.msg-mention-badge {
    position: absolute;
    right: -10px; /* Posição segura para balão recebido (lado direito) */
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 10;
    animation: pulseBadge 2.5s infinite;
    cursor: default;
}

.msg-group.sent .msg-mention-badge {
    left: -10px; /* Posição segura para balão enviado (lado esquerdo) */
    right: auto;
}

@keyframes pulseBadge {
    0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
    50% { transform: translateY(-50%) scale(1.1); box-shadow: 0 6px 14px rgba(244, 63, 94, 0.6); }
}

/* --- TELEGRAM-STYLE ATTACHMENT MODAL & EDITOR CUSTOM CSS --- */

/* Quinas nativas e minimalistas para o Cropper.js */
.cropper-view-box {
    outline: 2px solid rgba(255, 255, 255, 0.7) !important;
}
.cropper-line {
    background-color: transparent !important;
}
.cropper-point {
    background-color: #fff !important;
    width: 6px !important;
    height: 6px !important;
    opacity: 0.85;
}
/* Style the corners thicker like standard mobile crop */
.cropper-point.point-se,
.cropper-point.point-sw,
.cropper-point.point-ne,
.cropper-point.point-nw {
    background-color: transparent !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 0 !important;
    opacity: 1;
}
.cropper-point.point-nw {
    border-top: 3px solid #ffffff !important;
    border-left: 3px solid #ffffff !important;
}
.cropper-point.point-ne {
    border-top: 3px solid #ffffff !important;
    border-right: 3px solid #ffffff !important;
}
.cropper-point.point-sw {
    border-bottom: 3px solid #ffffff !important;
    border-left: 3px solid #ffffff !important;
}
.cropper-point.point-se {
    border-bottom: 3px solid #ffffff !important;
    border-right: 3px solid #ffffff !important;
}

/* Modal de Anexo Telegram Style */
.telegram-modal-card {
    background: #182533 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
    width: 90% !important;
    max-width: 420px !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
    animation: modalIn 0.25s ease-out;
}

/* Botões do Editor e Modal */
.btn-telegram-text {
    background: transparent !important;
    border: none !important;
    color: #5288c1 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    transition: opacity 0.2s, background-color 0.2s !important;
    border-radius: 8px !important;
}
.btn-telegram-text:hover {
    background-color: rgba(82, 136, 193, 0.1) !important;
    opacity: 0.9;
}

.editor-action-capsule {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 15px) + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 85%;
    max-width: 400px;
    z-index: 10005;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.editor-capsule-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.editor-capsule-icons i {
    color: #708499;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 6px;
    border-radius: 50%;
}

.editor-capsule-icons i:hover, .editor-capsule-icons i.active {
    color: #ffffff;
    transform: scale(1.15);
}

.editor-capsule-icons i.active {
    color: #5288c1;
}

/* Painel de Cores do Editor */
.editor-colors-floating {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 15px) + 75px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 80%;
    max-width: 340px;
    z-index: 10004;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

/* Sub-paleta Active/Hover states */
.editor-colors-floating button.btn-telegram-text {
    border: 1px solid transparent !important;
    transition: all 0.2s !important;
}
.editor-colors-floating button.btn-telegram-text:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}
.editor-colors-floating button.btn-telegram-text.active {
    background-color: rgba(82, 136, 193, 0.15) !important;
    border-color: rgba(82, 136, 193, 0.4) !important;
    color: #ffffff !important;
}

/* Custom Scrollbar para Emojis */
.attachment-emoji-picker-container::-webkit-scrollbar {
    width: 6px;
}
.attachment-emoji-picker-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.attachment-emoji-picker-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
.attachment-emoji-picker-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsividade Mobile - Teclado Aberto */
@media (max-height: 600px) {
    .telegram-modal-card {
        max-height: 95vh !important;
        overflow-y: auto !important;
        padding: 15px !important;
        gap: 10px !important;
    }
    .telegram-modal-card #attachment-preview-img,
    .telegram-modal-card #attachment-preview-video {
        max-height: 140px !important;
    }
}

