/* Simplified Chat Widget Styling */
.gemini-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #4aa3df;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chat-title {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.chat-title i {
    margin-right: 8px;
    font-size: 16px;
}

.chat-controls button {
    background: transparent;
    border: none;
    color: white;
    margin-left: 5px;
    padding: 2px 5px;
}

.chat-controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f5f5f5;
}

.chat-messages {
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 15px;
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message.system {
    align-self: center;
    max-width: 90%;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.user .message-content {
    background-color: #dcf8c6;
    border-top-right-radius: 4px;
}

.chat-message.assistant .message-content {
    background-color: white;
    border-top-left-radius: 4px;
}

.chat-message.system .message-content {
    background-color: #e8eaf6;
    font-style: italic;
    text-align: center;
}

.message-content p {
    margin: 0;
    word-wrap: break-word;
}

.message-content pre {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    overflow-x: auto;
}

.message-content code {
    font-family: monospace;
}

.message-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    align-self: flex-end;
}

/* Chat Footer */
.chat-footer {
    padding: 10px 15px;
    background-color: white;
    border-top: 1px solid #eee;
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 15px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.chat-input:focus {
    outline: none;
    border-color: #4aa3df;
}

.chat-actions {
    display: flex;
    margin-left: 10px;
}

.chat-actions button {
    margin-left: 5px;
}

.chat-file-preview {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.file-preview-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.file-name {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-context-info {
    margin-top: 5px;
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* Chat Launcher */
.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-circle i {
    font-size: 20px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Loading Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-radius: 18px;
    margin-bottom: 15px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #4aa3df;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
    animation: pulse 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation: pulse 1s infinite 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation: pulse 1s infinite 0.4s;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gemini-chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
}