/* Timed Popup Ads Styles */

.tpa-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.tpa-popup-overlay.tpa-show {
    display: flex;
}

.tpa-popup-overlay.tpa-visible {
    opacity: 1;
}

.tpa-popup-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.3s ease-in-out;
}

.tpa-popup-overlay.tpa-visible .tpa-popup-container {
    transform: scale(1);
}

.tpa-popup-content {
    padding: 30px;
    position: relative;
}

.tpa-popup-title {
    margin: 0 0 0px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

.tpa-popup-message {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    text-align: center;
}

.tpa-ads-container {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

/* Support for different ad sizes */
.tpa-ads-container ins,
.tpa-ads-container iframe,
.tpa-ads-container > div {
    max-width: 100%;
    width: auto !important;
}

/* Responsive ads */
.tpa-ads-container .adsbygoogle {
    display: block;
    max-width: 100%;
}

/* Remove background for ads that have their own */
.tpa-ads-container:has(ins),
.tpa-ads-container:has(iframe),
.tpa-ads-container:has(.adsbygoogle) {
    background: transparent;
    padding: 10px;
}

/* Center ads */
.tpa-ads-container > * {
    margin: 0 auto;
}

.tpa-counter-container {
    text-align: center;
    margin: 20px 0 10px 0;
    font-size: 14px;
    color: #666;
}

.tpa-counter-container p {
    margin: 0;
}

#tpa-countdown {
    font-weight: bold;
    color: #2271b1;
    font-size: 16px;
}

.tpa-close-btn {
    display: none;
    margin: 20px auto 0;
    padding: 12px 30px;
    background: #2271b1;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
}

.tpa-close-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.tpa-close-btn svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.tpa-close-btn.tpa-show {
    display: flex;
    margin-top: -22px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tpa-popup-container {
        width: 95%;
        max-width: none;
    }
    
    .tpa-popup-content {
        padding: 20px;
    }
    
    .tpa-popup-title {
        font-size: 20px;
    }
    
    .tpa-popup-message {
        font-size: 14px;
    }
    
    .tpa-close-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Animation for counter */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.tpa-counter-container.tpa-pulse #tpa-countdown {
    animation: pulse 1s ease-in-out infinite;
}

/* Scrollbar styling for popup content */
.tpa-popup-container::-webkit-scrollbar {
    width: 8px;
}

.tpa-popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tpa-popup-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.tpa-popup-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Prevent body scroll when popup is open */
body.tpa-popup-active {
    overflow: hidden;
}
