﻿/* ========== CSS VARIABLES ========== */
:root {
    /* Base font size for scaling (increased by ~2px) */
    --base-font-size: 16px;
    --font-scale: 1;
    /* Colors */
    --bg-main: #0d1117;
    --bg-sidebar: #161b22;
    --bg-header: #21262d;
    --bg-card: #30363d;
    --bg-message: #21262d;
    --bg-input: #0d1117;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #656d76;
    --accent-color: #ffd700;
    --accent-hover: #ffed4e;
    --accent-glow: rgba(255, 215, 0, 0.25);
    --border-color: #30363d;
    --border-light: #484f58;
    --success-color: #238636;
    --error-color: #da3633;
    --info-color: #1f6feb;
    --warning-color: #fb8500;
    /* Shadows */
    --shadow-light: rgba(1, 4, 9, 0.15);
    --shadow-medium: rgba(1, 4, 9, 0.3);
    --shadow-heavy: rgba(1, 4, 9, 0.5);
    /* Effects */
    --blur-light: blur(6px);
    --blur-heavy: blur(12px);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    --gradient-card: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-sidebar) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* ========== FONT SIZE CONTROL ========== */
html {
    font-size: calc(var(--base-font-size) * var(--font-scale));
    scroll-behavior: smooth;
}

    html.font-small {
        --font-scale: 0.7;
    }
    /* -30% */
    html.font-normal {
        --font-scale: 1.0;
    }
    /* standard */
    html.font-large {
        --font-scale: 1.3;
    }
    /* +30% */
    html.font-extra-large {
        --font-scale: 1.6;
    }
    /* +60% */
    html.font-xxl {
        --font-scale: 1.9;
    }
/* +90% */

/* Improve base sizes a bit across UI */
body {
    font-size: 1.05rem;
}

.message-bubble {
    font-size: 1rem;
}

.header-title {
    font-size: 1.2rem;
}

.example-prompt span:last-child {
    font-size: 1rem;
}

.conversation-title {
    font-size: 0.95rem;
}

.conversation-preview {
    font-size: 0.9rem;
}

.search-source-link {
    font-size: 0.9rem;
}

.input-footer {
    font-size: 0.8rem;
}

/* ========== GLOBAL STYLES ========== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
}

/* ========== FONT SIZE CONTROLS ========== */
.font-controls {
    position: fixed;
    top: 5rem; /* Zm�na z 1rem na 5rem - pod header */
    right: 1rem;
    z-index: 3000;
    display: flex;
    gap: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 8px 32px var(--shadow-medium);
    backdrop-filter: var(--blur-light);
}

.font-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

    .font-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        transform: scale(1.1);
    }

    .font-btn.active {
        background: var(--accent-color);
        color: #000;
    }

/* Inline font controls in header */
.font-controls-inline {
    display: flex;
    gap: 0.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
    margin-right: 0.5rem;
}

    .font-controls-inline .font-btn {
        width: 2.1rem;
        height: 2.1rem;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        border-radius: 6px;
        cursor: pointer;
        transition: all var(--transition-fast);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        font-weight: 700;
    }

        .font-controls-inline .font-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-primary);
        }

        .font-controls-inline .font-btn.active {
            background: var(--accent-color);
            color: #000;
        }

/* Remove floating font-controls if inline is present */
@media (min-width: 0px) {
    .font-controls {
        display: none !important;
    }
}

/* ========== PASSWORD SCREEN ========== */
.password-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 48px var(--shadow-heavy);
    animation: slideIn 0.4s ease-out;
}

.password-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.password-card h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.password-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.password-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.2em;
    transition: all var(--transition-normal);
    border-radius: 8px;
    width: 100%;
}

    .password-input:focus {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px var(--accent-glow);
        outline: none;
    }

.btn-warning {
    background: var(--gradient-primary);
    border: none;
    color: #000;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

    .btn-warning:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
    }

