/* Draft2Book Chatbot - Fixed Version */
.d2b-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.d2b-toggle {
    width: 60px;
    height: 60px;
    background: #0B7147FF;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.d2b-toggle:hover {
    background: #065939;
    transform: scale(1.05);
}

.d2b-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.d2b-window.active {
    display: flex;
}

.d2b-header {
    background: #0B7147FF;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.d2b-header h3 {
    margin: 0;
    font-size: 16px;
}

.d2b-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.d2b-close:hover {
    background: rgba(255,255,255,0.2);
}

.d2b-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.d2b-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
}

.d2b-message.bot {
    background: white;
    color: #333;
    border: 1px solid #e5e7eb;
    margin-right: auto;
}

.d2b-message.user {
    background: #0B7147FF;
    color: white;
    margin-left: auto;
}

.d2b-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.d2b-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    min-width: 200px;
}

.d2b-input:focus {
    border-color: #0B7147FF;
}

.d2b-send {
    width: 40px;
    height: 40px;
    background: #0B7147FF;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d2b-send:hover {
    background: #065939;
}

.d2b-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.d2b-enquiry-btn {
    background: #a0d8f2;
    color: #0c4a6e;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.d2b-enquiry-btn:hover {
    background: #7cc4e8;
    transform: translateY(-1px);
}

.d2b-quick-actions {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.d2b-quick-btn {
    background: white;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.d2b-quick-btn:hover {
    background: #0B7147FF;
    color: white;
    border-color: #0B7147FF;
}

.d2b-enquiry-form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 20px;
    overflow-y: auto;
}

.d2b-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.d2b-form-header h4 {
    margin: 0;
    color: #0B7147FF;
    font-size: 16px;
}

.d2b-form-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.d2b-form-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.d2b-enquiry-form-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.d2b-enquiry-form-fields input,
.d2b-enquiry-form-fields select,
.d2b-enquiry-form-fields textarea {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.d2b-enquiry-form-fields input:focus,
.d2b-enquiry-form-fields select:focus,
.d2b-enquiry-form-fields textarea:focus {
    border-color: #0B7147FF;
    box-shadow: 0 0 0 3px rgba(11, 113, 71, 0.1);
}

.d2b-enquiry-form-fields textarea {
    resize: vertical;
    min-height: 80px;
}

.d2b-submit-enquiry {
    background: #0B7147FF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.d2b-submit-enquiry:hover {
    background: #065939;
    transform: translateY(-1px);
}

.d2b-submit-enquiry:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.d2b-success-message {
    text-align: center;
    padding: 40px 20px;
}

.d2b-success-message h4 {
    color: #16a34a;
    margin-bottom: 15px;
    font-size: 18px;
}

.d2b-success-message p {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 20px;
}

.d2b-success-message button {
    background: #0B7147FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.d2b-success-message button:hover {
    background: #065939;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .d2b-chatbot {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .d2b-window {
        width: 100%;
        right: 0;
        left: 0;
        height: 450px;
    }
    
    .d2b-input-area {
        flex-direction: column;
        gap: 10px;
    }
    
    .d2b-input {
        min-width: auto;
    }
    
    .d2b-enquiry-btn {
        align-self: flex-start;
    }
}