/* ✨ PREMIUM CHAT WIDGET - "OCEAN GLASS" THEME ✨ */
:root {
    --chat-primary: #0a3d62;
    /* Deep Ocean */
    --chat-secondary: #60a3bc;
    /* Calm Sea */
    --chat-accent: #079992;
    /* Teal Highlight */
    --chat-gold: #e58e26;
    /* Gold for Prices/Stars */
    --chat-bg-gradient: linear-gradient(135deg, #0a3d62 0%, #3c6382 100%);
    --chat-glass: rgba(255, 255, 255, 0.92);
    --chat-glass-border: rgba(255, 255, 255, 0.8);
    --chat-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --chat-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --chat-font: 'Inter', system-ui, -apple-system, sans-serif;
    --chat-radius: 24px;
}

/* --- FLOATING BUTTON WITH RIPPLE EFFECT --- */
#chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--chat-bg-gradient);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(10, 61, 98, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999;
    overflow: visible;
    /* For ripple */
}

#chat-widget-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 20px 40px rgba(10, 61, 98, 0.5);
}

#chat-widget-button i {
    font-size: 28px;
    transition: transform 0.4s ease;
}

#chat-widget-button:hover i {
    transform: rotate(-10deg) scale(1.1);
}

/* --- MAIN CHAT WINDOW --- */
#chat-widget-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 650px;
    max-width: calc(100% - 60px);
    max-height: calc(100vh - 140px);
    background: var(--chat-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--chat-glass-border);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    font-family: var(--chat-font);
}

#chat-widget-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* --- HEADER --- */
.chat-header {
    background: var(--chat-bg-gradient);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect on header */
.chat-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(30deg);
    pointer-events: none;
}

.chat-header .header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.chat-header .header-info i {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.chat-header .header-info span {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.chat-header .close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.chat-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* --- MESSAGES AREA --- */
.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f0f2f5;
}

.message {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.4s ease-out both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    background: #ffffff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user {
    background: var(--chat-bg-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(10, 61, 98, 0.2);
}

/* --- RESPONSE GROUPING (Connected UI) --- */
.response-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
    animation: slideUp 0.4s ease-out both;
}

.response-group .message {
    margin-bottom: 0; 
    animation: none; /* Prevent double animation */
    max-width: 92%;
    border-bottom-left-radius: 4px; /* Maintain flow */
}

/* --- CRUISE CARD (Premium UI) --- */
.cruise-card-container {
    width: 100%;
    max-width: 350px;
    margin: 0;
    padding-left: 5px; /* Slight alignment adjust */
    align-self: flex-start;
    perspective: 1000px;
}

.cruise-card {
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 5px 15px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
}

.cruise-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.18);
    z-index: 10;
}

/* Image with gradient overlay */
.cruise-card-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.cruise-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

/* Heart Icon (Wishlist) */
.wishlist-heart {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b2bec3;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wishlist-heart:hover {
    transform: scale(1.15) rotate(5deg);
    color: #e74c3c;
}

.wishlist-heart.active {
    color: #e74c3c;
    background: #fff0f0;
    animation: pulseHeart 0.6s ease-out;
}

@keyframes pulseHeart {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cruise-card-content {
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #fdfbfb 100%);
}

/* Title */
.cruise-card-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--chat-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* New Itinerary Section */
.cruise-card-itinerary {
    font-size: 13px;
    color: #57606f;
    margin-bottom: 16px;
    line-height: 1.5;
    background: #f1f4f8;
    padding: 10px 14px;
    border-radius: 12px;
    border-left: 4px solid var(--chat-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Badges */
.cruise-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.cruise-card-info span {
    font-size: 11px;
    background: #ffffff;
    border: 1px solid #dfe6e9;
    color: #2d3436;
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cruise-card-info i {
    color: var(--chat-accent);
    font-size: 12px;
}

/* Price & Button Row */
.cruise-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    padding-top: 15px;
    border-top: 1px dashed #dfe6e9;
}

.cruise-card-price {
    font-size: 22px;
    font-weight: 900;
    color: var(--chat-gold);
    letter-spacing: -0.5px;
}

.cruise-card-price span {
    font-size: 13px;
    font-weight: 600;
    color: #b2bec3;
    margin-right: 2px;
}

.cruise-card-btn {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-accent) 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(10, 61, 98, 0.25);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cruise-card-btn::after {
    content: '→';
    font-weight: 900;
    transition: transform 0.3s;
}

.cruise-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 61, 98, 0.35);
}

.cruise-card-btn:hover::after {
    transform: translateX(4px);
}

/* --- INPUT AREA --- */
.chat-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dfe6e9;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    background: #f8f9fa;
    resize: none;
    /* No manual resize */
    height: 48px;
    /* Fixed initial height */
    line-height: 1.4;
    font-family: var(--chat-font);
    transition: border 0.3s;
}

.chat-input-area textarea:focus {
    border-color: var(--chat-secondary);
    background: white;
}

.chat-input-area button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--chat-bg-gradient);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(10, 61, 98, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(10, 61, 98, 0.3);
}

.chat-input-area button i {
    font-size: 18px;
    margin-left: -2px;
    /* Visual center adjustment for play/send icons */
}

/* Loading Animation */
.message-loading {
    padding: 15px 24px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- SCROLLBAR --- */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #dcdde1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #b2bec3;
}

/* --- MOBILE --- */
@media (max-width: 480px) {
    #chat-widget-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        max-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }

    #chat-widget-button {
        bottom: 20px;
        right: 20px;
    }
}