/* ========== CHAT CONTAINER ========== */
.chat-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-header);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    display: none;
    transition: all var(--transition-fast);
}

    .close-sidebar:hover {
        background: var(--error-color);
        color: white;
    }

.new-chat-btn {
    margin: 1rem;
    background: var(--gradient-primary);
    color: #000;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

    .new-chat-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
    }

    .new-chat-btn .material-symbols-outlined {
        font-size: 20px;
    }

/* ========== CONVERSATIONS LIST - REDESIGNED ========== */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

    .conversations-list::-webkit-scrollbar {
        width: 4px;
    }

    .conversations-list::-webkit-scrollbar-thumb {
        background: rgba(255, 215, 0, 0.3);
        border-radius: 2px;
    }

        .conversations-list::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 215, 0, 0.5);
        }

.no-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

    .no-conversations .material-symbols-outlined {
        font-size: 3.5rem;
        margin-bottom: 1.25rem;
        color: var(--text-secondary);
        opacity: 0.5;
    }

    .no-conversations p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

.conversation-item {
    padding: 0.875rem 1rem;
    margin-bottom: 0.375rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    animation: fadeIn 0.2s ease-out;
    position: relative;
}

    .conversation-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 60%;
        background: var(--accent-color);
        border-radius: 0 4px 4px 0;
        transition: width var(--transition-fast);
    }

    .conversation-item:hover {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 215, 0, 0.2);
    }

        .conversation-item:hover::before {
            width: 3px;
        }

    .conversation-item.active {
        background: rgba(255, 215, 0, 0.08);
        border-color: rgba(255, 215, 0, 0.4);
    }

        .conversation-item.active::before {
            width: 3px;
        }

.conversation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.conversation-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    line-height: 1.3;
}

.conversation-item.active .conversation-title {
    color: var(--accent-color);
    font-weight: 600;
}

.delete-conversation-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .delete-conversation-btn .material-symbols-outlined {
        font-size: 16px;
    }

.conversation-item:hover .delete-conversation-btn {
    opacity: 1;
}

.delete-conversation-btn:hover {
    background: rgba(234, 67, 53, 0.15);
    color: var(--error-color);
}

.conversation-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.conversation-time {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

    .conversation-time::before {
        content: '\1F551'; /* Clock emoji */
        font-size: 0.85rem;
    }

.conversation-messages {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    color: var(--accent-color);
    background: rgba(255, 215, 0, 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

    .conversation-messages .material-symbols-outlined {
        font-size: 14px;
    }

/* ========== SIDEBAR FOOTER ========== */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.home-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

    .home-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--accent-color);
    }

    .home-link .material-symbols-outlined {
        font-size: 20px;
    }

/* ========== MAIN CHAT AREA ========== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.5rem;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

    .menu-btn:hover {
        background: rgba(255, 255, 255, 0.05);
    }

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .action-btn:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }

.user-profile-btn.has-profile::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    border: 1px solid var(--bg-header);
}

/* ========== MESSAGES AREA ========== */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.25);
}

    .welcome-icon .material-symbols-outlined {
        font-size: 32px;
        color: #000;
    }

.welcome h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.welcome p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 500px;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.example-prompt {
    background: var(--gradient-glass);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

    .example-prompt:hover {
        background: rgba(255, 215, 0, 0.05);
        border-color: var(--accent-color);
        transform: translateY(-2px);
    }

    .example-prompt .material-symbols-outlined {
        color: var(--accent-color);
        font-size: 20px;
        flex-shrink: 0;
    }

    .example-prompt span:last-child {
        color: var(--text-primary);
        font-weight: 500;
        font-size: 0.9rem;
    }

/* ========== MESSAGE BUBBLES ========== */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease-out;
    max-width: 100%;
    width: 100%;
}

    .message.user {
        flex-direction: row-reverse;
    }

    .message.assistant {
        flex-direction: row;
    }

