#logs-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #1a1a1a;
    border: 2px solid #444;
    color: #00cc66;
    font-size: 20px;
    cursor: pointer;
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#logs-chat-bubble:hover {
    border-color: #666;
    background: #222;
}

.logs-chat-bubble-pulse {
    animation: logs-chat-pulse 1.3s ease-in-out 2;
}

@keyframes logs-chat-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 204, 102, 0.45); }
    50% { box-shadow: 0 0 0 8px rgba(0, 204, 102, 0); }
}

.logs-chat-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 340px;
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10500;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.logs-chat-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.logs-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0f0f0f;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.logs-chat-header > span i { color: #00cc66; margin-right: 6px; }

.logs-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logs-chat-lang-wrap {
    position: relative;
}

.logs-chat-lang-btn,
.logs-chat-reset-btn,
.logs-chat-close {
    position: relative;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.logs-chat-lang-btn:hover,
.logs-chat-reset-btn:hover,
.logs-chat-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.logs-chat-poof {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    border: 2px solid #00cc66;
    pointer-events: none;
    animation: logs-chat-poof-burst 0.45s ease-out forwards;
}

.logs-chat-poof::before,
.logs-chat-poof::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #00cc66;
    animation: logs-chat-poof-burst 0.45s ease-out forwards;
}

.logs-chat-poof::before { animation-delay: 0.08s; }
.logs-chat-poof::after { animation-delay: 0.16s; }

@keyframes logs-chat-poof-burst {
    0% { transform: scale(0.4); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}

.logs-chat-lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 110px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1;
}

.logs-chat-rtl .logs-chat-lang-menu {
    right: auto;
    left: 0;
}

.logs-chat-lang-menu.show { display: block; }

.logs-chat-lang-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 12px;
    padding: 8px 12px;
    cursor: pointer;
}

.logs-chat-rtl .logs-chat-lang-item { text-align: right; }

.logs-chat-lang-item:hover { background: rgba(255, 255, 255, 0.08); }

.logs-chat-lang-item.selected {
    color: #00cc66;
    font-weight: 500;
}

.logs-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #151515;
}

.logs-chat-msg {
    max-width: 85%;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    border-width: 2px;
    border-style: solid;
}

.logs-chat-msg-assistant {
    align-self: flex-start;
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #e0e0e0;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}

.logs-chat-msg-user {
    align-self: flex-end;
    background: rgba(0, 204, 102, 0.15);
    border-color: #00cc66;
    color: #00cc66;
    border-radius: 16px 4px 16px 16px;
    box-shadow: 3px 3px 0 rgba(0, 204, 102, 0.25);
}

.logs-chat-rtl .logs-chat-msg-assistant { border-radius: 16px 4px 16px 16px; }
.logs-chat-rtl .logs-chat-msg-user { border-radius: 4px 16px 16px 16px; }

.logs-chat-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 14px;
}

.logs-chat-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00cc66;
    animation: logs-chat-dot-bounce 1s ease-in-out infinite;
}

.logs-chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.logs-chat-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes logs-chat-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.logs-chat-back {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 12px;
}

.logs-chat-back:hover { color: #999; }

.logs-chat-options {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid #333;
    background: #1a1a1a;
}

.logs-chat-option {
    background: transparent;
    border: 2px solid #444;
    color: #888;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.logs-chat-option:hover { border-color: #666; color: #ccc; }

.logs-chat-option:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.logs-chat-option.selected {
    background: rgba(0, 204, 102, 0.1);
    border-color: #00cc66;
    color: #00cc66;
    box-shadow: 2px 2px 0 rgba(0, 204, 102, 0.25);
}

.logs-chat-continue, .logs-chat-more {
    background: #00cc66;
    border-color: #00cc66;
    color: #000;
    font-weight: 500;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.logs-chat-skip { color: #666; }

.logs-chat-date-input {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 5px;
    color: #e0e0e0;
    padding: 6px 8px;
    font-size: 12px;
}

body.light-mode #logs-chat-bubble {
    background: #ffffff;
    border-color: #c0c0c0;
    color: #00aa55;
}

body.light-mode #logs-chat-bubble:hover {
    border-color: #999;
    background: #f0f0f0;
}

body.light-mode .logs-chat-panel {
    background: #ffffff;
    border-color: #d0d0d0;
}

body.light-mode .logs-chat-header {
    background: #f5f5f5;
    border-bottom-color: #d0d0d0;
    color: #2a2a2a;
}

body.light-mode .logs-chat-header > span i { color: #00aa55; }

body.light-mode .logs-chat-lang-btn,
body.light-mode .logs-chat-reset-btn,
body.light-mode .logs-chat-close { color: #666; }
body.light-mode .logs-chat-lang-btn:hover,
body.light-mode .logs-chat-reset-btn:hover,
body.light-mode .logs-chat-close:hover { background: #e8e8e8; color: #333; }

body.light-mode .logs-chat-poof,
body.light-mode .logs-chat-poof::before,
body.light-mode .logs-chat-poof::after { border-color: #00aa55; }

body.light-mode .logs-chat-lang-menu {
    background: #ffffff;
    border-color: #d0d0d0;
}

body.light-mode .logs-chat-lang-item { color: #444; }
body.light-mode .logs-chat-lang-item:hover { background: #f0f0f0; }
body.light-mode .logs-chat-lang-item.selected { color: #00aa55; }

body.light-mode .logs-chat-messages { background: #fafafa; }

body.light-mode .logs-chat-msg-assistant {
    background: #ffffff;
    border-color: #e8e8e8;
    color: #2a2a2a;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
}

body.light-mode .logs-chat-msg-user {
    background: #e8f5e9;
    border-color: #00aa55;
    color: #00aa55;
    box-shadow: 3px 3px 0 rgba(0, 170, 85, 0.2);
}

body.light-mode .logs-chat-dots span { background: #00aa55; }

body.light-mode .logs-chat-back { color: #999; }
body.light-mode .logs-chat-back:hover { color: #555; }

body.light-mode .logs-chat-options {
    background: #ffffff;
    border-top-color: #d0d0d0;
}

body.light-mode .logs-chat-option {
    border-color: #c0c0c0;
    color: #666;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

body.light-mode .logs-chat-option:hover { border-color: #999; color: #333; }

body.light-mode .logs-chat-option.selected {
    background: #e8f5e9;
    border-color: #00aa55;
    color: #00aa55;
    box-shadow: 2px 2px 0 rgba(0, 170, 85, 0.2);
}

body.light-mode .logs-chat-continue,
body.light-mode .logs-chat-more {
    background: #00aa55;
    border-color: #00aa55;
    color: #fff;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

body.light-mode .logs-chat-skip { color: #999; }

body.light-mode .logs-chat-date-input {
    background: #ffffff;
    border-color: #c0c0c0;
    color: #2a2a2a;
}
