/* styles.css - BilimBot.kz Centered Layout */
:root {
    --primary-color: #6366f1;
    --primary-hover: #5558e3;
    --background: #0f0f0f;
    --surface: #1a1a1a;
    --surface-hover: #2a2a2a;
    --border: #2f2f2f;
    --text-primary: #ececec;
    --text-secondary: #8e8e8e;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.logo-icon.large {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
    border-radius: 16px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.clear-chat-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.clear-chat-btn:hover {
    background: var(--surface-hover);
    border-color: #ef4444;
    color: #ef4444;
}

.clear-chat-btn svg {
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Empty State */
.empty-state {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.empty-state-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.suggestion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.suggestion-card:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.suggestion-card svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-secondary);
}

.suggestion-card span {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Messages */
.message-group {
    max-width: 800px;
    margin: 0 auto 2rem;
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.assistant-avatar {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    font-weight: 700;
}

.user-avatar-icon {
    background: var(--surface-hover);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    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.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.input-area {
    border-top: 1px solid var(--border);
    background: var(--background);
    padding: 1.5rem 1rem 1rem;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    max-height: 200px;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .logo-text {
        font-size: 1.1rem;
    }

    .clear-text {
        display: none;
    }

    .clear-chat-btn {
        padding: 0.6rem;
    }

    .chat-messages {
        padding: 1rem 0.5rem;
    }

    .message-group {
        padding: 0 0.5rem;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-title {
        font-size: 2rem;
    }

    .input-area {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .empty-state-title {
        font-size: 1.75rem;
    }

    .empty-state-subtitle {
        font-size: 1rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-group {
    animation: fadeIn 0.3s ease;
}