/**
 * Jain Digital Hub - Site Popups / Poppers Modal Overlay
 */

.jdh-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: rgba(9, 13, 22, 0.84);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.jdh-popup-overlay.jdh-popup-active {
    opacity: 1;
}

.jdh-popup-card {
    position: relative;
    max-width: min(680px, 92vw);
    width: auto;
    background: #0f172a;
    border-radius: 16px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: visible;
    text-align: center;
}

.jdh-popup-card.jdh-popup-card-active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Floating Circular Close Button */
.jdh-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    padding: 0;
    outline: none !important;
}

.jdh-popup-close:hover,
.jdh-popup-close:focus {
    transform: scale(1.1) rotate(90deg);
    background: #e25822;
    color: #ffffff;
    border-color: #e25822;
}

/* Media Container */
.jdh-popup-media-container {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.jdh-popup-link-wrap {
    display: block;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
    line-height: 0;
}

.jdh-popup-image {
    display: block;
    width: 100%;
    max-height: min(78vh, 650px);
    object-fit: contain;
    border-radius: 16px;
    transition: opacity 0.25s ease;
}

.jdh-popup-link-wrap:hover .jdh-popup-image {
    opacity: 0.96;
}

/* Video Responsive Container */
.jdh-popup-video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000000;
}

.jdh-popup-video-responsive iframe,
.jdh-popup-video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 16px;
}

/* Bottom Dismiss Action */
.jdh-popup-footer {
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0 0 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.jdh-popup-dismiss-link {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    transition: color 0.2s ease;
    outline: none !important;
}

.jdh-popup-dismiss-link:hover {
    color: #f1f5f9;
    text-decoration: underline;
}

@media (max-width: 576px) {
    .jdh-popup-overlay {
        padding: 0.85rem;
    }
    .jdh-popup-card {
        max-width: 96vw;
    }
    .jdh-popup-close {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .jdh-popup-image {
        max-height: 72vh;
    }
}
