* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000;
    color: #e2e8f0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}
/* Generator Section */
.generator-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    background: #000;
}

.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1a1a1a;
}

.generator-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    color: #fff;
}

.back-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #4f46e5;
    color: #4f46e5;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #4f46e5;
    color: #fff;
}

.generator-input {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto 40px;
    width: 100%;
}

.generator-input input {
    flex: 1;
    padding: 14px 20px;
    background: #0a0a0a;
    border: 2px solid #1a1a1a;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
}

.generator-input input:focus {
    outline: none;
    border-color: #4f46e5;
}

.generator-input button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}

.image-result {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.image-result img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #1a1a1a;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.sidebar-header {
    margin-bottom: 16px;
}
/* Кнопка + New Chat (Теперь как Clear History) */
.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;       /* Прозрачный фон */
    border: 1px solid #4f46e5;     /* Фиолетовая рамка */
    border-radius: 8px;
    color: #fff;                   /* Белый текст */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;       /* Центрируем текст */
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Cinzel', serif;
}

.new-chat-btn:hover {
    background: rgba(79, 70, 229, 0.1); /* Легкая подсветка при наведении */
    border-color: #fff;                 /* Рамка становится белой */
    transform: translateY(-1px);
}

/* Кнопка Clear Chat History (для одинакового стиля) */
.clear-history {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #333;        /* Более темная рамка снизу */
    border-radius: 8px;
    color: #999;                   /* Серый текст */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cinzel', serif;
}

.clear-history:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #ef4444;         /* Красная рамка при наведении (акцент на удаление) */
    color: #ef4444;                /* Красный текст */
}



.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

.search-box svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
}

.history-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    padding-left: 8px;
}

.chat-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 4px;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background: #0a0a0a;
}

.chat-item.active {
    background: #1a1a1a;
}

.menu-dots {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size:16px;
}

.sidebar-footer {
    border-top: 1px solid #1a1a1a;
    padding-top: 16px;
}

.upgrade-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.upgrade-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #e2e8f0;
}

.upgrade-text p {
    font-size: 11px;
    color: #666;
}

/* Красивая кнопка Clear History */
.clear-history {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid #4f46e5; /* Фиолетовая рамка */
    border-radius: 8px;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cinzel', serif;
}

.clear-history:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000000;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-icon {
    font-size: 28px;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
}


/* Логотип в шапке */
.logo-img {
    height: 90px;
    width: 65px;
    margin-right: 15px;

}; /* Просто инвертируем цвета: чёрное становится белым */


/* Аватарка ИИ (совы) */
.message.assistant .message-avatar {
    background: transparent;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Картинка аватарки ИИ */
.message.assistant .message-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Чтобы сова влезала целиком */
    border-radius: 50%;
}

/* Убираем все лишние иконки и эмодзи с аватарки ИИ */
.message.assistant .message-avatar::before,
.message.assistant .message-avatar::after {
    content: none;
}

/* Скрываем любые другие элементы внутри аватарки ИИ */
.message.assistant .message-avatar > *:not(.message-avatar-img) {
    display: none;
}




/* Header Buttons - Plain White Text Style */
.header-right {
    display: flex;
    gap: 20px; /* Расстояние между кнопками */
    align-items: center;
    margin-left: auto;
}



/* Модальное окно авторизации */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background: #0a0a0a;
    border: 2px solid #333;
    margin: 10% auto;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.auth-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #999;
    margin-bottom: 8px;
    font-size: 13px;
    font-family: 'Cinzel', serif;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
}

.form-group input::placeholder {
    color: #999;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Cinzel', serif;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 70, 229, 0.4);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 13px;
}

.auth-switch a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.auth-switch a:hover {
    text-decoration: underline;
}


.auth-btn {
    background: transparent; /* Убираем фон */
    border: none;            /* Убираем рамку */
    color: #ffffff;          /* Белый цвет текста */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    transition: opacity 0.2s;
    font-family: 'Inter', sans-serif; /* Тот же шрифт, что и везде */
}

/* Эффект при наведении - просто небольшая прозрачность */
.auth-btn:hover {
    opacity: 0.7;
    background: transparent; /* Гарантируем, что фон не появится */
}

/* Кнопка выхода - тоже белая, но при наведении можно сделать красной для акцента */
.auth-btn.logout {
    background: transparent;
    border: none;
    color: #ffffff;
}

.auth-btn.logout:hover {
    color: #ef4444; /* Красный текст при наведении */
    background: transparent;
    opacity: 1;
}



.nav-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #0a0a0a;
    color: #999;
}

.nav-btn.active {
    background: #1a1a1a;
    color: #fff;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #000000;
}

.welcome-content {
    text-align: center;
    max-width: 800px;
}

.welcome-title {
    font-family: 'Cinzel', serif;  /* Литературный шрифт */
    font-size: 48px;               /* Очень крупный размер */
    font-weight: 900;              /* Максимальная жирность */
    text-transform: uppercase;     /* Все буквы заглавные */
    letter-spacing: 4px;           
    margin-bottom: 20px;
    
    /* Градиент для эффекта золота/камня на темном фоне */
    background: linear-gradient(180deg, #ffffff 20%, #999999 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    
    text-align: center;
    line-height: 1.1;
}

.welcome-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.welcome-description strong {
    color: #999;
}



.subtitle {
    margin-top: 16px;
    font-style: italic;
    color: #444;
    font-size: 14px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: none;
}

.chat-messages.active {
    display: block;
}

.message {
    margin-bottom:24px;
    display: flex;
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #333;
}

.message.assistant .message-avatar {
    background: #444;
}

.message-content {
    flex: 1;
    max-width: 800px;
}

.message-text {
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

.message-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

/* Input Area */
.input-container {
    padding: 30px 24px;
    background: #000000;
    border-top: 1px solid #1a1a1a;
}

.model-selector {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.model-selector select {
    padding: 8px 16px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
}

.input-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0a0a0a;
    border: 2px solid #1a1a1a;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    transition: border-color 0.2s;
}

.input-box:focus-within {
    border-color: #333;
}

.input-box input {
    flex: 1;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 15px;
    outline: none;
}

.input-box input::placeholder {
    color: #555;
}

.attach-btn, .voice-btn, .send-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.attach-btn:hover, .voice-btn:hover {
    color: #e2e8f0;
}

.send-btn {
    background: #333;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #444;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.action-btn {
    padding: 10px 16px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #1a1a1a;
    color: #999;
    border-color: #333;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

/* Generator Section */
.generator-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    background: #000;
}

.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1a1a1a;
}

.generator-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    color: #fff;
}

.back-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #4f46e5;
    color: #4f46e5;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #4f46e5;
    color: #fff;
}

.generator-input {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto 40px;
    width: 100%;
}

.generator-input input {
    flex: 1;
    padding: 14px 20px;
    background: #0a0a0a;
    border: 2px solid #1a1a1a;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
}

.generator-input input:focus {
    outline: none;
    border-color: #4f46e5;
}

.generator-input button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}