.message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    opacity: 0.8;
}

.message.user .message-author {
    text-align: right;
}

.message.assistant .message-author {
    text-align: left;
}

.message-bubble {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow-light);
    max-width: calc(100% - 60px);
    width: fit-content;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 140, 0, 0.12) 100%);
    border: 1px solid rgba(255, 215, 0, 0.35);
}

.message-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-wrap: anywhere;
}

    .message-content p {
        margin: 0 0 12px 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

        .message-content p:last-child {
            margin-bottom: 0;
        }

    .message-content ul,
    .message-content ol {
        margin: 8px 0;
        padding-left: 24px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .message-content li {
        margin: 4px 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .message-content code {
        background: rgba(255, 255, 255, 0.05);
        padding: 2px 6px;
        border-radius: 4px;
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .message-content a {
        color: var(--accent-color);
        text-decoration: none;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-all;
    }

        .message-content a:hover {
            text-decoration: underline;
        }

    /* Message content pre tags - responsive with wrapping */
    .message-content pre:not(.copy-user-content) {
        background: rgba(13, 17, 23, 0.6);
        padding: 16px;
        border-radius: 8px;
        overflow-x: auto;
        margin: 8px 0;
        max-width: 100%;
        border: 1px solid var(--border-color);
        font-size: 14px;
        line-height: 1.5;
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

        .message-content pre:not(.copy-user-content) code {
            background: none;
            padding: 0;
            border: none;
            color: #e6edf3;
            white-space: pre-wrap;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

/* ========== TYPING INDICATOR ========== */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    align-self: flex-start;
    animation: fadeIn 0.2s ease-out;
}

.typing-bubble {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.typing-dots {
    display: flex;
    gap: 0.2rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: typingDot 1.4s ease-in-out infinite;
}

    .typing-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .typing-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0s;
    }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
}

/* ========== GOOGLE SEARCH BADGE ========== */
.google-search-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(66, 133, 244, 0.1);
    border: 1px solid rgba(66, 133, 244, 0.3);
    color: #4285f4;
    padding: 0.4rem 0.6rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

    .google-search-badge .material-symbols-outlined {
        font-size: 14px;
    }

.search-sources {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.search-source {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all var(--transition-fast);
}

    .search-source:hover {
        background: rgba(255, 255, 255, 0.05);
    }

.search-source-icon {
    width: 12px;
    height: 12px;
    background: var(--info-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.search-source-link {
    color: var(--info-color);
    text-decoration: none;
    font-size: 0.8rem;
}

    .search-source-link:hover {
        text-decoration: underline;
    }

/* ========== INPUT AREA ========== */
.input-area {
    padding: 1rem 1.5rem;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

    .input-area.drag-over {
        background: rgba(255, 215, 0, 0.08);
        border-top-color: var(--accent-color);
        box-shadow: inset 0 2px 0 var(--accent-color);
    }

.file-upload-area {
    background: rgba(255, 215, 0, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    transition: all var(--transition-normal);
}

    .file-upload-area.drag-over {
        background: rgba(255, 215, 0, 0.15);
        border-color: var(--accent-color);
        border-style: solid;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.file-upload-actions {
    display: flex;
    gap: 0.75rem;
}

.cancel-upload-btn, .upload-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.85rem;
}

.cancel-upload-btn {
    background: rgba(218, 54, 51, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

    .cancel-upload-btn:hover {
        background: rgba(218, 54, 51, 0.2);
    }

.upload-btn {
    background: var(--gradient-primary);
    color: #000;
}

    .upload-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
    }

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all var(--transition-normal);
    max-width: 1000px;
    margin: 0 auto;
}

    .input-wrapper:focus-within {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

.attach-btn, .dictation-btn, .send-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .attach-btn:hover,
    .dictation-btn:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }

.dictation-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .dictation-btn.recording {
        background: var(--error-color);
        color: white;
        animation: pulse 1.5s ease-in-out infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.send-btn {
    background: var(--gradient-primary);
    color: #000;
}

    .send-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }

    .send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 120px;
    font-family: inherit;
    padding: 0.25rem 0;
}

    #messageInput::placeholder {
        color: var(--text-muted);
    }

.input-footer {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* ========== SCROLLBAR ========== */
.messages-area::-webkit-scrollbar,
.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track,
.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb,
.conversations-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

    .messages-area::-webkit-scrollbar-thumb:hover,
    .conversations-list::-webkit-scrollbar-thumb:hover {
        background: var(--border-light);
    }

/* ========== PERSONALIZATION & PROFILE FORMS ========== */
.personalization-screen, .user-profile-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: var(--blur-light);
}

.personalization-card, .user-profile-card {
    background: var(--gradient-card);
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 48px var(--shadow-heavy);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.personalization-header, .user-profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.personalization-icon, .user-profile-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: .center;
    justify-content: center;
    margin: 0 auto 1rem;
    align-items: center;
}

    .personalization-icon .material-symbols-outlined,
    .user-profile-icon .material-symbols-outlined {
        font-size: 28px;
        color: #000;
    }

.personalization-card h2, .user-profile-card h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.3rem;
}

.personalization-description, .section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.personalization-form, .user-profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group, .profile-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .form-label .required {
        color: var(--accent-color);
        font-size: 0.9rem;
    }

    .form-label .material-symbols-outlined {
        font-size: 16px;
        color: var(--accent-color);
    }

.form-input, .form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    font-family: inherit;
}

    .form-input:focus, .form-textarea:focus {
        border-color: var(--accent-color);
        outline: none;
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

    .form-input::placeholder, .form-textarea::placeholder {
        color: var(--text-muted);
    }

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #000;
    width: 100%;
}

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
    }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

        .sidebar.open {
            left: 0;
        }

    .main-chat {
        width: 100%;
        max-width: 100%;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .menu-btn {
        display: flex;
    }

    .messages-area {
        padding: 16px;
    }

    .message {
        max-width: 100%;
    }

    .message-bubble {
        max-width: calc(100% - 52px);
    }

    .message-content {
        font-size: 14px;
    }

        .message-content pre:not(.copy-user-content),
        .copy-user-content {
            font-size: 12px;
            padding: 12px;
        }

    .chat-input-area {
        padding: 12px 16px;
    }

    .input-wrapper {
        padding: 12px;
    }

    .message-input {
        font-size: 15px;
    }

    .font-controls {
        right: 12px;
        bottom: 12px;
        gap: 6px;
    }

    .font-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .welcome h1 {
        font-size: 28px;
    }

    .example-prompts {
        grid-template-columns: 1fr;
    }
}

/* Copy button for user content */
.copy-user-content {
    position: relative;
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #e6edf3;
    white-space: pre-wrap;
}

    .copy-user-content .copy-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 6px 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        color: var(--text-primary);
        transition: all 0.2s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        font-family: 'Poppins', sans-serif;
        white-space: nowrap;
    }

        .copy-user-content .copy-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: var(--accent-color);
            box-shadow: 0 4px 8px rgba(0,0,0,0.4);
        }

        .copy-user-content .copy-btn.copied {
            background: var(--success-color);
            color: white;
            border-color: var(--success-color);
        }

        .copy-user-content .copy-btn .material-symbols-outlined {
            font-size: 18px;
        }

/* ========== IMAGE STYLES ========== */
.attached-image {
    max-width: 50%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 32px;
    display: block;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.preview-image {
    vertical-align: middle;
    max-width: 10%;
    height: auto;
    border-radius: 4px;
    display: inline-block;
}

.message-image {
    margin-bottom: 12px;
}

.file-preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.file-document-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    border: 1px dashed var(--accent-color);
    margin-bottom: 0.5rem;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.file-info {
    text-align: center;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-type {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 500;
}
