/* ===================================
   FLOATING CHATBOT STYLES
   Modern, Premium Design for Visconti's Italian Restaurant
   =================================== */

/* Chat Button - Floating Icon */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}

.chat-button svg {
    width: 28px;
    height: 28px;
    fill: #1a1a1a;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(212, 175, 55, 0.7);
    }
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: slideUp 0.3s ease-out;
}

.chat-container.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

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

.chat-avatar {
    width: 60px;
    height: 60px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: rgba(26, 26, 26, 0.8);
}

.chat-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chat-close:hover {
    transform: rotate(90deg);
}

.chat-close svg {
    width: 24px;
    height: 24px;
    fill: #1a1a1a;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a1a1a;
}

.message.user .message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: #d4af37;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-content {
    background: rgba(212, 175, 55, 0.15);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: fit-content;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #d4af37;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Suggestion Chips */
.chat-suggestions {
    padding: 10px 15px;
    background: #f5f5f5;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-chip {
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #d4af37;
    border-radius: 20px;
    color: #d4af37;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.suggestion-chip:hover {
    background: #fff8e1;
    border-color: #c49a2e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Clear Chat Button (Cross Icon) */
.chat-clear {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #d4af37;
    transform: rotate(90deg);
}

.chat-clear:active {
    transform: rotate(90deg) scale(0.95);
}

.chat-clear svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.6);
    transition: fill 0.3s ease;
}

.chat-clear:hover svg {
    fill: #d4af37;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 25px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.chat-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

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

.chat-send svg {
    width: 20px;
    height: 20px;
    fill: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
        bottom: 90px;
    }

    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
        border-radius: 15px;
    }

    .chat-button {
        bottom: 15px;
        right: 15px;
        width: 52px;
        height: 52px;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-messages {
        padding: 15px;
    }

    .chat-input-area {
        padding: 15px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100vw - 30px);
        height: calc(100vh - 140px);
        right: 15px;
        bottom: 90px;
        left: 15px;
    }

    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .message-content {
        max-width: 75%;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        left: 10px;
        bottom: 80px;
        border-radius: 15px;
    }

    .chat-button {
        bottom: 15px;
        right: 15px;
        width: 52px;
        height: 52px;
    }

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

    .chat-header-text h3 {
        font-size: 14px;
    }

    .chat-header-text p {
        font-size: 11px;
    }

    .chat-avatar {
        width: 45px;
        height: 45px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input-area {
        padding: 12px;
        gap: 8px;
    }

    .chat-input {
        font-size: 13px;
        padding: 10px 14px;
    }

    .chat-send {
        width: 40px;
        height: 40px;
    }

    .chat-clear {
        width: 32px;
        height: 32px;
    }

    .message-content {
        max-width: 70%;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* FULL SCREEN CHATBOT */
.chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 380px;               /* desktop */
    height: 520px;              /* desktop */
    max-height: 90vh;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 0 20px rgba(0,0,0,0.25);
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: all 0.35s ease-in-out;
    z-index: 999999;
}

/* WHEN OPEN – FULL SCREEN ON MOBILE */
.chat-container.active {
    transform: scale(1);
}

/* MOBILE MODE — FULL 100% WIDTH & HEIGHT */
@media (max-width: 768px) {
    .chat-container {
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        transform-origin: center !important;
    }

    /* Messages full height */
    .chat-messages {
        height: calc(100vh - 160px) !important;
    }
}

/* VERY SMALL DEVICES (Nokia, SE, iPhone Mini etc.) */
@media (max-width: 400px) {
    .chat-container {
        width: 100vw !important;
        height: 100vh !important;
    }
}
.chat-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #d4af37;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 999999;
}


/* ============================================
   COMPACT MOBILE CHATBOT (NOT FULL SCREEN)
   Works on all phones & looks modern
=============================================== */
@media (max-width: 768px) {

    .chat-container {
        width: 88vw !important;
        height: 65vh !important;
        max-width: 420px !important;
        max-height: 480px !important;

        bottom: 90px !important;
        right: 12px !important;
        left: auto !important;
        top: auto !important;

        border-radius: 22px !important;
        transform-origin: bottom right !important;

        box-shadow: 0 10px 40px rgba(0,0,0,0.35);
        overflow: hidden;
    }

    /* Messages height adjust */
    .chat-messages {
        height: calc(65vh - 150px) !important;
    }

    /* Suggestions compact */
    .chat-suggestions {
        padding: 6px !important;
    }

    .suggestion-chip {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    /* Input area */
    .chat-input-area {
        padding: 8px !important;
    }

    .chat-input {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    .chat-send svg,
    .chat-clear svg {
        width: 22px !important;
        height: 22px !important;
    }
}
/* Fix scroll-up button alignment next to chatbot (mobile only) */
@media (max-width: 768px) {

    /* Chatbot button (your existing design) */
    .chat-button {
        bottom: 25px !important; 
        right: 25px !important;
    }

    /* Scroll-up button aligned perfectly to the LEFT of chatbot */
    #scroll-top {
        bottom: 25px !important;         /* SAME as chatbot */
        right: 95px !important;          /* chatbot 25px + chatbot width 60px + 10px gap */
        width: 48px !important;
        height: 48px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* ============================================
   PERFECT MOBILE CHATBOT (NO CUTTING / CENTERED)
=============================================== */
@media (max-width: 768px) {

    .chat-container {
        position: fixed !important;
        width: 92vw !important;        /* smaller so it never touches sides */
        max-width: 420px !important;
        height: 70vh !important;       /* compact height */
        max-height: 520px !important;

        left: 50% !important;          /* center align */
        transform: translateX(-50%) scale(0) !important;
        bottom: 100px !important;      /* above chatbot icon */

        border-radius: 22px !important;
        background: #000 !important;

        box-shadow: 0 8px 40px rgba(0,0,0,0.4);
        overflow: hidden;
    }

    /* When active, centered popup */
    .chat-container.active {
        transform: translateX(-50%) scale(1) !important;
    }

    /* Chat messages height */
    .chat-messages {
        height: calc(70vh - 165px) !important;
    }

    /* Suggestion chips more compact */
    .chat-suggestions {
        padding: 8px !important;
    }

    /* Input area fix */
    .chat-input-area {
        padding: 10px !important;
    }
}
/* FIX: Send button cut issue on mobile */
@media (max-width: 768px) {

    .chat-input-area {
        padding: 12px 16px 12px 10px !important; 
        /* More right padding so send button is safely inside */
    }

    .chat-send {
        margin-left: 10px !important;
        margin-right: 4px !important; /* bring the button inward */
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 50% !important;
    }

    .chat-send svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Ensure the input box doesn't stretch too far */
    .chat-input {
        width: calc(100% - 60px) !important; 
    }
}
/* Fix: Center suggestion chips in white card on mobile */
@media (max-width: 768px) {

    .chat-suggestions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;   /* ❤️ Center horizontally */
        align-items: center !important;
        text-align: center !important;
        padding: 12px 10px !important;        /* balanced padding */
        gap: 10px !important;                 /* even spacing */
    }

    .suggestion-chip {
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 14px !important;
        border-radius: 20px !important;
        text-align: center !important;
    }
}
/* ---------------------------------------------------
   DESKTOP FIX: Move chatbot slightly left
--------------------------------------------------- */
@media (min-width: 769px) {
    .chat-container {
        right: 40px !important;   /* previously 0 or 20px */
        bottom: 100px !important; /* keeps it floating nicely */
    }
}


