/* Modal Background */
.amest-mc-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.amest-mc-modal.open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.amest-mc-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%; /* Could be more specific like 800px */
    max-width: 900px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: row;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Close Button */
.amest-mc-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.amest-mc-close:hover,
.amest-mc-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Body Layout */
.amest-mc-modal-body {
    display: flex;
    width: 100%;
    flex-direction: row;
}

/* Image Section - 60% */
.amest-mc-image {
    width: 60%;
    background-color: #f1f1f1;
}

.amest-mc-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Form Section - 40% */
.amest-mc-form-container {
    width: 40%;
    background-color: #4a5e63;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Form Styling */
#amest-mc-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.amest-mc-form-group input {
    width: 100%;
    padding: 12px !important;
    background-color: #3f5054 !important;
    border: 1px solid #3f5054 !important;
    color: #fff !important;
    font-size: 16px !important;
    outline: none !important;
}

.amest-mc-form-group input::placeholder {
    color: #fff !important;
    opacity: 0.8 !important;
}

.amest-mc-form-group input:focus {
    border-color: #344043 !important;
}

#amest-mc-form button {
    padding: 12px !important;
    background-color: #fff !important;
    color: #4a5e63 !important;
    border: none !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s;
    display: flex;
    align-items: center; /* Center content */
    justify-content: center; /* Center content */
}

#amest-mc-form button:hover {
    background-color: #e0e0e0 !important;
}

#amest-mc-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#amest-mc-message {
    margin-top: 15px;
    color: #fff !important;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

/* Spinner */
.amest-mc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(74, 94, 99, 0.3);
    border-radius: 50%;
    border-top-color: #4a5e63;
    animation: amest-mc-spin 1s ease-in-out infinite;
}

@keyframes amest-mc-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .amest-mc-modal-content {
        flex-direction: column;
        width: 90%;
        max-height: 95vh;
        overflow-y: auto;
    }

    .amest-mc-modal-body {
        flex-direction: column;
    }

    .amest-mc-image {
        width: 100%;
    }

    .amest-mc-form-container {
        width: 100%;
        padding: 20px;
    }
}
