/**
 * FinApp Competition Popup - Frontend Styles
 * 
 * @package FinApp_Events
 * @since 1.0.1
 */

/* Popup Overlay */
.finapp-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.finapp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Popup Container */
.finapp-popup-container {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: min(92vw, 960px);
    width: 100%;
    max-height: 94vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: finappPopupSlideIn 0.4s ease-out;
}

@keyframes finappPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.finapp-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.finapp-popup-close:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.finapp-popup-close svg {
    width: 24px;
    height: 24px;
    color: #333;
}

/* RTL Support for close button */
[dir="rtl"] .finapp-popup-close,
.rtl .finapp-popup-close {
    right: auto;
    left: 16px;
}

/* Content Area */
.finapp-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Image */
.finapp-popup-image-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.finapp-popup-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Larger desktop popup */
@media (min-width: 1200px) {
    .finapp-popup-container {
        max-width: min(88vw, 1040px);
    }
}

/* Text Content */
.finapp-popup-text {
    padding: 24px 32px 0;
    text-align: center;
    direction: rtl;
}

.finapp-popup-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.finapp-popup-description {
    margin: 0;
    font-size: 17px;
    color: #666;
    line-height: 1.6;
}

/* Button */
.finapp-popup-button {
    display: inline-block;
    margin: 24px 32px 32px;
    padding: 16px 50px;
    background: linear-gradient(135deg, #71084A 0%, #a01068 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(113, 8, 74, 0.3);
}

.finapp-popup-button:hover {
    background: linear-gradient(135deg, #8a0a5c 0%, #b81278 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113, 8, 74, 0.4);
    color: #fff;
}

.finapp-popup-button:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 700px) {
    .finapp-popup {
        padding: 15px;
    }
    
    .finapp-popup-container {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .finapp-popup-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    
    [dir="rtl"] .finapp-popup-close,
    .rtl .finapp-popup-close {
        right: auto;
        left: 10px;
    }
    
    .finapp-popup-close svg {
        width: 20px;
        height: 20px;
    }
    
    .finapp-popup-text {
        padding: 20px 24px 0;
    }
    
    .finapp-popup-title {
        font-size: 20px;
    }
    
    .finapp-popup-description {
        font-size: 15px;
    }
    
    .finapp-popup-button {
        margin: 20px 24px 24px;
        padding: 14px 36px;
        font-size: 16px;
    }
}

/* Animation for closing */
.finapp-popup.finapp-popup-closing {
    animation: finappPopupFadeOut 0.3s ease-out forwards;
}

.finapp-popup.finapp-popup-closing .finapp-popup-container {
    animation: finappPopupSlideOut 0.3s ease-out forwards;
}

@keyframes finappPopupFadeOut {
    to {
        opacity: 0;
    }
}

@keyframes finappPopupSlideOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .finapp-popup-close {
        border: 2px solid #333;
    }
    
    .finapp-popup-button {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .finapp-popup-container,
    .finapp-popup.finapp-popup-closing,
    .finapp-popup.finapp-popup-closing .finapp-popup-container {
        animation: none;
    }
}
