:root {
    --primary-color: #f24721;
    --primary-dark: #d63916;
    --accent-color: #f24721;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #bdc3c7;
    --text-white: #ffffff;
    --background-primary: #fffcf2;
    --background-secondary: #f8f5e4;
    --background-chat: #fffcf2;
    --border-light: #e8e3d3;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --chat-bubble-bg: #ffffff;
    --typing-bubble-bg: #ffffff;
    --option-btn-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-chat);
    min-height: 100vh;
    color: var(--text-primary);
}

.chat-header {
    background: var(--background-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.manager-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(242, 71, 33, 0.3);
    background-image: url('../Im/ava2.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.chat-header-info {
    flex: 1;
    text-align: left;
}

.manager-info {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.manager-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.manager-title {
    font-size: 14px;
    color: var(--text-secondary);
}

.company-logo {
    height: 40px;
    width: auto;
    margin-left: auto;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    animation: pulse 2s infinite;
}

.chat-messages {
    padding: 30px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 200px);
}

.message {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateY(30px);
    animation: messageSlideIn 0.6s ease forwards;
}

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 4px;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    background-image: url('../Im/ava2.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.message.user .message-avatar {
    background: var(--text-secondary);
    color: var(--text-white);
    font-size: 14px;
}

.message-bubble {
    max-width: 65%;
    position: relative;
}

.message-content {
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: 0 2px 12px var(--shadow-light);
    position: relative;
}

.message.bot .message-content {
    background: var(--chat-bubble-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 8px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    border-bottom-right-radius: 8px;
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

.message-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.option-btn {
    background: var(--option-btn-bg);
    border: 2px solid var(--border-light);
    color: var(--text-primary);
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
    flex: 0 1 auto;
    white-space: nowrap;
}

.option-btn:hover {
    background: rgba(242, 71, 33, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.option-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 71, 33, 0.3);
}

.option-btn.selected .fab {
    color: var(--text-white) !important;
}

.option-btn:active {
    transform: translateY(0);
}

/* Стили для мессенджеров */
.option-btn[data-messenger="whatsapp"] {
    position: relative;
}

.option-btn[data-messenger="whatsapp"]:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.05);
    transform: translateY(-2px);
}

.option-btn[data-messenger="whatsapp"]:hover .fa-whatsapp {
    color: #25D366 !important;
    transform: scale(1.1);
}

.option-btn[data-messenger="whatsapp"].selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.option-btn[data-messenger="whatsapp"].selected .fa-whatsapp {
    color: var(--text-white) !important;
}

.option-btn[data-messenger="telegram"] {
    position: relative;
}

.option-btn[data-messenger="telegram"]:hover {
    border-color: #0088cc;
    background: rgba(0, 136, 204, 0.05);
    transform: translateY(-2px);
}

.option-btn[data-messenger="telegram"]:hover .fa-telegram {
    color: #0088cc !important;
    transform: scale(1.1);
}

.option-btn[data-messenger="telegram"].selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.option-btn[data-messenger="telegram"].selected .fa-telegram {
    color: var(--text-white) !important;
}

.fab {
    transition: all 0.3s ease;
}

.typing-indicator {
    display: none;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    opacity: 0;
    animation: messageSlideIn 0.4s ease forwards;
}

.typing-indicator.show {
    display: flex;
}

.typing-bubble {
    background: var(--typing-bubble-bg);
    padding: 16px 20px;
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 12px var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-right: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typingBounce 1.4s infinite ease-in-out;
}

.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; }

.input-container {
    background: var(--background-primary);
    border-top: 1px solid var(--border-light);
    padding: 20px;
    display: none;
    box-shadow: 0 -2px 8px var(--shadow-light);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.input-field {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--border-light);
    border-radius: 24px;
    background: var(--background-secondary);
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    min-height: 52px;
    transition: all 0.3s ease;
    font-family: inherit;
    overflow-y: hidden;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background-primary);
    box-shadow: 0 0 0 3px rgba(242, 71, 33, 0.1);
}

.send-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(242, 71, 33, 0.3);
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(242, 71, 33, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.privacy-notice {
    background: var(--background-primary);
    border-top: 1px solid var(--border-light);
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 40px;
}

.privacy-notice a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

@keyframes messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .chat-messages {
        padding: 20px 16px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .message-options {
        flex-direction: column;
        align-items: stretch;
    }

    .option-btn {
        white-space: normal;
        text-align: center;
        min-height: 44px;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .company-logo {
        height: 32px;
    }
}

@media (max-width: 480px) {
    .message-content {
        padding: 14px 16px;
        font-size: 15px;
    }

    .option-btn {
        padding: 14px 18px;
        font-size: 15px;
    }
} 