﻿/* ============================================
   Septem AI - Styles
   ============================================ */

.septem-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: #f9fafb;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================================
   Header
   ============================================ */
.septem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.septem-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .septem-logo h1 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 700;
        color: #1f2937;
        background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.septem-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

    .status-indicator.online {
        background: #10b981;
    }

    .status-indicator.offline {
        background: #ef4444;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Chat Container
   ============================================ */
.septem-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f9fafb;
}

/* ============================================
   Welcome Screen
   ============================================ */
.septem-welcome {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
}

.welcome-icon {
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.septem-welcome h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.septem-welcome p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature-card {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

    .feature-card:hover {
        border-color: #4F46E5;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.feature-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

/* ============================================
   Messages
   ============================================ */
.septem-messages {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message-wrapper {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.assistant-avatar {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}

.message-content {
    max-width: 70%;
}

.user-message .message-content {
    margin-left: auto;
}

.message-text {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.user-message .message-text {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-text {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    direction: ltr;
}

.user-message .message-meta {
    justify-content: flex-end;
}

.execution-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-error {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    font-size: 0.8125rem;
}

/* ============================================
   Typing Indicator
   ============================================ */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #9ca3af;
        animation: typing 1.4s infinite;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ============================================
   Input Container
   ============================================ */
.septem-input-container {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.error-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    font-size: 0.875rem;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #dc2626;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

.septem-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.septem-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    transition: all 0.2s ease;
    direction: rtl;
}

    .septem-input:focus {
        outline: none;
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

    .septem-input:disabled {
        background: #f3f4f6;
        cursor: not-allowed;
    }

.send-button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #e5e7eb;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .send-button.active {
        background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
        color: white;
    }

        .send-button.active:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
        }

    .send-button:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Suggestions
   ============================================ */
.septem-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.suggestion-chip {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.8125rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .suggestion-chip:hover {
        background: #e5e7eb;
        border-color: #4F46E5;
        color: #4F46E5;
    }

/* ============================================
   Scrollbar
   ============================================ */
.septem-chat-container::-webkit-scrollbar {
    width: 8px;
}

.septem-chat-container::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.septem-chat-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

    .septem-chat-container::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .septem-header {
        padding: 1rem;
    }

    .septem-chat-container {
        padding: 1rem;
    }

    .message-content {
        max-width: 85%;
    }

    .welcome-features {
        grid-template-columns: 1fr;
    }

    .septem-input-container {
        padding: 1rem;
    }
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] .message-wrapper {
    direction: rtl;
}

[dir="rtl"] .user-message {
    flex-direction: row;
}

    [dir="rtl"] .user-message .message-text {
        border-bottom-right-radius: 18px;
        border-bottom-left-radius: 4px;
    }

[dir="rtl"] .assistant-message .message-text {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}
