/* ============================================================
   chat.css — Help/tutorial dialog, chat dialog, alliance chat
   ============================================================ */

/* AJUDA */
.help-title {
    color: #f0c040;
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.help-section {
    margin-bottom: 18px;
}

.help-section-title {
    color: #f0c040;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-text {
    color: #bbb;
    font-size: 12px;
    line-height: 1.6;
}

.help-text strong {
    color: #e0e0e0;
}

.help-divider {
    border: none;
    border-top: 1px solid rgba(240, 192, 64, 0.15);
    margin: 15px 0;
}

/* TUTORIAL - INDICE */
.help-index {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}
.help-index-btn {
    background: rgba(240,192,64,0.1);
    border: 1px solid rgba(240,192,64,0.3);
    color: #f0c040;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.help-index-btn:hover, .help-index-btn.active {
    background: rgba(240,192,64,0.25);
    border-color: #f0c040;
}

/* TUTORIAL - ACCORDION */
.help-category {
    margin-bottom: 8px;
    border: 1px solid rgba(240,192,64,0.15);
    border-radius: 8px;
    overflow: hidden;
}
.help-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(240,192,64,0.07);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.help-category-header:hover {
    background: rgba(240,192,64,0.14);
}
.help-category-header-title {
    color: #f0c040;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-category-arrow {
    color: #f0c040;
    font-size: 11px;
    transition: transform 0.25s;
}
.help-category-arrow.open {
    transform: rotate(180deg);
}
.help-category-body {
    display: none;
    padding: 0 14px 10px;
}
.help-category-body.open {
    display: block;
}

/* TUTORIAL - LINK INTERNO */
.help-link {
    color: #f0c040;
    text-decoration: underline;
    text-decoration-color: rgba(240,192,64,0.5);
    cursor: pointer;
    font-weight: bold;
    transition: color 0.15s;
}
.help-link:hover {
    color: #ffe080;
    text-decoration-color: #ffe080;
}

/* TUTORIAL - DESTAQUE ao navegar para secao */
.help-section.highlight {
    animation: helpHighlight 1.2s ease;
}
@keyframes helpHighlight {
    0%   { background: rgba(240,192,64,0.18); border-radius: 6px; }
    100% { background: transparent; }
}

/* CHAT */
#chat-dialog-overlay {
    background: transparent;
}

#chat-dialog {
    margin: 0;
    min-width: 100px;
    width: 380px;
    max-width: 95vw;
    height: 500px;
}


.chat-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    margin-top: 5px;
}

.chat-tab {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-align: center;
}

.chat-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-tab.active {
    background: rgba(240, 192, 64, 0.15);
    color: #f0c040;
    border-color: rgba(240, 192, 64, 0.4);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px 12px;
    max-width: 85%;
    align-self: flex-start;
}

.chat-msg-me {
    align-self: flex-end;
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.15);
}

.chat-msg-admin {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.chat-msg-private {
    background: rgba(21, 101, 192, 0.15);
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.chat-msg-private .chat-msg-text {
    color: #e3f2fd;
}

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.chat-msg-name {
    font-size: 11px;
    font-weight: bold;
}

.chat-msg-time {
    font-size: 9px;
    color: #555;
}

.chat-msg-text {
    color: #ddd;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 20px;
    position: relative;
}

.chat-input-area .auth-input {
    flex: 1;
    margin: 0;
}

.chat-send-btn {
    background: linear-gradient(135deg, #c09030, #f0c040);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    opacity: 0.85;
}

/* Chat de alianca */
#alliance-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Mobile: Chat dialog */
@media (max-width: 768px) {
    #chat-dialog {
        margin: 10px;
        width: calc(100% - 20px);
        height: 70vh;
    }
}
