body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    background: linear-gradient(135deg, #dceeff, #f5f9ff);
}

/* Floating chat button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
}

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

.chat-toggle svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chat container */
.chat-container {
    width: 380px;
    max-width: 90%;
    height: 520px;
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.chat-container.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-header {
    background: rgba(0, 123, 255, 0.85);
    color: white;
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.3px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
    animation: fadeIn 0.3s ease;
}

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

.bot {
    background: rgba(0, 123, 255, 0.15);
    color: #003366;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user {
    background: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
}

.chat-input textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(0, 123, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
    resize: none;
    overflow: hidden;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.3s ease;
}

.chat-input textarea:focus {
    border-color: #007bff;
}

.chat-input button {
    background: #007bff;
    border: none;
    padding: 10px;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.4);
    transition: transform 0.2s;
}

.chat-input button:hover {
    transform: scale(1.1);
}

.chat-input svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Typing indicator */
.typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    margin: 5px 0;
    padding: 10px;
    background: rgba(0, 123, 255, 0.15);
    border-radius: 18px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* --- FULLSCREEN CHAT ON MOBILE --- */
@media (max-width: 600px) {
    .chat-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        bottom: 0;
        right: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: none;
        z-index: 10000;
        display: flex !important;
        flex-direction: column;
        overflow-x: hidden;
        max-width: 100vw;
    }
    .chat-header {
        font-size: 18px;
        padding: 16px;
        border-radius: 0;
    }
    .chat-messages {
        height: calc(100vh - 120px);
    }
    .chat-input {
        padding: 12px;
    }
}