/* Popup Ads Styling */
.popup-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.popup-ad.show {
    opacity: 1;
}

.popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 10001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

.popup-body {
    padding: 30px;
    text-align: center;
}

.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.popup-text h1, .popup-text h2, .popup-text h3 {
    margin-top: 0;
    color: #2ABB9B;
}

.popup-text p {
    margin-bottom: 15px;
}

.popup-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.popup-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.popup-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Size Variations */
.popup-small .popup-content {
    max-width: 400px;
    margin: 50px auto;
}

.popup-medium .popup-content {
    max-width: 600px;
    margin: 50px auto;
}

.popup-large .popup-content {
    max-width: 800px;
    margin: 50px auto;
}

.popup-fullscreen .popup-content {
    max-width: 95%;
    max-height: 95%;
    margin: 2.5%;
}

/* Position Variations */
.popup-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-top {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 50px;
}

.popup-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 50px;
}

.popup-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 50px;
}

.popup-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 50px;
}

/* Modal specific styling */
.popup-ad.modal .popup-content {
    border: 2px solid #2ABB9B;
}

.popup-ad.modal .popup-close {
    color: #2ABB9B;
}

.popup-ad.modal .popup-close:hover {
    background: #2ABB9B;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-text {
        font-size: 14px;
    }
    
    .popup-small .popup-content,
    .popup-medium .popup-content,
    .popup-large .popup-content {
        max-width: calc(100% - 20px);
        margin: 10px;
    }
    
    .popup-top,
    .popup-bottom,
    .popup-left,
    .popup-right {
        padding: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .popup-content {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .popup-text {
        color: #ffffff;
    }
    
    .popup-close {
        color: #ccc;
    }
    
    .popup-close:hover {
        background: #444;
        color: #fff;
    }
    
    .popup-backdrop {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Animation for auto-close countdown */
.popup-countdown {
    position: absolute;
    top: 10px;
    left: 15px;
    background: #2ABB9B;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* Button styling in popup */
.popup-body .btn {
    margin: 5px;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.popup-body .btn-primary {
    background: #2ABB9B;
    color: white;
    border: none;
}

.popup-body .btn-primary:hover {
    background: #1a9b7b;
    transform: translateY(-2px);
}

.popup-body .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.popup-body .btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* Loading animation for popup */
.popup-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.popup-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2ABB9B;
    border-radius: 50%;
    animation: popupSpin 1s linear infinite;
}

@keyframes popupSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
