/**
 * Стилі для веб-чату
 * Структуровано за компонентами
 */

/* ===== ЗАГАЛЬНІ СТИЛІ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff;
    overflow-x: hidden;
}

/* ===== КНОПКА ЗАПУСКУ ЧАТУ ===== */
.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.6);
}

.chat-launcher-icon {
    color: white;
    transition: transform 0.3s ease;
}

.chat-launcher:hover .chat-launcher-icon {
    transform: scale(1.1);
}

.chat-launcher-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: bounce 2s infinite;
}

.chat-launcher-notification.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== КОНТЕЙНЕР ЧАТУ ===== */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.chat-container.expanded {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ===== ЗАГОЛОВОК ЧАТУ ===== */
.chat-header {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-avatar svg {
    width: 24px;
    height: 24px;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close-btn,
.chat-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
}

.chat-close-btn:hover,
.chat-reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-reset-btn:hover {
    background: rgba(255, 152, 0, 0.2);
}

/* ===== ФОРМА РЕЄСТРАЦІЇ ===== */
.registration-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8fbff 50%, #ffffff 100%);
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.registration-content {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    position: relative;
    z-index: 1;
}

.registration-content h3 {
    color: #1565c0;
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(79, 195, 247, 0.2);
}

.registration-content p {
    color: #1976d2;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.2);
}

/* ===== ФОРМА ===== */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
    background: #ffffff;
}

.form-input::placeholder {
    color: #9ca3af;
}

/* ===== ПОЛЕ ТЕЛЕФОНУ ===== */
.phone-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Стилі для intl-tel-input контейнера */
.phone-input-wrapper .iti {
    width: 100%;
    border: 2px solid #bbdefb;
    border-radius: 12px;
    overflow: visible;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(79, 195, 247, 0.1);
    height: 56px;
    position: relative;
}

.phone-input-wrapper .iti:focus-within {
    border-color: #4fc3f7;
    box-shadow:
        0 0 0 4px rgba(79, 195, 247, 0.2),
        0 4px 16px rgba(79, 195, 247, 0.15);
    transform: translateY(-2px);
    background: #ffffff;
}

/* Стилі для вибору країни */
.phone-input-wrapper .iti__country-selector {
    background: rgba(79, 195, 247, 0.08);
    border: none;
    border-right: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 10px 0 0 10px;
    padding: 0 12px;
    min-width: 90px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.phone-input-wrapper .iti__country-selector:hover {
    background: rgba(79, 195, 247, 0.15);
}

.phone-input-wrapper .iti__country-selector:focus {
    background: rgba(79, 195, 247, 0.2);
    outline: none;
}

/* Стилі для прапорця країни */
.phone-input-wrapper .iti__flag {
    width: 20px;
    height: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* Стилі для коду країни */
.phone-input-wrapper .iti__selected-dial-code {
    color: #1565c0;
    font-weight: 600;
    font-size: 14px;
    margin-left: 6px;
}

/* Стрілочка */
.phone-input-wrapper .iti__arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #1565c0;
    margin-left: 8px;
    width: 0;
    height: 0;
    transition: transform 0.3s ease;
}

.phone-input-wrapper .iti--show-dropdown .iti__arrow {
    transform: rotate(180deg);
}

/* Стилі для поля вводу */
.phone-input-wrapper .iti__tel-input {
    border: none;
    background: transparent;
    font-size: 15px;
    padding: 0 20px;
    color: #1f2937;
    font-weight: 500;
    letter-spacing: 0.3px;
    width: 100%;
    height: 52px;
    border-radius: 0 10px 10px 0;
    outline: none;
    box-sizing: border-box;
    margin-left: 0;
}

.phone-input-wrapper .iti__tel-input:focus {
    background: rgba(255, 255, 255, 0.95);
    color: #1565c0;
}

.phone-input-wrapper .iti__tel-input::placeholder {
    color: #90caf9;
    font-style: normal;
    font-weight: 400;
    transition: color 0.3s ease;
}

.phone-input-wrapper .iti__tel-input:focus::placeholder {
    color: #bbdefb;
}

/* Стилі для випадаючого списку країн */
.iti__dropdown {
    background: white !important;
    border: 2px solid #4fc3f7 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.25) !important;
    margin-top: 4px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    z-index: 10000 !important;
    width: 100% !important;
}

.iti__country-list {
    padding: 0 !important;
    margin: 0 !important;
}

.iti__country {
    padding: 14px 16px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f8ff !important;
    transition: background-color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 48px !important;
}

.iti__country:hover {
    background: #f8fbff !important;
}

.iti__country.iti__highlight {
    background: #e3f2fd !important;
    color: #1565c0 !important;
}

.iti__country-name {
    font-size: 14px !important;
    color: #374151 !important;
    flex: 1 !important;
}

.iti__dial-code {
    font-size: 13px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

.iti__flag {
    width: 20px !important;
    height: 15px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 2px !important;
    margin-right: 8px !important;
}

/* Поле пошуку в списку країн */
.iti__search-input {
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin: 8px 12px !important;
    font-size: 14px !important;
    outline: none !important;
    transition: border-color 0.3s ease !important;
    width: calc(100% - 24px) !important;
    box-sizing: border-box !important;
}

.iti__search-input:focus {
    border-color: #4fc3f7 !important;
}

/* Скролбар для списку країн */
.iti__dropdown::-webkit-scrollbar {
    width: 6px !important;
}

.iti__dropdown::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 3px !important;
}

.iti__dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

.iti__dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Адаптивність */
@media (max-width: 480px) {
    .phone-input-wrapper .iti {
        height: 50px;
    }

    .phone-input-wrapper .iti__country-selector {
        min-width: 80px;
        height: 46px;
        padding: 0 10px;
    }

    .phone-input-wrapper .iti__tel-input {
        height: 46px;
        padding: 0 16px;
        font-size: 14px;
    }

    .phone-input-wrapper .iti__selected-dial-code {
        font-size: 13px;
    }
}

/* ===== WELCOME СЛАЙДИ ===== */
.welcome-slides {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.welcome-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
}

.welcome-slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.welcome-slide:first-child {
    transform: translateX(0) scale(0.95);
    opacity: 0;
}

.welcome-slide:first-child.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.slide-content {
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: slideContentIn 0.6s ease-out 0.2s both;
}

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

.slide-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8fbff 100%);
    border-radius: 50%;
    margin: 0 auto 24px;
    box-shadow: 0 4px 16px rgba(79, 195, 247, 0.2);
    animation: iconBounce 0.6s ease-out 0.4s both;
    position: relative;
}

