@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Reset & variables */
.iv-chatbot-container {
    --iv-font-primary: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --iv-color-primary: #00b4db;
    --iv-color-secondary: #0083b0;
    --iv-color-dark: #0f172a;
    --iv-color-light: #f8fafc;
    --iv-color-border: rgba(226, 232, 240, 0.8);
    --iv-grad-primary: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    --iv-grad-accent: linear-gradient(135deg, #FF9900 0%, #FF5E62 100%);
    
    font-family: var(--iv-font-primary);
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
}

.iv-chatbot-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─────────────────────────── Trigger Button ─────────────────────────── */
.iv-chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--iv-grad-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 180, 219, 0.4), 0 0 0 0 rgba(0, 180, 219, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
    animation: iv-pulse 2s infinite;
}

.iv-chatbot-trigger:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 24px rgba(0, 180, 219, 0.6);
}

.iv-chatbot-trigger:active {
    transform: scale(0.95);
}

.iv-trigger-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
}

.iv-trigger-icon-wrap svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.iv-icon-close {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.iv-chatbot-container.iv-open .iv-icon-chat {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.iv-chatbot-container.iv-open .iv-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.iv-chatbot-container.iv-open .iv-chatbot-trigger {
    background: var(--iv-color-dark);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.3);
    animation: none;
}

/* ─────────────────────────── Chat Window ─────────────────────────── */
.iv-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 370px;
    height: 580px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

.iv-chatbot-container.iv-open .iv-chatbot-window {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ─────────────────────────── Header ─────────────────────────── */
.iv-chatbot-header {
    background: var(--iv-grad-primary);
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 131, 176, 0.15);
    z-index: 10;
}

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

.iv-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
}

.iv-avatar-image-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    border: 2px solid #fff;
}

.iv-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    background: #fff;
}

.iv-online-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid #0083b0;
    border-radius: 50%;
    animation: iv-pulse-green 2s infinite;
}

.iv-header-text h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}

.iv-header-text span {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.iv-chatbot-header-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: all 0.2s;
    outline: none;
}

.iv-chatbot-header-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* ─────────────────────────── Body & Screens ─────────────────────────── */
.iv-chatbot-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: rgba(248, 250, 252, 0.4);
}

.iv-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
}

.iv-screen.iv-screen-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ─────────────────────────── Screen Header ─────────────────────────── */
.iv-screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--iv-color-border);
}

.iv-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.iv-btn-back:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--iv-color-dark);
}

.iv-btn-back svg {
    width: 16px;
    height: 16px;
}

.iv-screen-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--iv-color-dark);
}

/* ─────────────────────────── SCREEN 1: Main Menu ─────────────────────────── */
.iv-chat-bubble-container {
    margin-bottom: 24px;
    animation: iv-fade-in-up 0.5s ease forwards;
}

.iv-chat-bubble {
    background: #fff;
    border: 1px solid var(--iv-color-border);
    border-radius: 16px 16px 16px 4px;
    padding: 14px 18px;
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    display: inline-block;
    max-width: 90%;
}

.iv-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.iv-action-btn {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--iv-color-border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    text-align: left;
    width: 100%;
}

.iv-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 180, 219, 0.1);
    border-color: rgba(0, 180, 219, 0.3);
}

.iv-action-btn:active {
    transform: translateY(0);
}

.iv-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(0, 180, 219, 0.08);
    color: var(--iv-color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    transition: all 0.3s;
}

.iv-action-btn:hover .iv-btn-icon {
    background: var(--iv-grad-primary);
    color: #fff;
}

.iv-btn-icon svg {
    width: 20px;
    height: 20px;
}

.iv-btn-text {
    flex: 1;
}

.iv-btn-text strong {
    display: block;
    font-size: 15px;
    color: var(--iv-color-dark);
    margin-bottom: 2px;
}

.iv-btn-text small {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.iv-btn-arrow {
    font-size: 16px;
    color: #cbd5e1;
    transition: transform 0.3s;
}

.iv-action-btn:hover .iv-btn-arrow {
    transform: translateX(4px);
    color: var(--iv-color-secondary);
}

/* ─────────────────────────── SCREEN 2: Reservation / Tours ─────────────────────────── */
.iv-screen-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}

