/**
 * GOLAUX AI OS - Frontend Styles
 * Modern, responsive chat interface
 */

:root {
    --golaux-primary: #6366f1;
    --golaux-primary-hover: #4f46e5;
    --golaux-success: #10b981;
    --golaux-danger: #ef4444;
    --golaux-warning: #f59e0b;
    
    /* Light theme */
    --golaux-bg: #ffffff;
    --golaux-bg-secondary: #f9fafb;
    --golaux-bg-tertiary: #f3f4f6;
    --golaux-border: #e5e7eb;
    --golaux-text: #111827;
    --golaux-text-secondary: #6b7280;
    
    --golaux-sidebar-width: 280px;
    --golaux-radius: 12px;
    --golaux-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --golaux-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.golaux-theme-dark {
    --golaux-bg: #1f2937;
    --golaux-bg-secondary: #111827;
    --golaux-bg-tertiary: #374151;
    --golaux-border: #374151;
    --golaux-text: #f9fafb;
    --golaux-text-secondary: #9ca3af;
}

/* Main Wrapper */
.golaux-ai-chat-wrapper {
    display: flex;
    height: 800px;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--golaux-bg);
    border: 1px solid var(--golaux-border);
    border-radius: var(--golaux-radius);
    overflow: hidden;
    box-shadow: var(--golaux-shadow-lg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--golaux-text);
}

/* Sidebar */
.golaux-sidebar {
    width: var(--golaux-sidebar-width);
    background: var(--golaux-bg-secondary);
    border-right: 1px solid var(--golaux-border);
    display: flex;
    flex-direction: column;
}

.golaux-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--golaux-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.golaux-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.golaux-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.golaux-conversation-item {
    padding: 12px;
    margin-bottom: 6px;
    background: var(--golaux-bg);
    border: 1px solid var(--golaux-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.golaux-conversation-item:hover {
    background: var(--golaux-bg-tertiary);
    transform: translateX(2px);
}

.golaux-conversation-item.active {
    background: var(--golaux-primary);
    color: white;
    border-color: var(--golaux-primary);
}

.golaux-conv-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.golaux-conv-info {
    flex: 1;
    min-width: 0;
}

.golaux-conv-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.golaux-conv-meta {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.golaux-sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--golaux-border);
    display: flex;
    gap: 8px;
}

/* Main Chat */
.golaux-main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--golaux-bg);
}

.golaux-chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--golaux-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--golaux-bg-secondary);
}

.golaux-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.golaux-chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.golaux-chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#golauxMultiModelSelect {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--golaux-bg-secondary);
    border: 1px solid var(--golaux-border);
    border-radius: 6px;
}

#golauxMultiModelSelect label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

#golauxMultiModelSelect input[type="checkbox"] {
    cursor: pointer;
}

/* Messages */
.golaux-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--golaux-bg);
}

.golaux-welcome {
    text-align: center;
    padding: 60px 20px;
    color: var(--golaux-text-secondary);
}

.golaux-welcome h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.golaux-message {
    margin-bottom: 20px;
    max-width: 80%;
    animation: golauxFadeIn 0.3s ease-in;
}

@keyframes golauxFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.golaux-message-user {
    margin-left: auto;
}

.golaux-message-ai {
    margin-right: auto;
}

.golaux-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--golaux-text-secondary);
}

.golaux-message-icon {
    font-size: 18px;
}

.golaux-message-role {
    font-weight: 600;
}

.golaux-message-tokens,
.golaux-message-cost {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--golaux-bg-tertiary);
    border-radius: 4px;
}

.golaux-message-content {
    background: var(--golaux-bg-secondary);
    padding: 15px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
}

.golaux-message-user .golaux-message-content {
    background: var(--golaux-primary);
    color: white;
}

.golaux-message-content code {
    background: var(--golaux-bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.golaux-message-content pre {
    background: var(--golaux-bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
}

.golaux-message-content pre code {
    background: none;
    padding: 0;
}

.golaux-message-files {
    margin-bottom: 10px;
}

.golaux-message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 5px 0;
}

.golaux-file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--golaux-bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
    margin: 4px;
}

.golaux-message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--golaux-text-secondary);
}

/* Input Area */
.golaux-input-area {
    padding: 20px;
    border-top: 1px solid var(--golaux-border);
    background: var(--golaux-bg-secondary);
}

.golaux-attachments {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.golaux-attachment-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--golaux-border);
}

.golaux-attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.golaux-remove-attachment {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--golaux-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.golaux-usage-indicator {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--golaux-text-secondary);
    margin-bottom: 10px;
}

