/**
 * 插頁式廣告樣式 (Interstitial Ad)
 */

/* 遮罩層 */
.interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.interstitial-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 廣告容器 */
.interstitial-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.interstitial-overlay.show .interstitial-container {
    transform: scale(1) translateY(0);
}

/* 頭部 */
.interstitial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.interstitial-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.interstitial-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.interstitial-close-btn.enabled {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
}

.interstitial-close-btn.enabled:hover {
    background: rgba(255, 255, 255, 0.3);
}

.countdown-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 廣告內容區 */
.interstitial-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 300px;
}

/* 測試模式佔位符 */
.interstitial-placeholder {
    width: 336px;
    height: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.placeholder-size {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 16px;
}

.placeholder-info {
    font-size: 12px;
    opacity: 0.6;
    line-height: 1.5;
}

/* 底部 Premium 推廣 */
.interstitial-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.premium-promo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
}

.premium-icon {
    font-size: 28px;
}

.premium-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.premium-text strong {
    color: #ffd700;
    font-size: 14px;
}

.premium-text span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.premium-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border: none;
    color: #1a1a2e;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.premium-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* 響應式設計 */
@media (max-width: 480px) {
    .interstitial-container {
        width: 95%;
        border-radius: 16px;
    }

    .interstitial-header {
        padding: 12px 16px;
    }

    .interstitial-content {
        padding: 16px;
        min-height: 250px;
    }

    .interstitial-placeholder {
        width: 300px;
        height: 250px;
    }

    .interstitial-footer {
        padding: 12px 16px;
    }

    .premium-promo {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .premium-text {
        width: 100%;
        align-items: center;
    }

    .premium-btn {
        width: 100%;
        margin-top: 8px;
    }
}

/* 動畫 */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.countdown-text #countdownNumber {
    display: inline-block;
    min-width: 16px;
    text-align: center;
    font-weight: bold;
    animation: pulse 1s ease infinite;
}