/* AlphaPulse Chat Component Styles */
/* Shared across all pages */

/* Chat Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #00aa44;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-toggle.active {
    background: #008833;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #00aa44;
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
}

.chat-panel.open {
    right: 0;
}

.chat-header {
    background: #00aa44;
    color: white;
    padding: 10px;
    font-weight: bold;
    font-size: 10pt;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-tabs {
    background: #f6f6ef;
    border-bottom: 1px solid #ddd;
    display: flex;
    font-size: 8pt;
}

.chat-tab {
    flex: 1;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    border-right: 1px solid #ddd;
    transition: background 0.2s;
}

.chat-tab:last-child {
    border-right: none;
}

.chat-tab.active {
    background: #fff;
    font-weight: bold;
}

.chat-tab:hover {
    background: #eee;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 9pt;
    line-height: 1.3;
}

.chat-message {
    margin-bottom: 8px;
}

.chat-timestamp {
    color: #828282;
    font-size: 8pt;
}

.chat-username {
    font-weight: bold;
    color: #00aa44;
}

.chat-text {
    margin-left: 4px;
}

.chat-system {
    color: #828282;
    font-style: italic;
    font-size: 8pt;
    margin-bottom: 8px;
}

.chat-input-area {
    border-top: 1px solid #ddd;
    padding: 8px;
}

.chat-input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 9pt;
    font-family: Verdana, Geneva, sans-serif;
}

.chat-input:focus {
    outline: none;
    border-color: #00aa44;
}

.chat-users {
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 8px;
    font-size: 8pt;
}

.chat-users-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #666;
}

.chat-user {
    color: #828282;
    margin-right: 8px;
}

.chat-user.online {
    color: #00aa44;
}

/* Dynamic theming for chat */
.header.market-up .chat-toggle {
    background: #00aa44;
}

.header.market-down .chat-toggle {
    background: #cc4444;
}

.header.market-flat .chat-toggle {
    background: #666666;
}

.header.market-up ~ * .chat-panel {
    border-left-color: #00aa44;
}

.header.market-down ~ * .chat-panel {
    border-left-color: #cc4444;
}

.header.market-flat ~ * .chat-panel {
    border-left-color: #666666;
}

.header.market-up ~ * .chat-header {
    background: #00aa44;
}

.header.market-down ~ * .chat-header {
    background: #cc4444;
}

.header.market-flat ~ * .chat-header {
    background: #666666;
}

.header.market-up ~ * .chat-username {
    color: #00aa44;
}

.header.market-down ~ * .chat-username {
    color: #cc4444;
}

.header.market-flat ~ * .chat-username {
    color: #666666;
}

.header.market-up ~ * .chat-input:focus {
    border-color: #00aa44;
}

.header.market-down ~ * .chat-input:focus {
    border-color: #cc4444;
}

.header.market-flat ~ * .chat-input:focus {
    border-color: #666666;
}

.header.market-up ~ * .chat-user.online {
    color: #00aa44;
}

.header.market-down ~ * .chat-user.online {
    color: #cc4444;
}

.header.market-flat ~ * .chat-user.online {
    color: #666666;
}