/* Custom Scrollbar for inner screen content */
.iv-screen-content::-webkit-scrollbar,
.iv-chatbot-body::-webkit-scrollbar {
    width: 4px;
}
.iv-screen-content::-webkit-scrollbar-track,
.iv-chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}
.iv-screen-content::-webkit-scrollbar-thumb,
.iv-chatbot-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.iv-tours-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iv-tour-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--iv-color-border);
    border-radius: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--iv-color-dark);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}

.iv-tour-card:hover {
    border-color: var(--iv-color-primary);
    box-shadow: 0 4px 14px rgba(0, 180, 219, 0.1);
    transform: translateX(3px);
}

.iv-tour-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--iv-color-dark);
    flex: 1;
    padding-right: 12px;
}

.iv-tour-action-btn {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--iv-grad-primary);
    padding: 6px 12px;
    border-radius: 8px;
    transition: opacity 0.2s;
}

.iv-tour-card:hover .iv-tour-action-btn {
    opacity: 0.9;
}

.iv-empty-message {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin-top: 40px;
}

/* ─────────────────────────── SCREEN 3: Contact Us ─────────────────────────── */
.iv-contact-social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.iv-social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--iv-color-border);
    border-radius: 12px;
    padding: 16px 8px;
    text-decoration: none;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}

.iv-social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--iv-color-light);
    color: #64748b;
    transition: all 0.3s;
}

.iv-social-icon svg {
    width: 18px;
    height: 18px;
}

/* Social Hover Effects */
.iv-social-tripadvisor:hover {
    border-color: #34e0a1;
    background: rgba(52, 224, 161, 0.05);
    color: #0f172a;
}
.iv-social-tripadvisor:hover .iv-social-icon {
    background: #34e0a1;
    color: #fff;
}

.iv-social-instagram:hover {
    border-color: #e1306c;
    background: rgba(225, 48, 108, 0.05);
    color: #0f172a;
}
.iv-social-instagram:hover .iv-social-icon {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: #fff;
}

.iv-social-contact:hover {
    border-color: var(--iv-color-primary);
    background: rgba(0, 180, 219, 0.05);
    color: #0f172a;
}
.iv-social-contact:hover .iv-social-icon {
    background: var(--iv-grad-primary);
    color: #fff;
}

.iv-social-whatsapp:hover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.05);
    color: #0f172a;
}
.iv-social-whatsapp:hover .iv-social-icon {
    background: #25d366;
    color: #fff;
}

/* Direct Contact Lines (Phones/Emails) */
.iv-contact-details-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--iv-color-border);
}

.iv-contact-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.iv-contact-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.iv-contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--iv-color-border);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.iv-contact-link:hover {
    border-color: var(--iv-color-primary);
    background: var(--iv-color-light);
    color: var(--iv-color-dark);
}

.iv-contact-link svg {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.iv-contact-link:hover svg {
    color: var(--iv-color-primary);
}

/* ─────────────────────────── Footer ─────────────────────────── */
.iv-chatbot-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--iv-color-border);
    background: #fff;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.iv-chatbot-footer a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.iv-chatbot-footer a:hover {
    color: var(--iv-color-primary);
    text-decoration: underline;
}

/* ─────────────────────────── Animations ─────────────────────────── */
@keyframes iv-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 180, 219, 0.4), 0 0 0 0 rgba(0, 180, 219, 0.4);
    }
    70% {
        box-shadow: 0 4px 20px rgba(0, 180, 219, 0.4), 0 0 0 10px rgba(0, 180, 219, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 180, 219, 0.4), 0 0 0 0 rgba(0, 180, 219, 0);
    }
}

@keyframes iv-pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes iv-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─────────────────────────── Responsiveness ─────────────────────────── */
@media screen and (max-width: 480px) {
    .iv-chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .iv-chatbot-window {
        bottom: 70px;
        width: calc(100vw - 30px);
        max-height: 520px;
        height: 520px;
    }
}
