/**
 * grok-assistant.css
 * Styling für XAI Grok Integration
 */

/* ===== GROK CONTAINER ===== */
.grok-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100%;
}

/* ===== API KEY SECTION ===== */
.grok-api-key-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.grok-key-input-group {
    display: flex;
    gap: 8px;
}

.grok-key-input-group input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e7ecf3;
    font-family: 'Courier New', monospace;
}

/* ===== CHAT CONTAINER ===== */
.grok-chat-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grok-chat-history {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grok-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    font-size: 1.1em;
}

/* ===== MESSAGES ===== */
.grok-message {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.grok-message.grok-user {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    margin-left: 20%;
}

.grok-message.grok-assistant {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    margin-right: 20%;
}

.grok-message.grok-error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
}

.grok-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.grok-role {
    font-weight: 600;
    font-size: 0.9em;
}

.grok-timestamp {
    font-size: 0.75em;
}

.grok-message-content {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== INPUT SECTION ===== */
.grok-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grok-input-section textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e7ecf3;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.grok-input-section textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

.grok-input-section button {
    align-self: flex-end;
}

/* ===== INFO ===== */
.grok-info {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    line-height: 1.6;
}

.grok-info strong {
    color: #4caf50;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .grok-container {
        min-width: 280px;
    }

    .grok-key-input-group {
        flex-direction: column;
    }

    .grok-key-input-group button {
        width: 100%;
    }

    .grok-message.grok-user {
        margin-left: 5%;
    }

    .grok-message.grok-assistant {
        margin-right: 5%;
    }

    .grok-chat-history {
        max-height: 300px;
    }
}

/* ===== SCROLLBAR ===== */
.grok-chat-history::-webkit-scrollbar {
    width: 8px;
}

.grok-chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.grok-chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.grok-chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
