﻿/* Begin of desktop Custom Alert */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.4);
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: #fefefe;
            border: 1px solid #888;
            width: 28%;
            border-radius: 5px;
            overflow: hidden; /* Ensures borders/lines inside respect the modal corners */
        }

        /* Styles for the header (title and close button) */
        .modal-header {
            padding: 10px 20px;
            display: flex; /* Use flexbox to align title and 'x' on the same line */
            justify-content: space-between; /* Puts max space between title and 'x' */
            align-items: center; /* Vertically center them */
            border-bottom: 1px solid #ddd; /* The separation line below the title */
            background-color: #f1f1f1;
        }

        /* Styles for the body (message content) */
        .modal-body {
            padding: 20px;
        }

        #alertTitle {
            margin: 0; /* Remove default margin for better alignment in flex container */
            font-size: 20px;
            color: #333;
        }

        .close-btn {
            color: #aaa;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            line-height: 1; /* Aligns the 'x' vertically nicely */
        }

            .close-btn:hover,
            .close-btn:focus {
                color: #000;
            }
/* End of desktop Custom Alert */

/* Begin Mobile Styles for Custom Alert */
@media only screen and (max-width: 768px) {
    .modal-content {
        width: 90% !important; /* Use most of the screen width */
        margin: 20px; /* Add some margin from screen edges */
        max-width: 400px; /* Maximum width for very large phones */
    }

    .modal-header {
        padding: 15px 20px; /* Slightly larger padding for touch targets */
    }

    .modal-body {
        padding: 25px 20px; /* More padding for better readability */
    }

    #alertTitle {
        font-size: 22px; /* Slightly larger text for mobile */
    }

    .close-btn {
        font-size: 32px; /* Larger close button for easier tapping */
        padding: 5px; /* Larger touch target */
        min-width: 44px; /* Minimum touch target size */
        min-height: 44px; /* Minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Optimization for very small screens */
@media only screen and (max-width: 480px) {
    .modal-content {
        width: 95% !important; /* Even more width usage on very small screens */
        margin: 10px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 20px 16px;
    }

    #alertTitle {
        font-size: 20px;
    }
}

/* Ensure modal is always properly displayed on mobile */
@media only screen and (max-width: 768px) {
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.4);
        justify-content: center;
        align-items: center;
    }
}
/* End of Mobile Styles for Custom Alert */