.golaux-input-controls {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.golaux-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--golaux-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: var(--golaux-bg);
    color: var(--golaux-text);
}

.golaux-input:focus {
    outline: none;
    border-color: var(--golaux-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.golaux-input-hint {
    font-size: 11px;
    color: var(--golaux-text-secondary);
    margin-top: 8px;
}

/* Buttons */
.golaux-btn {
    padding: 8px 16px;
    border: 1px solid var(--golaux-border);
    border-radius: 6px;
    background: var(--golaux-bg);
    color: var(--golaux-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.golaux-btn:hover {
    background: var(--golaux-bg-tertiary);
}

.golaux-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.golaux-btn-primary {
    background: var(--golaux-primary);
    color: white;
    border-color: var(--golaux-primary);
}

.golaux-btn-primary:hover {
    background: var(--golaux-primary-hover);
}

.golaux-btn-danger {
    background: var(--golaux-danger);
    color: white;
    border-color: var(--golaux-danger);
}

.golaux-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.golaux-btn-icon {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.golaux-btn-icon:hover {
    background: var(--golaux-bg-tertiary);
}

.golaux-send-btn {
    padding: 12px 24px;
    font-size: 15px;
    white-space: nowrap;
}

/* Select */
.golaux-select {
    padding: 8px 12px;
    border: 1px solid var(--golaux-border);
    border-radius: 6px;
    background: var(--golaux-bg);
    color: var(--golaux-text);
    font-size: 14px;
    cursor: pointer;
}

/* Modals */
.golaux-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.golaux-modal-content {
    background: var(--golaux-bg);
    border-radius: var(--golaux-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--golaux-shadow-lg);
}

.golaux-modal-large {
    max-width: 900px;
}

.golaux-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--golaux-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.golaux-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.golaux-btn-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--golaux-text-secondary);
}

.golaux-modal-body {
    padding: 20px;
}

/* Settings */
.golaux-settings-section {
    margin-bottom: 30px;
}

.golaux-settings-section h3 {
    margin: 0 0 15px;
    font-size: 16px;
}

.golaux-form-group {
    margin-bottom: 20px;
}

.golaux-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

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

.golaux-input-group .golaux-input {
    min-height: auto;
}

.golaux-hint {
    font-size: 13px;
    color: var(--golaux-text-secondary);
    margin-bottom: 15px;
}

.golaux-status {
    margin-top: 8px;
    font-size: 13px;
}

.golaux-success {
    color: var(--golaux-success);
}

.golaux-error {
    color: var(--golaux-danger);
}

/* Stats */
.golaux-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.golaux-stat-card {
    padding: 20px;
    background: var(--golaux-bg-secondary);
    border: 1px solid var(--golaux-border);
    border-radius: 8px;
    text-align: center;
}

.golaux-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--golaux-primary);
    margin-bottom: 8px;
}

.golaux-stat-label {
    font-size: 13px;
    color: var(--golaux-text-secondary);
}

/* Loading & Empty States */
.golaux-loading,
.golaux-empty {
    padding: 20px;
    text-align: center;
    color: var(--golaux-text-secondary);
}

.golaux-loading-small {
    font-size: 12px;
    color: var(--golaux-text-secondary);
}

/* Notice */
.golaux-notice,
.golaux-setup-notice {
    padding: 20px;
    background: var(--golaux-bg-secondary);
    border: 1px solid var(--golaux-border);
    border-radius: 8px;
    text-align: center;
    margin: 20px;
}

.golaux-setup-notice h3 {
    margin: 0 0 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .golaux-ai-chat-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 600px;
    }
    
    .golaux-sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .golaux-message {
        max-width: 90%;
    }
    
    .golaux-chat-controls {
        flex-wrap: wrap;
    }
}

/* Scrollbar Styling */
.golaux-conversations-list::-webkit-scrollbar,
.golaux-messages::-webkit-scrollbar {
    width: 8px;
}

.golaux-conversations-list::-webkit-scrollbar-track,
.golaux-messages::-webkit-scrollbar-track {
    background: transparent;
}

.golaux-conversations-list::-webkit-scrollbar-thumb,
.golaux-messages::-webkit-scrollbar-thumb {
    background: var(--golaux-border);
    border-radius: 4px;
}

.golaux-conversations-list::-webkit-scrollbar-thumb:hover,
.golaux-messages::-webkit-scrollbar-thumb:hover {
    background: var(--golaux-text-secondary);
}