@keyframes iconBounce {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.slide-icon::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(
        135deg,
        rgba(79, 195, 247, 0.1) 0%,
        rgba(79, 195, 247, 0.05) 100%
    );
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

.slide-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1565c0;
    margin: 0 0 16px 0;
    line-height: 1.3;
    animation: textSlideUp 0.5s ease-out 0.6s both;
}

.slide-content p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px 0;
    animation: textSlideUp 0.5s ease-out 0.8s both;
}

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

.slide-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    animation: dotsSlideUp 0.5s ease-out 1s both;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot:hover {
    background: #94a3b8;
    transform: scale(1.1);
}

.dot.active {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%) !important;
    transform: scale(1.3) !important;
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4) !important;
}

.dot.active::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 50%;
    animation: dotRipple 1.5s ease-out infinite;
}

@keyframes dotRipple {
    from {
        transform: scale(0.8);
        opacity: 1;
    }
    to {
        transform: scale(1.4);
        opacity: 0;
    }
}

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

.slide-next-btn {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.35);
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: buttonSlideUp 0.5s ease-out 1.2s both;
    margin-top: -20px;
}

.slide-next-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.slide-next-btn:hover::before {
    left: 100%;
}

.slide-next-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(79, 195, 247, 0.5);
    background: linear-gradient(135deg, #29b6f6 0%, #1e88e5 100%);
}

