/* Pro Popup - Frontend Styles */
.pro-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pro-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
    cursor: pointer;
}

.pro-popup-modal {
    position: relative;
    z-index: 2;
    overflow: visible;
    max-width: 95%;
    max-height: 95vh;
    width: auto;
    background: transparent;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Timer Styles - Small bottom-right corner */
.pro-popup-timer {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 4;
    background: #ff0000;
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: timerPulse 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes timerPulse {
    0% { box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(255, 0, 0, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3); }
}

.pro-popup-timer-text {
    font-size: 12px;
    margin: 0;
    padding: 0 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.pro-popup-timer-count {
    font-size: 14px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

/* Remove the progress bar since we're making it small */
.pro-popup-timer-bar,
.pro-popup-timer-fill {
    display: none;
}

/* Content Wrapper */
.pro-popup-content-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    display: block;
}

.pro-popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
}

.pro-popup-image-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.3s ease;
}

.pro-popup-image-link:hover {
    opacity: 0.95;
}

/* Close Button - FIXED: Proper clickable area */
.pro-popup-close {
    position: absolute;
    background: #ff0000 !important;
    color: white !important;
    border: none;
    cursor: pointer !important;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    top: -15px;
    right: -15px;
    pointer-events: auto !important;
}

.pro-popup-close span {
    display: block;
    font-size: 24px;
    width: 1em;
    height: 1em;
    line-height: 1;
    font-weight: bold;
    pointer-events: none;
}

/* Hover and focus states for close button */
.pro-popup-close:hover {
    background: #cc0000 !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.pro-popup-close:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.pro-popup-close:active {
    transform: scale(0.95);
}

/* Responsive Positioning */

/* Desktop */
@media (min-width: 769px) {
    .pro-popup-modal {
        max-width: min(800px, 90vw);
    }
    
    .pro-popup-close {
        width: 40px;
        height: 40px;
        top: -15px;
        right: -15px;
    }
    
    .pro-popup-close span {
        font-size: 24px;
    }
    
    .pro-popup-timer {
        bottom: 20px;
        right: 20px;
        min-width: 70px;
        height: 36px;
    }
    
    .pro-popup-timer-text {
        font-size: 13px;
        padding: 0 10px;
    }
    
    .pro-popup-timer-count {
        font-size: 15px;
        padding: 2px 8px;
        min-width: 24px;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .pro-popup-container {
        padding: 10px;
    }
    
    .pro-popup-modal {
        max-width: 90%;
        max-height: 90vh;
    }
    
    .pro-popup-close {
        width: 35px;
        height: 35px;
        top: -12px;
        right: -12px;
    }
    
    .pro-popup-close span {
        font-size: 20px;
    }
    
    .pro-popup-timer {
        bottom: 15px;
        right: 15px;
        min-width: 65px;
        height: 32px;
    }
    
    .pro-popup-timer-text {
        font-size: 12px;
        padding: 0 8px;
    }
    
    .pro-popup-timer-count {
        font-size: 14px;
        padding: 2px 6px;
        min-width: 22px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .pro-popup-container {
        padding: 8px;
    }
    
    .pro-popup-modal {
        max-width: 95%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .pro-popup-close {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
        background: #ff0000 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    
    .pro-popup-close span {
        font-size: 18px;
    }
    
    .pro-popup-timer {
        bottom: 10px;
        right: 10px;
        min-width: 60px;
        height: 28px;
        border-radius: 16px;
    }
    
    .pro-popup-timer-text {
        font-size: 11px;
        padding: 0 6px;
    }
    
    .pro-popup-timer-count {
        font-size: 12px;
        padding: 1px 5px;
        min-width: 20px;
    }
    
    .pro-popup-image {
        border-radius: 8px;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .pro-popup-timer-text {
        font-size: 10px;
        padding: 0 5px;
    }
    
    .pro-popup-timer-count {
        font-size: 11px;
        padding: 1px 4px;
        min-width: 18px;
    }
    
    .pro-popup-close {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }
    
    .pro-popup-close span {
        font-size: 16px;
    }
    
    .pro-popup-timer {
        min-width: 55px;
        height: 26px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .pro-popup-container {
        padding: 5px;
    }
    
    .pro-popup-modal {
        max-height: 98vh;
        max-width: 90%;
    }
    
    .pro-popup-image {
        max-height: 98vh;
    }
    
    .pro-popup-timer {
        bottom: 8px;
        right: 8px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100px, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
    to {
        transform: translate3d(0, 100px, 0);
        opacity: 0;
    }
}

.animated {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.fadeIn { animation-name: fadeIn; }
.fadeOut { animation-name: fadeOut; }
.slideInUp { animation-name: slideInUp; }
.slideOutDown { animation-name: slideOutDown; }

/* Ensure overlay covers entire screen */
html.pro-popup-active {
    overflow: hidden;
    height: 100%;
}

html.pro-popup-active body {
    overflow: hidden;
    height: 100%;
}

/* Print styles */
@media print {
    .pro-popup-container {
        display: none !important;
    }
}

/* Fix for click events */
.pro-popup-container * {
    box-sizing: border-box;
}