@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
    --text-color-dark: #1c1c1e;
    --text-color-light: #d3cccc;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --brand-color: #007aff;
    --secondary-button-color: #6d6d71;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #383838;
    color: var(--text-color-dark);
    overflow: hidden;
}
.header-container {
    position: fixed; top: 30px; left: 50%;
    transform: translateX(-50%); z-index: 50;
    width: 100%; max-width: 950px;
    height: 82px;
    perspective: 1000px;
    transform-style: preserve-3d;
}
.header-flipper {
    width: 100%; height: 100%;
    transition: transform 1s;
    transform-style: preserve-3d;
    position: fixed;
}
.header-container.flipped .header-flipper { transform: rotateX(180deg); }
.header-front, .header-back {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; display: flex;
    align-items: center; justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    box-sizing: border-box;
    position: fixed; overflow: hidden;
}
.header-back { transform: rotateX(180deg); justify-content: space-around; flex-wrap: wrap; }
.company-logo { font-size: 1.1rem; font-weight: 600; color: var(--text-color-dark); margin: 4px; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; text-align: center; }

.header-front::before, .header-back::before {
    position: absolute; top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient( to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100% );
    transform: skewX(-30deg) translateX(-120%);
    filter: blur(5px);
}
.header-title {
    font-size: 2.3rem; font-weight: 800; margin: 0;
    background-image: linear-gradient(135deg, #383838 0%, #383838 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);
}
.chat-area {
    width: 100%; max-width: 900px;
    margin: 0 auto; height: 100vh;
    overflow-y: auto;
    padding: 130px 50px 160px;
    box-sizing: border-box; display: flex; flex-direction: column; gap: 15px;
    -ms-overflow-style: none; scrollbar-width: none;
    transition: padding 0.3s ease;
}
.chat-area::-webkit-scrollbar { display: none; }
.message {
    max-width: 75%;
    padding: 15px 22px;
    border-radius: 20px; line-height: 1.5;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    opacity: 0; transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
.user-message {
    align-self: flex-end;
    background: rgba(0, 122, 255, 0.65);
    color: var(--text-color-light);
    border-bottom-right-radius: 6px;
}
.ai-message {
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}
.emoji-large { font-size: 1.7rem; line-height: 1; }

.highlightable-feature {
    font-weight: 600; color: var(--text-color-dark); cursor: pointer;
    padding: 2px 7px; border-radius: 10px; display: inline-block;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    background: #699c62;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.1);
}
.highlightable-feature:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }

.typing-indicator { display: none; padding: 18px 22px; }
.typing-indicator span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f3f3f3; margin: 0 2px; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
.chat-input-container {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 800px; padding: 10px;
    background: linear-gradient( 160deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100% );
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    transition: box-shadow 0.3s ease, bottom 0.3s ease, width 0.3s ease;
    height: 50px;
}
.chat-input-container:focus-within { box-shadow: 0 0 0 1px var(--brand-color), 0 8px 32px 0 var(--shadow-color); }

.chat-input-form { display: flex; align-items: center; gap: 10px; }
.chat-input { flex-grow: 1; border: none; background: transparent; font-size: 1rem; color: var(--text-color-dark); padding: 10px; }
.chat-input:focus { outline: none; }
.chat-input::placeholder { color: #383838; opacity: 0.8; }
.chat-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
    flex-shrink: 0;
}
.send-button {
    background: var(--brand-color);
    width: 50px;
    height: 50px;
}
.send-button:hover { transform: scale(1.1); }
.send-button svg {
    fill: white;
    width: 25px;
    height: 25px;
}
.new-chat-button {
    background: var(--secondary-button-color);
    width: 32px;
    height: 32px;
}
.new-chat-button:hover { transform: scale(1.1); background-color: #7c7c7c; }
.new-chat-button img {
    width: 18px;
    height: 18px;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Изначально скрыто */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-overlay.show {
    display: flex; /* Показываем */
}
.modal-content {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    padding: 30px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.modal-content p {
    color: var(--text-color-dark);
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0 0 25px 0;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.modal-button {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 120px;
}
.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.cancel-button {
    background-color: #909093;
    color: var(--text-color-dark);
}
.confirm-button {
    background-color: #953331;
    color: var(--text-color-light);
}
@media (max-width: 768px) {
    .header-container { top: 15px; width: calc(100% - 30px); }
    .header-title { font-size: 1.6rem; }
    .company-logo { font-size: 0.8rem; margin: 2px; padding: 3px 6px; }
    .chat-input-container { bottom: 30px; width: calc(100% - 30px); }
    .chat-area { padding: 100px 25px 130px; }
    .message { max-width: 90%; }
    .modal-content {
        width: calc(100% - 60px);
        padding: 25px;
    }
    .site-footer {
        bottom: 5px;
        font-size: 0.7rem;
    }
}
.message p:first-child {
    margin-top: 0;
}
.message p:last-child {
    margin-bottom: 0;
}
.site-footer {
    position: fixed;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color-light);
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}
.site-footer a {
    color: inherit;
    text-decoration: none;
}
.site-footer:hover {
    opacity: 1;
}
.no-wrap {
    white-space: nowrap;
}