/* Estilos do Chatbot */
#wprag-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#wprag-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

#wprag-toggle-btn:hover {
    transform: scale(1.1);
}

#wprag-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#wprag-chat-window.hidden {
    display: none;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#wprag-close-btn {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#wprag-close-btn:hover {
    opacity: 1;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    min-height: 0;
}

.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    animation: fadeIn 0.3s;
    font-size: 18px;
    line-height: 1.4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: white;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bot-message.loading {
    font-style: italic;
    opacity: 0.7;
}

.bot-message.error {
    background: #fee;
    color: #c33;
}

.chat-input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

#chat-input:focus {
    border-color: #667eea;
}

#chat-send-btn {
    margin-left: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s;
}

#chat-send-btn:hover {
    transform: scale(1.1);
}

#chat-send-btn:active {
    transform: scale(0.95);
}

/* Scrollbar personalizada */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Telas de seleção, disclaimer e conversa */
#chat-selection-screen, #chat-disclaimer-screen, #chat-conversation-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#chat-selection-screen.hidden, #chat-disclaimer-screen.hidden, #chat-conversation-screen.hidden {
    display: none;
}

.selection-screen-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.selection-title {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
}

/* Conversation topbar */
.conversation-topbar {
    padding: 10px 14px;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.conversation-topbar #chat-olimpiada-label {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.conversation-topbar #chat-change-topic {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}

/* Disclaimer screen */
.disclaimer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 24px 20px;
    text-align: center;
}

.disclaimer-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.disclaimer-text {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 8px 0;
}

.disclaimer-text strong {
    color: #333;
}

.disclaimer-question {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 12px 0 20px 0;
}

.disclaimer-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.disclaimer-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.disclaimer-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.disclaimer-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.disclaimer-btn-deny {
    background: #f1f1f1;
    color: #666;
}

.disclaimer-btn-deny:hover {
    background: #e0e0e0;
    color: #333;
}

/* Botões de seleção de olimpíada (compactos) */
.olimpiada-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.olimpiada-btn:hover {
    border-color: #667eea;
    background: #f5f3ff;
    color: #4c3d99;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.olimpiada-btn:active {
    transform: translateY(0);
}

/* Avatar do grupo BuddyBoss dentro do botão */
.olimpiada-btn-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid #e0e0e0;
}

.olimpiada-btn:hover .olimpiada-btn-avatar {
    border-color: #667eea;
}

/* Placeholder (inicial) quando não há avatar */
.olimpiada-btn-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Label do nome do grupo */
.olimpiada-btn-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Lista de olimpíadas carregadas dinamicamente */
#wprag-olimpiadas-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 2px;
}

#wprag-olimpiadas-list::-webkit-scrollbar {
    width: 4px;
}

#wprag-olimpiadas-list::-webkit-scrollbar-track {
    background: transparent;
}

#wprag-olimpiadas-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

#wprag-olimpiadas-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}
