/* BLOOMYSTROY UI — Minimalist Pastel Sky / Azure Theme with Dark Mode */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --sky-soft: #f4fafe;
    --sky-pastel: #ceeaf6;
    --azure-main: #156bd0;
    --azure-hover: #1059b0;
    --azure-light: rgba(21, 107, 208, 0.08);
    --azure-glow: rgba(21, 107, 208, 0.25);
    
    --body-bg: 
        radial-gradient(circle at 100% 0%, rgba(206, 236, 246, 0.65) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(206, 236, 246, 0.45) 0%, transparent 45%),
        linear-gradient(180deg, #f8fcff 0%, #edf7fc 100%);
        
    --header-bg: rgba(248, 252, 255, 0.88);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-sub: rgba(238, 248, 253, 0.8);
    --dock-bg: rgba(255, 255, 255, 0.92);
    --input-bg: rgba(255, 255, 255, 0.95);
    --border-light: rgba(21, 107, 208, 0.14);
    --border-mid: rgba(21, 107, 208, 0.24);
    --ink: #13273d;
    --muted: #5e768e;
    --faint: #9cb2c6;
    --shadow-soft: 0 12px 36px -4px rgba(21, 107, 208, 0.10);
    --msg-me-bg: linear-gradient(135deg, #2b84eb 0%, #156bd0 100%);
    --msg-me-text: #ffffff;
    --msg-counterpart-bg: #ffffff;
    --msg-counterpart-text: #13273d;
}

/* ТЁМНАЯ ТЕМА — rgb(23, 33, 43) */
body.dark-theme {
    --sky-soft: #17212b;
    --sky-pastel: #1e3144;
    --azure-main: #2f88f2;
    --azure-hover: #489af8;
    --azure-light: rgba(47, 136, 242, 0.15);
    --azure-glow: rgba(47, 136, 242, 0.35);

    --body-bg: 
        radial-gradient(circle at 100% 0%, rgba(33, 114, 212, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(33, 114, 212, 0.12) 0%, transparent 45%),
        rgb(23, 33, 43);
        
    --header-bg: rgba(23, 33, 43, 0.92);
    --glass-bg: rgba(36, 47, 61, 0.85);
    --glass-sub: rgba(26, 36, 48, 0.8);
    --dock-bg: rgba(36, 47, 61, 0.94);
    --input-bg: rgba(23, 33, 43, 0.92);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-mid: rgba(47, 136, 242, 0.32);
    --ink: #f0f5fa;
    --muted: #8b9fb3;
    --faint: #5b6f82;
    --shadow-soft: 0 12px 36px -4px rgba(0, 0, 0, 0.4);
    --msg-me-bg: linear-gradient(135deg, #338cf5 0%, #176ed6 100%);
    --msg-me-text: #ffffff;
    --msg-counterpart-bg: #242f3d;
    --msg-counterpart-text: #f0f5fa;
}

/* ФИКС СКРОЛЛБАРА (Устраняет сдвиг окна при переключении на «Историю») */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    margin: 0;
    background: var(--body-bg);
    color: var(--ink);
    transition: background 0.25s ease, color 0.25s ease;
}

/* ШАПКА */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 20px;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Логотип в шапке (увеличен в 2 раза) */
.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 4px 14px var(--azure-glow));
    transition: transform 0.2s ease;
}

.brand-logo:active {
    transform: scale(0.96);
}

.brand-title {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.1;
}

/* Кнопка смены темы */
.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--azure-light);
    border: 1px solid var(--border-light);
    color: var(--azure-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:active {
    transform: scale(0.92);
}

.app-main {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* СТЕКЛЯННЫЕ КАРТОЧКИ */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.icon-bubble {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--azure-light);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ПОЛЯ ВВОДА */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    background: var(--input-bg);
    border: 1px solid var(--border-mid);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--azure-main);
    box-shadow: 0 0 0 3.5px var(--azure-light);
}

.form-input::placeholder {
    color: var(--faint);
}

.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--azure-light);
    border: 1px dashed var(--border-mid);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--azure-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-btn:hover, .file-upload-btn:active {
    filter: brightness(0.96);
}

/* КНОПКИ */
.btn-primary {
    background: linear-gradient(135deg, #2b84eb 0%, #156bd0 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14px;
    padding: 14px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    box-shadow: 0 6px 20px var(--azure-glow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

.btn-secondary {
    background: var(--azure-light);
    color: var(--azure-main) !important;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:active {
    filter: brightness(0.95);
    transform: scale(0.98);
}

/* ПРОГРЕСС-БАР */
.progress-track {
    width: 100%;
    height: 6px;
    background: var(--azure-light);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8ed3ed, var(--azure-main));
    transition: width 0.15s ease;
}

/* ЧАТ */
.chat-header {
    padding: 12px 16px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-back-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--azure-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.15s ease;
}

.chat-back-btn:active {
    color: var(--azure-main);
}

#chat-messages-container {
    background: 
        radial-gradient(circle at 10% 10%, rgba(206, 236, 246, 0.25) 0%, transparent 40%),
        linear-gradient(180deg, var(--glass-sub), var(--glass-bg));
}

.message-bubble {
    max-width: 82%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 18px;
    word-break: break-word;
}

.msg-me {
    margin-left: auto;
    background: var(--msg-me-bg);
    color: var(--msg-me-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px var(--azure-glow);
}

.msg-counterpart {
    margin-right: auto;
    background: var(--msg-counterpart-bg);
    color: var(--msg-counterpart-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.chat-input-bar {
    padding: 10px 12px;
    background: var(--header-bg);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--azure-light);
    border: 1px solid var(--border-light);
    color: var(--azure-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
    transition: all 0.15s ease;
}

.chat-text-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    color: var(--ink);
}

.chat-text-input:focus {
    outline: none;
    border-color: var(--azure-main);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--azure-main);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--azure-glow);
    transition: transform 0.15s ease;
}

.chat-send-btn:active {
    transform: scale(0.94);
}

/* ВКЛАДКА О СЕРВИСЕ */
.about-logo-wrapper {
    display: flex;
    justify-content: center;
}

.about-logo {
    width: 128px;
    height: 128px;
    object-fit: contain;
    border-radius: 32px;
    filter: drop-shadow(0 8px 24px var(--azure-glow));
}

.info-tile {
    background: var(--azure-light);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 12px 14px;
}

/* ПЛАВАЮЩИЙ ТАБ-БАР (DOCK) */
.dock-nav {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 460px;
    background: var(--dock-bg);
    border: 1px solid var(--border-light);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: 26px;
    padding: 7px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
    transition: background 0.25s ease;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.nav-btn.active {
    color: var(--azure-main);
    background: var(--azure-light);
}

.nav-btn.active i {
    transform: translateY(-1px);
}

/* СЕМАНТИЧЕСКИЕ КЛАССЫ */
.text-ink { color: var(--ink) !important; }
.text-muted { color: var(--muted) !important; }
.text-azure-main { color: var(--azure-main) !important; }
.border-azure-100 { border-color: var(--border-light) !important; }
.bg-azure-50 { background-color: var(--azure-light) !important; }

/* АНИМАЦИЯ */
.tab-content {
    animation: fadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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