/* =======================
   Modern & User-Friendly Modal
======================= */

/* Images */
.myImg {
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.myImg:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
    filter: brightness(1.05);
}

/* Modal Background */
.myModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    transition: opacity 0.4s ease;
}

/* Modernized Bootstrap modal used for edit/delete */
.modern-modal {
    border-radius: 14px;
    border: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

.modern-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: 0;
    padding: 20px 24px;
}

.modern-modal-header .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title-icon {
    font-size: 20px;
}

.modal-subtitle {
    margin: 6px 0 0 28px;
    opacity: 0.9;
}

.modern-modal-body {
    padding: 20px 24px;
    background: #fff;
}

.modern-modal-footer {
    background: #fafbfc;
    border-top: 1px solid #edf0f2;
    padding: 14px 16px;
}

.btn-modern {
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-modern .btn-icon { font-size: 16px; }

/* Inputs inside the injected form */
.modern-modal-body .form-group label { font-weight: 600; }
.modern-modal-body .form-control { border-radius: 10px; }

@media (max-width: 576px) {
    .modern-modal-header { padding: 16px; }
    .modern-modal-body { padding: 16px; }
    .modern-modal-footer { padding: 12px 14px; }
}

/* Modal Content */
.myModal .modal-content {
    margin: auto;
    display: block;
    width: 85%;
    max-width: 900px;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform: translateY(-20px);
    animation: fadeInUp 0.5s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}

/* Caption */
.myModal #caption {
    margin: 15px auto 0;
    display: block;
    width: 90%;
    max-width: 900px;
    text-align: center;
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    padding: 20px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.4));
    border-radius: 0 0 20px 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeInUp 0.5s 0.2s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}

/* Animations */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.myModal .close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    background: rgba(0,0,0,0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(15px);
}

.myModal .close:hover,
.myModal .close:focus {
    background: #e74c3c;
    box-shadow: 0 0 20px #e74c3c;
    transform: scale(1.2) rotate(10deg);
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .myModal .modal-content {
        width: 95%;
    }

    .myModal #caption {
        width: 95%;
        font-size: 15px;
        padding: 15px 10px;
    }

    .myModal .close {
        top: 15px;
        right: 25px;
        font-size: 42px;
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .myModal .modal-content {
        width: 98%;
        margin: 10px auto;
    }

    .myModal #caption {
        width: 98%;
        font-size: 14px;
        padding: 12px 8px;
    }

    .myModal .close {
        top: 8px;
        right: 12px;
        font-size: 36px;
        width: 44px;
        height: 44px;
    }
}
