/* DBI Chatbot - OPTIMIZED PC WINDOW SIZE, BIG CHAT AREA */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Container */
#dbi-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Button */
#dbi-chatbot-toggle {
    background: linear-gradient(135deg, #2c5282, #38a169);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0 22px 0 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(44, 82, 130, 0.4);
    display: flex;
    align-items: center;
    position: fixed;
    right: 20px;
    bottom: 20px;
    font-weight: 700;
    font-size: 16px;
    gap: 10px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#dbi-chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(44, 82, 130, 0.5);
}

#dbi-chatbot-toggle.active {
    background: linear-gradient(135deg, #2c5282, #276749);
}

.dbi-chatbot-toggle-icon {
    position: absolute;
    left: 15px;
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.dbi-chatbot-toggle-text {
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dbi-chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #e53e3e;
    border-radius: 50%;
    border: 2px solid #2c5282;
    animation: pulse 2s infinite;
}

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

/* Chat Window - OPTIMIZED SIZE (not too big on PC) */
#dbi-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 480px; /* Reduced from 550px */
    height: 620px; /* Reduced from 700px */
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid #e2e8f0;
}

#dbi-chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Header - Compact */
.dbi-chatbot-header {
    background: linear-gradient(to right, #2c5282, #4a90e2);
    color: white;
    padding: 14px 18px; /* Compact */
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 65px; /* Compact */
}

.dbi-chatbot-avatar {
    width: 40px; /* Smaller */
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; /* Smaller */
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.dbi-chatbot-header-info {
    flex: 1;
    min-width: 0;
}

.dbi-chatbot-header-info h3 {
    margin: 0;
    font-size: 17px; /* Appropriate */
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.dbi-chatbot-header-info p {
    margin: 3px 0 0;
    font-size: 12px; /* Smaller */
    opacity: 0.9;
    font-weight: 500;
}

.dbi-chatbot-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 16px; /* Smaller */
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 34px; /* Smaller */
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.dbi-chatbot-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Messages Container - STILL BIG (70% of window) */
#dbi-chatbot-messages {
    flex: 1; /* Takes most space */
    padding: 22px;
    overflow-y: auto;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Good spacing */
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    min-height: 350px; /* Good minimum */
}

/* Message Bubbles - Good size */
.dbi-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

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

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

.dbi-message-bubble {
    max-width: 88%; /* Good width */
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.6; /* Good readability */
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 15px; /* Comfortable size */
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.dbi-message-bot .dbi-message-bubble {
    background: white;
    border: 2px solid #e2e8f0;
    color: #2d3748;
    border-bottom-left-radius: 8px;
}

.dbi-message-user .dbi-message-bubble {
    background: linear-gradient(135deg, #2c5282, #4a90e2);
    color: white;
    border-bottom-right-radius: 8px;
}

.dbi-message-time {
    font-size: 11px;
    color: #718096;
    margin-top: 8px;
    text-align: right;
    opacity: 0.8;
    font-weight: 500;
}

.dbi-message-user .dbi-message-time {
    color: rgba(255,255,255,0.9);
}

/* Emoji Styling */
.dbi-emoji {
    font-size: 1.3em;
    margin: 0 3px;
    display: inline-block;
    vertical-align: middle;
}

/* Quick Actions - VERY SMALL */
.dbi-chatbot-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-height: 65px;
}

.dbi-quick-action {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    color: #2d3748;
    min-height: auto;
    height: 52px;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    font-size: 11px;
}

.dbi-quick-action:hover {
    background: #38a169;
    color: white;
    transform: translateY(-2px);
    border-color: #38a169;
    box-shadow: 0 3px 8px rgba(56, 161, 105, 0.2);
}

.dbi-quick-action:hover i {
    color: white;
}

.dbi-quick-action i {
    font-size: 15px;
    color: #38a169;
}

.dbi-quick-action span {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
}

/* Input Area - Compact */
.dbi-chatbot-input-area {
    padding: 14px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    min-height: 65px;
}

#dbi-chatbot-input {
    flex: 1;
    padding: 13px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    background: #f7fafc;
    font-weight: 500;
}

#dbi-chatbot-input:focus {
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

#dbi-chatbot-input::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

#dbi-chatbot-send {
    background: linear-gradient(135deg, #2c5282, #4a90e2);
    color: white;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(44, 82, 130, 0.3);
}

#dbi-chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.4);
}

#dbi-chatbot-send:active {
    transform: scale(0.95);
}