.slide-next-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.35);
}

.slide-next-btn svg {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-next-btn:hover svg {
    transform: translateX(6px) scale(1.1);
}

@keyframes buttonSlideUp {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Кнопка назад у формі */
.back-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: #4fc3f7;
}

.back-btn svg {
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

/* Адаптивність для слайдів */
@media (max-width: 480px) {
    .welcome-slide {
        padding: 20px 16px;
    }

    .slide-content {
        max-width: 280px;
    }

    .slide-content h2 {
        font-size: 20px;
    }

    .slide-content p {
        font-size: 14px;
    }

    .slide-next-btn {
        padding: 14px 24px;
        font-size: 15px;
    }

    .slide-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }

    .slide-icon svg {
        width: 56px;
        height: 56px;
    }
}

/* ===== ПОВІДОМЛЕННЯ ПРО ПОМИЛКИ ===== */
.field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    display: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.field-error.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== КНОПКА ВІДПРАВКИ ===== */
.start-chat-btn {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
    font-family: inherit;
}

.start-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.start-chat-btn:active {
    transform: translateY(0);
}

.start-chat-btn svg {
    transition: transform 0.3s ease;
}

.start-chat-btn:hover svg {
    transform: translateX(2px);
}

/* ===== ІНТЕРФЕЙС ЧАТУ ===== */
.chat-interface {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Головний контейнер чату */
#chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Основний контейнер chatjs */
.chatjs-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    margin: 0 !important;
    max-width: none !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    animation: none !important;
    min-height: 0 !important;
}

.chatjs-header {
    display: none !important;
}

/* Статус підключення */
.connection-status {
    padding: 8px 16px;
    text-align: center;
    font-size: 12px;
    background: #e8f5e8;
    color: #2e7d32;
    border-bottom: 1px solid #c8e6c9;
    flex-shrink: 0;
}

.connection-status.disconnected {
    background: #ffebee;
    color: #c62828;
    border-bottom-color: #ffcdd2;
}

/* Область повідомлень */
.chatjs-messages {
    flex: 1 !important;
    padding: 20px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
}

/* Повідомлення */
.chatjs-message {
    display: flex;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatjs-message-visible {
    opacity: 1;
    transform: translateY(0);
}

.chatjs-message-user {
    justify-content: flex-end;
}

.chatjs-message-bot {
    justify-content: flex-start;
}

.chatjs-message-admin {
    justify-content: flex-start;
}

.chatjs-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.chatjs-message-user .chatjs-message-content {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.chatjs-message-bot .chatjs-message-content {
    background: #e3f2fd;
    color: #1565c0;
    border-bottom-left-radius: 4px;
    border: 1px solid #bbdefb;
}

.chatjs-message-admin .chatjs-message-content {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.chatjs-message-text {
    font-size: 14px;
    line-height: 1.4;
}

.chatjs-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chatjs-message-bot .chatjs-message-time,
.chatjs-message-admin .chatjs-message-time {
    text-align: left;
}

/* Індикатор друкування */
.chatjs-typing {
    padding: 15px 20px !important;
    background: #f8fbff !important;
    border-top: 1px solid #e1f5fe !important;
    display: none !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 13px !important;
    color: #1976d2 !important;
    flex-shrink: 0 !important;
}

.typing-indicator {
    display: flex;
    gap: 3px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #4fc3f7;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Область введення */
.chatjs-input-area {
    padding: 20px !important;
    background: #f8fbff !important;
    border-top: 1px solid #e1f5fe !important;
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.chatjs-input {
    flex: 1 !important;
    padding: 14px 18px !important;
    border: 2px solid #e1f5fe !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    background: white !important;
    height: 48px !important;
    box-sizing: border-box !important;
}

.chatjs-input:focus {
    border-color: #4fc3f7 !important;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15) !important;
}

.chatjs-input::placeholder {
    color: #90caf9 !important;
}

.chatjs-send-btn {
    padding: 14px 24px !important;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 90px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.25) !important;
}

.chatjs-send-btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4) !important;
}

.chatjs-send-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Прокрутка для повідомлень */
.chatjs-messages::-webkit-scrollbar {
    width: 8px;
}

.chatjs-messages::-webkit-scrollbar-track {
    background: #f1f8ff;
    border-radius: 4px;
}

.chatjs-messages::-webkit-scrollbar-thumb {
    background: #bbdefb;
    border-radius: 4px;
    border: 2px solid #f1f8ff;
}

.chatjs-messages::-webkit-scrollbar-thumb:hover {
    background: #90caf9;
}

/* ===== МОБІЛЬНІ СТИЛІ ===== */
@media (max-width: 768px) {
    .chat-container {
        width: 100vw !important;
        height: 100vh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
    }

    .chat-header {
        border-radius: 0 !important;
        padding: 15px 20px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
    }

    .registration-content {
        padding: 18px;
        min-height: calc(100% - 36px);
    }

    .registration-content h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .registration-content p {
        font-size: 13px;
        margin-bottom: 18px;
        padding: 10px 14px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 10px;
    }

    .phone-input-wrapper {
        border-radius: 10px;
    }

    .country-select {
        min-width: 85px;
        font-size: 14px;
        padding: 10px 8px;
        height: 52px;
    }

    .country-select option {
        font-size: 14px;
        padding: 10px 12px;
        height: 42px;
        line-height: 26px;
    }

    .phone-input {
        padding: 14px 16px;
        font-size: 16px;
        letter-spacing: 0.3px;
    }

    .start-chat-btn {
        padding: 14px 18px;
        font-size: 15px;
        margin-top: 12px;
        border-radius: 10px;
    }

    .chat-launcher {
        bottom: 20px !important;
        right: 20px !important;
        width: 60px !important;
        height: 60px !important;
    }

    .chatjs-messages {
        padding: 15px !important;
        flex: 1 !important;
    }

    .chatjs-message-content {
        max-width: 85% !important;
        padding: 10px 14px !important;
    }

    .chatjs-input-area {
        padding: 15px !important;
        position: sticky !important;
        bottom: 0 !important;
        background: #f8fbff !important;
        border-top: 2px solid #e1f5fe !important;
    }

    .chatjs-input {
        font-size: 16px !important;
        padding: 14px 18px !important;
    }

    .chatjs-send-btn {
        padding: 14px 18px !important;
        min-width: 70px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .registration-content {
        padding: 14px;
    }

    .registration-content h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .registration-content p {
        font-size: 12px;
        margin-bottom: 16px;
        padding: 8px 12px;
    }

    .form-group {
        gap: 6px;
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 10px;
    }

    .phone-input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .chat-form {
        gap: 16px;
    }

    .start-chat-btn {
        padding: 13px 18px;
        font-size: 14px;
        border-radius: 10px;
        margin-top: 10px;
    }

    .chatjs-messages {
        padding: 12px !important;
        gap: 10px !important;
    }

    .chatjs-message-content {
        max-width: 90% !important;
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    .chatjs-input {
        font-size: 16px !important;
        padding: 12px 16px !important;
    }

    .chatjs-send-btn {
        padding: 12px 16px !important;
        min-width: 60px !important;
        font-size: 12px !important;
    }

    .chatjs-input-area {
        padding: 12px !important;
    }

    .chat-header {
        padding: 12px 15px !important;
    }

    .chat-header-text h3 {
        font-size: 15px !important;
    }

    .chat-status {
        font-size: 11px !important;
    }
}

/* ===== СТИЛІ ДЛЯ СКРОЛБАРУ ===== */
.registration-form::-webkit-scrollbar {
    width: 6px;
}

.registration-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.registration-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.registration-form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== ДОСТУПНІСТЬ ===== */
.chat-launcher:focus,
.chat-close-btn:focus,
.start-chat-btn:focus,
.form-input:focus {
    outline: 2px solid #4fc3f7;
    outline-offset: 2px;
}
