#messageModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeInMessageModal 0.2s ease-out;
}

@keyframes fadeInMessageModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#messageModal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 32px;
    padding-top: 48px;
    border-radius: 16px;
    position: relative;
    width: 90%;
    max-width: 500px;
    min-height: 200px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: slideUpMessageModal 0.3s ease-out;
    border: 1px solid #e8eaed;
}

@keyframes slideUpMessageModal {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#closeMessageModalButton {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#closeMessageModalButton:hover {
    background-color: #e8e8e8;
    transform: scale(1.1);
}

#closeMessageModalButton path {
    fill: #666;
}

#messageModalFormContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

#messageModalFormContainer form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 20px;
}

#messageModalHeaderDiv {
    font-weight: 700;
    font-size: 20px;
    color: #1a1a1a;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    text-align: left;
}

#messageModalInputsContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.messageModalInputWrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.messageModalLabel {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.messageModalInput,
.messageModalTextarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e8eaed;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.messageModalInput:invalid,
.messageModalTextarea:invalid {
    box-shadow: none;
}

.messageModalInput::-webkit-validation-bubble-message,
.messageModalTextarea::-webkit-validation-bubble-message {
    display: none;
}

.messageModalInput:focus,
.messageModalTextarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.messageModalTextarea {
    resize: vertical;
    min-height: 324px;
}

.messageModalError {
    color: #FF3B30;
    font-size: 14px;
    margin-top: 4px;
    display: none;
}

.messageModalError.show {
    display: block;
}

.messageModalInput.error,
.messageModalTextarea.error {
    border-color: #FF3B30;
}

.messageModalSendButton {
    background: linear-gradient(135deg, #007AFF 0%, #0063D1 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: auto;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.15);
    flex-shrink: 0;
}

.messageModalSendButton:hover {
    background: linear-gradient(135deg, #0063D1 0%, #004FAD 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.22);
}

.messageModalSendButton:active {
    transform: translateY(0);
}

.messageModalSendButton:disabled {
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#messageModalSuccessContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 20px 0;
    flex: 1;
    min-height: 0;
    text-align: center;
}

#messageModalSuccessIcon {
    display: flex;
    align-items: center;
    justify-content: center;
}

#messageModalSuccessText {
    font-weight: 700;
    font-size: 20px;
    color: #1a1a1a;
    text-align: center;
}

#messageModalSuccessSubtext {
    font-size: 16px;
    color: #666;
    text-align: center;
    line-height: 1.5;
    max-width: 400px;
}

@media screen and (max-width: 600px) {
    #messageModalOverlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    #messageModal {
        width: 100%;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        padding: 20px 16px;
        padding-top: calc(48px + env(safe-area-inset-top));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        justify-content: flex-start;
        align-items: stretch;
        text-align: left;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
        border: none;
        display: flex;
        flex-direction: column;
    }

    #closeMessageModalButton {
        top: calc(12px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
        padding: 6px;
    }

    #messageModalHeaderDiv {
        font-size: 18px;
    }

    .messageModalInput,
    .messageModalTextarea {
        font-size: 14px;
    }

    .messageModalTextarea {
        min-height: 360px;
    }

    .messageModalSendButton {
        font-size: 14px;
        padding: 12px 20px;
    }

    #messageModalFormContainer {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #messageModalSuccessContainer {
        flex: 1;
        min-height: 0;
        justify-content: center;
        padding: 40px 0;
    }
}
