/* DBI Chatbot - Mobile Responsive CSS with New Color Scheme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Container */
#dbi-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    pointer-events: none;
}

/* NEW: Toggle Button with "DBI Online" Text - BLUE-GREEN THEME */
#dbi-chatbot-toggle {
    background: linear-gradient(135deg, #2c5282, #38a169);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0 20px 0 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(44, 82, 130, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000000;
    pointer-events: auto;
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: auto;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

#dbi-chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(44, 82, 130, 0.4);
    background: linear-gradient(135deg, #2c5282, #2f855a);
}

#dbi-chatbot-toggle:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(44, 82, 130, 0.3);
}

#dbi-chatbot-toggle.active {
    background: linear-gradient(135deg, #2c5282, #276749);
    box-shadow: 0 4px 15px rgba(44, 82, 130, 0.3);
}

.dbi-chatbot-toggle-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.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 - NEW BLUE-GREEN THEME */
#dbi-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 0;
    left: 0;
    width: 450px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999;
    pointer-events: auto;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
}

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

/* Header - NEW BLUE THEME */
.dbi-chatbot-header {
    background: linear-gradient(to right, #2c5282, #4a90e2);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.dbi-chatbot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    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;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.dbi-chatbot-header-info p {
    margin: 3px 0 0;
    font-size: 13px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

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

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

/* Messages Container */
#dbi-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Message Bubbles */
.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: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 15px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dbi-message-bot .dbi-message-bubble {
    background: white;
    border: 1px 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: 6px;
    text-align: right;
    opacity: 0.8;
}

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

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

/* Quick Actions - NEW GREEN THEME */
.dbi-chatbot-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.dbi-quick-action {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: #2d3748;
    min-height: 70px;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
}

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

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

.dbi-quick-action:active {
    transform: translateY(0);
}

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

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

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

#dbi-chatbot-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    min-width: 0;
    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.1);
}

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

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

#dbi-chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(44, 82, 130, 0.3);
    background: linear-gradient(135deg, #2c5282, #3a7bc8);
}

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

/* Footer - NEW BLUE THEME */
.dbi-chatbot-footer {
    padding: 12px 16px;
    background: #2c5282;
    border-top: 1px solid #4a90e2;
    text-align: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    line-height: 1.4;
    font-weight: 500;
}

.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: 20px;
    border: 1px solid #e2e8f0;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.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(-10px); 
    }
}

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

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

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

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

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #dbi-chatbot-container {
        bottom: 15px;
        right: 15px;
        left: 15px;
    }
    
    #dbi-chatbot-toggle {
        height: 56px;
        padding: 0 18px 0 56px;
        font-size: 15px;
        right: 15px;
        bottom: 15px;
        box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
    }
    
    .dbi-chatbot-toggle-icon {
        left: 13px;
        font-size: 20px;
        width: 34px;
        height: 34px;
    }
    
    #dbi-chatbot-window {
        width: calc(100vw - 30px);
        max-width: none;
        height: 75vh;
        max-height: calc(100vh - 80px);
        bottom: 80px;
        right: 15px;
        left: 15px;
        margin: 0 auto;
        border-radius: 14px;
    }
    
    .dbi-chatbot-header {
        padding: 14px 16px;
    }
    
    .dbi-chatbot-header-info h3 {
        font-size: 16px;
    }
    
    .dbi-chatbot-header-info p {
        font-size: 12px;
    }
    
    .dbi-chatbot-avatar {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .dbi-chatbot-close {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    
    #dbi-chatbot-messages {
        padding: 16px;
        gap: 12px;
    }
    
    .dbi-message-bubble {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 18px;
    }
    
    .dbi-message-time {
        font-size: 10px;
        margin-top: 4px;
    }
    
    .dbi-chatbot-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 14px;
    }
    
    .dbi-quick-action {
        padding: 10px 6px;
        min-height: 65px;
        border-radius: 10px;
    }
    
    .dbi-quick-action i {
        font-size: 18px;
    }
    
    .dbi-quick-action span {
        font-size: 12px;
    }
    
    .dbi-chatbot-input-area {
        padding: 14px;
        gap: 8px;
    }
    
    #dbi-chatbot-input {
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 25px;
    }
    
    #dbi-chatbot-send {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }
    
    .dbi-chatbot-footer {
        padding: 10px 14px;
        font-size: 11px;
    }
    
    .dbi-typing-indicator {
        padding: 10px 14px;
        border-radius: 18px;
    }
}

/* Extra small devices (phones under 480px) */
@media (max-width: 480px) {
    #dbi-chatbot-toggle {
        height: 52px;
        padding: 0 16px 0 52px;
        font-size: 14px;
        right: 12px;
        bottom: 12px;
    }
    
    .dbi-chatbot-toggle-icon {
        left: 12px;
        font-size: 18px;
        width: 32px;
        height: 32px;
    }
    
    #dbi-chatbot-window {
        width: calc(100vw - 24px);
        right: 12px;
        left: 12px;
        bottom: 74px;
        height: 70vh;
        max-height: calc(100vh - 74px);
        border-radius: 12px;
    }
    
    .dbi-chatbot-header {
        padding: 12px 14px;
    }
    
    .dbi-chatbot-header-info h3 {
        font-size: 15px;
    }
    
    .dbi-chatbot-header-info p {
        font-size: 11px;
    }
    
    .dbi-message-bubble {
        max-width: 92%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .dbi-chatbot-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 12px;
    }
    
    .dbi-quick-action {
        min-height: 60px;
        padding: 8px 4px;
    }
    
    .dbi-quick-action i {
        font-size: 16px;
    }
    
    .dbi-quick-action span {
        font-size: 11px;
    }
    
    #dbi-chatbot-input {
        padding: 11px 16px;
        font-size: 13px;
    }
    
    #dbi-chatbot-send {
        width: 44px;
        height: 44px;
    }
    
    .dbi-chatbot-footer {
        font-size: 10px;
    }
}

/* Very small devices (phones under 360px) */
@media (max-width: 360px) {
    .dbi-chatbot-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .dbi-quick-action {
        min-height: 55px;
        padding: 6px;
    }
    
    .dbi-quick-action span {
        font-size: 10px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #dbi-chatbot-window {
        height: 65vh;
        max-height: calc(100vh - 70px);
        width: 400px;
        right: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    
    #dbi-chatbot-window.active {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    
    .dbi-chatbot-header {
        padding: 10px 14px;
    }
    
    .dbi-chatbot-header-info h3 {
        font-size: 15px;
    }
    
    .dbi-chatbot-header-info p {
        font-size: 11px;
    }
    
    #dbi-chatbot-messages {
        padding: 12px 14px;
    }
    
    .dbi-message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .dbi-chatbot-quick-actions {
        padding: 10px;
        gap: 6px;
    }
}

/* 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-input::placeholder {
        color: #a0aec0;
    }
    
    .dbi-chatbot-footer {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .dbi-chatbot-footer a {
        color: #ffffff;
    }
    
    .dbi-typing-indicator {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .dbi-typing-dot {
        background: #4a90e2;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dbi-message-bubble {
        border-width: 2px;
    }
    
    #dbi-chatbot-input {
        border-width: 2px;
    }
    
    .dbi-chatbot-toggle {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #dbi-chatbot-toggle,
    #dbi-chatbot-window,
    .dbi-message,
    .dbi-quick-action,
    #dbi-chatbot-send,
    .dbi-chatbot-close {
        transition: none;
        animation: none;
    }
    
    .dbi-typing-dot,
    .dbi-chatbot-notification {
        animation: none;
    }
}