/* Responsive Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: #FAF9F6; /* Replace white */
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 1px solid #888;
}

@media (min-width: 768px) {
    .modal-content {
        width: 60%;
        margin: 50px auto;
    }
}

.modal-content h2 {
    color: #b10000;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    padding: 10px;
    touch-action: manipulation;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal input,
.modal select,
.modal textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    touch-action: manipulation;
}

/* Touch-friendly form elements */
.modal input[type="text"],
.modal input[type="file"],
.modal select {
    min-height: 44px;
}

.modal button {
    width: 100%;
    padding: 0.75rem;
    color: #FAF9F6; /* Replace white */
    background-color: #b10000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .modal button {
        width: auto;
        min-width: 120px;
    }
}

.modal button:hover {
    background-color: #c10000;
}

/* Message overlay responsiveness */
.message-overlay {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 128, 0, 0.8);
    color: #FAF9F6; /* Replace white */
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2100;
    display: none;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

/* Additional styles for forms and buttons */
form label {
    display: block;
    margin-top: 10px;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

form button {
    background-color: #b10000;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
}

form button:hover {
    background-color: #c10000;
}