/* ===== CHAT PÚBLICO - STREAM PLEX THEME ===== */

/* Variáveis do tema */
:root {
    --chat-bg-primary: #0a1929;
    --chat-bg-secondary: #0f2439;
    --chat-bg-card: #132f4c;
    --chat-text-primary: #ffffff;
    --chat-text-secondary: #b3cde0;
    --chat-accent: #00d9ff;
    --chat-accent-hover: #00b8d9;
    --chat-border: #1e3a5f;
}

/* Botão Flutuante do Chat */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-hover) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(0, 217, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9999;
    animation: pulse-chat 2s infinite;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 40px rgba(0, 217, 255, 0.6);
}

.chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-bubble .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3366;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    animation: bounce-badge 0.5s ease infinite alternate;
    box-shadow: 0 2px 8px rgba(255, 51, 102, 0.5);
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 4px 30px rgba(0, 217, 255, 0.4);
    }
    50% {
        box-shadow: 0 4px 40px rgba(0, 217, 255, 0.7);
    }
}

@keyframes bounce-badge {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

/* Container do Chat */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    height: 640px;
    background: var(--chat-bg-card);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--chat-border);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    animation: slideUp-chat 0.3s ease;
}

.chat-container.active {
    display: flex;
}

@keyframes slideUp-chat {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho do Chat */
.chat-header {
    background: var(--chat-bg-secondary);
    padding: 18px 20px;
    color: var(--chat-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--chat-border);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-header-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-hover) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 10px rgba(0, 217, 255, 0.3);
}

.chat-header-details {
    flex: 1;
}

.chat-header-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--chat-text-primary);
}

.chat-header-status {
    font-size: 12px;
    color: var(--chat-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--chat-accent);
    background: rgba(0, 217, 255, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    width: fit-content;
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--chat-text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
    line-height: 1;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--chat-text-primary);
    transform: rotate(90deg);
}

/* Área de Mensagens */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--chat-bg-primary);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--chat-bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chat-accent);
}

/* Mensagens */
.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn-chat 0.3s ease;
}

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

.message.user {
    justify-content: flex-end;
}

.message.other {
    justify-content: flex-start;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-left: 4px;
}

.message-avatar {
    font-size: 16px;
}

.message-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-accent);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-hover) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 217, 255, 0.3);
}

.message.other .message-bubble {
    background: var(--chat-bg-secondary);
    color: var(--chat-text-primary);
    border: 1px solid var(--chat-border);
    border-bottom-left-radius: 4px;
    border-left: 3px solid var(--chat-accent);
}

.message-text {
    line-height: 1.5;
    font-size: 14px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 6px;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message.other .message-time {
    color: var(--chat-text-secondary);
}

/* Indicador de digitação */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--chat-bg-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 16px;
}

.typing-avatar {
    font-size: 16px;
}

.typing-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-accent);
}

.typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--chat-accent);
    border-radius: 50%;
    animation: typing-anim 1.4s infinite;
}

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

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

@keyframes typing-anim {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Área de Input */
.chat-input-area {
    padding: 16px;
    background: var(--chat-bg-secondary);
    border-top: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--chat-bg-primary);
    color: var(--chat-text-primary);
}

.chat-input::placeholder {
    color: var(--chat-text-secondary);
}

.chat-input:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--chat-border);
    background: var(--chat-bg-primary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
    color: var(--chat-text-secondary);
}

.chat-btn:hover {
    background: var(--chat-accent);
    border-color: var(--chat-accent);
    color: white;
    transform: scale(1.05);
}

.send-btn {
    background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-hover) 100%);
    border: none;
    color: white;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4);
}

/* Picker de Emoji */
.emoji-picker {
    display: none;
    background: var(--chat-bg-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.emoji-picker.active {
    display: grid;
}

.emoji-picker::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker::-webkit-scrollbar-track {
    background: var(--chat-bg-primary);
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 3px;
}

.emoji-item {
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.emoji-item:hover {
    background: var(--chat-bg-primary);
    transform: scale(1.15);
}

/* GIF Picker */
.gif-picker {
    display: none;
    background: var(--chat-bg-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.gif-picker.active {
    display: block;
}

.gif-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--chat-bg-primary);
    color: var(--chat-text-primary);
    outline: none;
}

.gif-search::placeholder {
    color: var(--chat-text-secondary);
}

.gif-search:focus {
    border-color: var(--chat-accent);
}

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

.gif-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    height: 120px;
    background: var(--chat-bg-primary);
    border: 1px solid var(--chat-border);
}

.gif-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3);
    border-color: var(--chat-accent);
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mensagem com imagem/GIF */
.message-media {
    max-width: 220px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--chat-border);
}

.message-media img {
    width: 100%;
    display: block;
}

/* Mensagem de boas-vindas */
.welcome-message {
    text-align: center;
    padding: 24px 20px;
    color: var(--chat-text-secondary);
    background: var(--chat-bg-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    margin-bottom: 20px;
}

.welcome-message h4 {
    margin-bottom: 10px;
    color: var(--chat-text-primary);
    font-size: 18px;
    font-weight: 600;
}

.welcome-message p {
    font-size: 14px;
    line-height: 1.6;
}

/* Responsivo */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }

    .chat-bubble {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .chat-header {
        padding: 16px;
    }

    .message-content {
        max-width: 85%;
    }
}

/* Toast de notificação */
.chat-toast {
    position: fixed;
    bottom: 110px;
    right: 30px;
    background: var(--chat-bg-card);
    border: 1px solid var(--chat-border);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideInToast 0.3s ease;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-avatar {
    font-size: 20px;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--chat-text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: var(--chat-text-secondary);
}

/* ===== TELA DE BOAS-VINDAS / REGISTRO ===== */
.welcome-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    background: var(--chat-bg-primary);
    height: 100%;
    text-align: center;
}

.welcome-screen.active {
    display: flex;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce-welcome 2s ease infinite;
}

@keyframes bounce-welcome {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--chat-text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--chat-text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.username-input-wrapper {
    width: 100%;
    max-width: 320px;
    margin-bottom: 16px;
}

.username-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--chat-border);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    background: var(--chat-bg-secondary);
    color: var(--chat-text-primary);
    outline: none;
    transition: all 0.3s;
}

.username-input::placeholder {
    color: var(--chat-text-secondary);
}

.username-input:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.enter-chat-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3);
}

.enter-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.5);
}

.enter-chat-btn:active {
    transform: translateY(0);
}

.random-name-btn {
    padding: 12px 20px;
    background: var(--chat-bg-secondary);
    color: var(--chat-text-primary);
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.random-name-btn:hover {
    background: var(--chat-bg-card);
    border-color: var(--chat-accent);
    color: var(--chat-accent);
}

.welcome-info {
    margin-top: 24px;
    font-size: 12px;
    color: var(--chat-text-secondary);
    line-height: 1.6;
}

/* Mensagem do sistema */
.system-message {
    text-align: center;
    padding: 8px 16px;
    margin: 12px 0;
    font-size: 12px;
    color: var(--chat-text-secondary);
    background: var(--chat-bg-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    animation: fadeIn-chat 0.3s ease;
}

/* Chat principal */
.chat-main-screen {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chat-main-screen.active {
    display: flex;
}

