        /* Modal Backdrop */
        .modal.fade.show {
            opacity: 1;
            display: flex !important;
            align-items: center;
            justify-content: center;
        }

        .modal-backdrop.in,
        .modal-backdrop.fade.show {
            opacity: .5;
            background-color: #000;
        }

        /* Main Modal Container */
        .custom-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1050;
            overflow-x: hidden;
            overflow-y: auto;
            outline: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Dialog Container */
        .custom-modal .modal-dialog {
            position: relative;
            width: auto;
            max-width: 50%;
            margin: 0 auto;
            pointer-events: none;
        }

        .custom-modal .modal-dialog-centered {
            display: flex;
            align-items: center;
            min-height: calc(100% - 3rem);
        }

        /* Modal Content */
        .custom-modal .modal-content {
            position: relative;
            display: flex;
            flex-direction: column;
            width: 100%;
            pointer-events: auto;
            background-color: transparent;
            background-clip: padding-box;
            border: none;
            border-radius: 0;
            outline: 0;
            box-shadow: none;
        }

        /* Modal Body */
        .custom-modal .modal-body {
            position: relative;
            flex: 1 1 auto;
            padding: 0;
            margin: 0;
            text-align: center;
        }

        /* Popup Image */
        .popup-image {
            width: 100%;
            height: auto;
            display: block;
            border-radius: 8px;
            max-height: 90vh;
            object-fit: contain;
            margin: 0 auto;
        }

        /* Close Button */
        .custom-modal .close-modal {
            position: absolute;
            top: -15px;
            right: -15px;
            z-index: 1;
            width: 32px;
            height: 32px;
            padding: 0;
            margin: 0;
            background-color: #333;
            border: 2px solid white;
            border-radius: 50%;
            opacity: 1;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .close-icon {
            font-size: 20px;
            font-weight: bold;
            color: white;
            line-height: 1;
            display: block;
            transform: translateY(-1px);
            /* Perfect visual centering */
            width: 100%;
            text-align: center;
        }

        .custom-modal .close-modal:hover {
            background-color: #ed1b2f;
            transform: scale(1.1);
        }

        /* Responsive Breakpoints */
        @media (max-width: 1440px) {
            .custom-modal .modal-dialog {
                max-width: 55%;
            }
        }

        @media (max-width: 1200px) {
            .custom-modal .modal-dialog {
                max-width: 60%;
            }
        }

        @media (max-width: 992px) {
            .custom-modal .modal-dialog {
                max-width: 70%;
            }
        }

        @media (max-width: 768px) {
            .custom-modal .modal-dialog {
                max-width: 85%;
            }

            .custom-modal .close-modal {
                width: 28px;
                height: 28px;
                top: -12px;
                right: -12px;
            }

            .close-icon {
                font-size: 18px;
            }
        }

        @media (max-width: 576px) {
            .custom-modal .modal-dialog {
                max-width: 95%;
            }

            .popup-image {
                max-height: 85vh;
            }

            .custom-modal .close-modal {
                width: 24px;
                height: 24px;
                top: -10px;
                right: -10px;
                border-width: 1px;
            }

            .close-icon {
                font-size: 16px;
            }
        }