/* Modal Styles */

/* Base Modal Structure */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    max-width: 700px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease forwards;
    padding: 40px;
}

@keyframes modalFadeIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

/* Form Styles for Modal */
.modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #474D57;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group.half {
    flex: 1;
    min-width: 0;
}

.modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.modal .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
}

.modal .form-control:focus {
    border-color: #5D8AA8;
    box-shadow: 0 0 0 3px rgba(93, 138, 168, 0.1);
    outline: none;
    background-color: #fff;
}

.modal textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.modal select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-control-file {
    display: block;
    width: 100%;
    padding: 10px 0;
}

.upload-note {
    font-size: 13px;
    color: #777;
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.form-submit {
    display: block;
    width: 100%;
    background-color: #5D8AA8;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-submit:hover {
    background-color: #4A7994;
}

/* Chatbot Modal Styles */
.chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 900;
}

.chatbot-toggle {
    display: flex;
    align-items: center;
    background-color: #5D8AA8;
    color: #fff;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(93, 138, 168, 0.4);
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    background-color: #4A7994;
    transform: translateY(-3px);
}

.chatbot-toggle span {
    margin-right: 10px;
    font-weight: 500;
}

.chatbot-toggle i {
    font-size: 20px;
}

.chatbot-modal {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 900;
    overflow: hidden;
    animation: chatbotFadeIn 0.3s ease forwards;
}

@keyframes chatbotFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-modal.show {
    display: block;
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #5D8AA8;
    color: #fff;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 18px;
}

.close-chatbot {
    font-size: 24px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-chatbot:hover {
    color: #fff;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f5f7fa;
}

.message {
    display: flex;
    margin-bottom: 20px;
}

.bot-message {
    align-items: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-message .message-avatar {
    display: none;
}

.message-content {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.bot-message .message-content {
    background-color: #fff;
    border-top-left-radius: 4px;
}

.user-message .message-content {
    background-color: #5D8AA8;
    color: #fff;
    border-top-right-radius: 4px;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.chatbot-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

.chatbot-input input {
    flex: 1;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #5D8AA8;
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    background-color: #5D8AA8;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chatbot-input button:hover {
    background-color: #4A7994;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px;
        margin: 30px auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .chatbot-modal {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 80px;
    }
    
    .chatbot-wrapper {
        right: 20px;
        bottom: 20px;
    }
}