#pdf-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-widget-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.chat-widget-toggle:hover {
    transform: scale(1.05);
}

.chat-icon {
    font-size: 24px;
}

.chat-widget-container {
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h5 {
    margin: 0;
    font-weight: 600;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-chat:hover {
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Fixed height calculation for proper scrolling */
    height: calc(100% - 140px); /* Total height minus header and footer */
}

.message {
    margin-bottom: 12px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot .message-content {
    background: white;
    color: #333;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 4px;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.chat-input button:hover {
    background: #5a67d8;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.chat-footer a {
    color: #667eea;
    text-decoration: none;
}

.chat-footer a:hover {
    text-decoration: underline;
}

/* Custom scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Privacy notice */
.privacy-notice {
    margin-top: 8px;
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    padding: 0 10px;
    line-height: 1.3;
}

/* Responsive */
@media (max-width: 576px) {
    #pdf-chat-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chat-widget-container {
        width: calc(100vw - 20px);
        height: 70vh;
        right: 10px;
        bottom: 80px;
    }
}