/* Chat Modal - positioned above chat icon */
.chat-modal {
    display: none;
    position: fixed;
    bottom: 100px; /* Position above the chat icon */
    right: 30px; /* Align with chat icon */
    width: 350px;
    height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* Remove the full-screen overlay styling */
.chat-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Chat Messages */
.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.bot {
    background-color: #e2e8f0;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.chat-message.user {
    background-color: #1e3a8a;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.chat-send {
    background-color: #1e3a8a;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.chat-send:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}

.chat-send:active {
    transform: translateY(0);
}

/* Show chat modal */
.chat-modal.show {
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-modal {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 100px;
        height: 350px;
    }
    
    .chat-input-area {
        padding: 0.75rem;
    }
    
    .chat-body {
        padding: 0.75rem;
    }
}

/* Animation for smooth show/hide */
.chat-modal {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-modal.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Chat Icon - ensure proper positioning */
.chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #1e3a8a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    z-index: 1000;
    transition: all 0.3s;
}

.chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.chat-icon::after {
    content: '💬';
    font-size: 24px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}