/* Footer - Very small */
.dbi-chatbot-footer {
    padding: 9px 14px;
    background: #2c5282;
    border-top: 1px solid #4a90e2;
    text-align: center;
    font-size: 11px;
    color: white;
    flex-shrink: 0;
    line-height: 1.3;
    font-weight: 600;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dbi-chatbot-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.dbi-chatbot-footer a:hover {
    text-decoration: underline;
    color: #c6f6d5;
}

/* Typing Indicator */
.dbi-typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border: 2px solid #e2e8f0;
    width: fit-content;
}

.dbi-typing-dot {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: #4a90e2;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { 
        transform: translateY(0); 
    }
    30% { 
        transform: translateY(-8px); 
    }
}

/* Scrollbar */
#dbi-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#dbi-chatbot-messages::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 4px;
}

#dbi-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

#dbi-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mobile Responsive - BIG CHAT AREA */
@media (max-width: 768px) {
    #dbi-chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    #dbi-chatbot-toggle {
        height: 55px;
        padding: 0 18px 0 55px;
        font-size: 15px;
        right: 10px;
        bottom: 10px;
    }
    
    .dbi-chatbot-toggle-icon {
        left: 12px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    /* Full width on mobile */
    #dbi-chatbot-window {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        bottom: 75px;
        height: 75vh; /* Good mobile height */
        max-height: 75vh;
        border-radius: 12px;
    }
    
    .dbi-chatbot-header {
        padding: 12px 15px;
        min-height: 60px;
    }
    
    .dbi-chatbot-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .dbi-chatbot-header-info h3 {
        font-size: 16px;
    }
    
    .dbi-chatbot-header-info p {
        font-size: 11px;
    }
    
    .dbi-chatbot-close {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
    
    /* Big chat area on mobile */
    #dbi-chatbot-messages {
        padding: 18px;
        gap: 14px;
        min-height: 300px;
    }
    
    .dbi-message-bubble {
        max-width: 92%;
        padding: 14px 18px;
        font-size: 14px;
        line-height: 1.6;
    }
    
    .dbi-message-time {
        font-size: 10px;
        margin-top: 6px;
    }
    
    /* Quick Actions - Compact on mobile */
    .dbi-chatbot-quick-actions {
        padding: 9px 12px;
        gap: 6px;
        min-height: 60px;
    }
    
    .dbi-quick-action {
        padding: 6px 3px;
        height: 48px;
        font-size: 10px;
        border-radius: 8px;
    }
    
    .dbi-quick-action i {
        font-size: 14px;
    }
    
    .dbi-quick-action span {
        font-size: 9px;
    }
    
    /* Input Area */
    .dbi-chatbot-input-area {
        padding: 12px;
        min-height: 60px;
    }
    
    #dbi-chatbot-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    #dbi-chatbot-send {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    /* Footer */
    .dbi-chatbot-footer {
        padding: 8px 12px;
        font-size: 10px;
        min-height: 40px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #dbi-chatbot-window {
        height: 80vh; /* Bigger on small phones */
    }
    
    .dbi-chatbot-quick-actions {
        gap: 4px;
    }
    
    .dbi-quick-action {
        padding: 4px 2px;
        height: 45px;
    }
    
    .dbi-quick-action i {
        font-size: 13px;
    }
    
    .dbi-quick-action span {
        font-size: 8px;
    }
    
    #dbi-chatbot-messages {
        padding: 15px;
    }
    
    .dbi-message-bubble {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #dbi-chatbot-window {
        height: 75vh;
        width: 85vw;
        right: 7.5vw;
        left: 7.5vw;
    }
    
    .dbi-chatbot-quick-actions {
        min-height: 50px;
    }
    
    .dbi-quick-action {
        height: 42px;
    }
}

/* Prevent body scrolling when chat is open on mobile */
body.dbi-chatbot-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #dbi-chatbot-window {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .dbi-chatbot-header {
        background: linear-gradient(to right, #2d3748, #4a5568);
    }
    
    #dbi-chatbot-messages {
        background: #171923;
    }
    
    .dbi-message-bot .dbi-message-bubble {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .dbi-chatbot-quick-actions {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .dbi-quick-action {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .dbi-quick-action:hover {
        background: #38a169;
        border-color: #38a169;
    }
    
    #dbi-chatbot-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    #dbi-chatbot-input:focus {
        border-color: #4a90e2;
        background: #2d3748;
    }
    
    .dbi-chatbot-footer {
        background: #2d3748;
        border-color: #4a5568;
    }
}