/* 廣告模態框樣式 */
.ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.ad-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

/* 移動端優化 */
@media (max-width: 768px) {
    .ad-modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .ad-modal-content {
        width: 98%;
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 8px;
    }
}

.ad-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.ad-header h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.25rem;
}

.ad-timer {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.ad-video-container {
    margin-bottom: 1.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 備用廣告樣式 */
.ad-placeholder {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-placeholder h4 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.ad-placeholder p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.ad-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ad-feature {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.9rem;
}

.ad-cta {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ad-footer {
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.ad-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ad-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按鈕樣式重寫 */
.ad-modal .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.ad-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.ad-modal .btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.ad-modal .btn-secondary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* 載入狀態 */
.ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
}

.ad-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移動端觸摸優化 */
@media (hover: none) and (pointer: coarse) {
    .ad-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .ad-modal .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
} 