/**
 * LibreTV 视频播放器激活功能样式
 * Toast 通知样式
 */

/* Toast 基础样式 */
.libretv-activation-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999999;
    display: none;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.libretv-activation-toast-content {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #2563eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 90vw;
}

.libretv-activation-toast-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.libretv-activation-toast-message {
    flex: 1;
    min-width: 0;
}

.libretv-activation-toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.libretv-activation-toast-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.libretv-activation-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.libretv-activation-toast-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.libretv-activation-toast-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
    text-decoration: none;
}

.libretv-activation-toast-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.libretv-activation-toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

/* 成功消息样式 */
.libretv-activation-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 999999999; /* 超高 z-index 确保在所有元素之上 */
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    font-size: 14px;
    font-weight: 500;
}

/* 防止页面滚动 */
body.libretv-modal-open {
    overflow: hidden;
}

/* 确保覆盖各种播放器组件 */
.libretv-activation-modal {
    /* 确保覆盖 DPlayer */
    z-index: 99999999 !important;
}

.libretv-activation-modal-overlay {
    /* 确保覆盖视频全屏模式 */
    z-index: 99999999 !important;
}

.libretv-activation-modal-content {
    /* 确保模态框内容在最上层 */
    z-index: 99999999 !important;
    position: relative;
}

/* 特殊处理全屏模式 */
.libretv-activation-modal.fullscreen-override {
    z-index: 2147483647 !important; /* 32位整数最大值 */
}

/* 强制覆盖可能的播放器样式 */
.libretv-activation-modal * {
    z-index: inherit !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .libretv-activation-toast {
        top: 60px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
    }
    
    .libretv-activation-toast-content {
        min-width: auto;
        width: 100%;
        padding: 14px 16px;
        gap: 10px;
    }
    
    .libretv-activation-toast-icon {
        font-size: 24px;
    }
    
    .libretv-activation-toast-title {
        font-size: 14px;
    }
    
    .libretv-activation-toast-desc {
        font-size: 12px;
    }
    
    .libretv-activation-toast-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    .libretv-activation-toast-close {
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .libretv-activation-toast {
        top: 50px;
        width: calc(100% - 24px);
    }
    
    .libretv-activation-toast-content {
        padding: 12px 14px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .libretv-activation-toast-icon {
        font-size: 22px;
    }
    
    .libretv-activation-toast-title {
        font-size: 13px;
    }
    
    .libretv-activation-toast-desc {
        font-size: 11px;
        display: none;
    }
    
    .libretv-activation-toast-actions {
        gap: 6px;
    }
    
    .libretv-activation-toast-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .libretv-activation-toast-close {
        width: 22px;
        height: 22px;
        font-size: 18px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .libretv-activation-toast-content {
        background: linear-gradient(135deg, #1f2937, #111827);
        border-color: #3b82f6;
    }
    
    .libretv-activation-toast-title {
        color: #f9fafb;
    }
    
    .libretv-activation-toast-desc {
        color: #9ca3af;
    }
    
    .libretv-activation-toast-close {
        color: #6b7280;
    }
    
    .libretv-activation-toast-close:hover {
        background: #374151;
        color: #d1d5db;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .libretv-activation-toast-content {
        border-width: 3px;
    }
    
    .libretv-activation-toast-btn {
        border: 2px solid #000;
    }
}

/* 动画减少偏好设置 */
@media (prefers-reduced-motion: reduce) {
    .libretv-activation-toast {
        animation: none;
    }
    
    .libretv-activation-toast-btn {
        transition: none;
    }
    
    .libretv-activation-toast-btn:hover {
        transform: none;
    }
}
