/**
 * VIP视频解析器样式
 * 保持与图片显示一致的样式风格
 * 移动端优化版本
 */

/* 基础重置 */
.vip-video-player-container * {
    box-sizing: border-box;
}

.vip-video-player-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.vip-video-input-container {
    display: flex;
    padding: 15px 20px;
    gap: 10px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.vip-video-api-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    min-width: 120px;
    flex-shrink: 0;
}

.vip-video-api-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.vip-video-url-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.vip-video-url-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.vip-video-play-btn {
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.vip-video-play-btn:hover {
    background: #005a87;
}

.vip-video-play-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.vip-video-player-wrapper {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
    overflow: hidden;
}

.vip-video-player-wrapper[data-height="auto"] {
    height: auto;
    aspect-ratio: 16/9;
    width: 100%;
}

.vip-video-player-wrapper:not([data-height="auto"]) {
    height: 400px;
}

.vip-video-placeholder {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.vip-video-placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

.vip-video-placeholder p {
    margin: 0;
    font-size: 16px;
}

.vip-video-iframe {
    width: 100%;
    height: 100%;
    border: none;
}


/* 错误提示样式 */
.vip-video-error {
    padding: 15px 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 20px;
    font-size: 14px;
}

.vip-video-success {
    padding: 15px 20px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 20px;
    font-size: 14px;
}

/* 描述区域样式 */
.vip-video-description {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.vip-video-description p {
    margin: 0;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .vip-video-player-container {
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .vip-video-input-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .vip-video-api-select {
        min-width: auto;
        width: 100%;
        padding: 12px 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .vip-video-url-input {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .vip-video-play-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .vip-video-player-wrapper {
        min-height: 200px;
        margin: 0;
    }
    
    .vip-video-player-wrapper[data-height="auto"] {
        aspect-ratio: 16/9;
        height: auto;
        min-height: 200px;
    }
    
    .vip-video-iframe {
        width: 100% !important;
        height: 100% !important;
        min-height: 200px;
    }
    
    .vip-video-placeholder {
        padding: 30px 15px;
    }
    
    .vip-video-placeholder-icon {
        font-size: 36px;
    }
    
    .vip-video-placeholder p {
        font-size: 14px;
        margin: 10px 0 0 0;
    }
    
    .vip-video-description {
        font-size: 13px;
        padding: 12px 15px;
        line-height: 1.4;
    }
    
    .vip-video-error,
    .vip-video-success {
        margin: 8px 15px;
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* 更小屏幕的优化 */
@media (max-width: 480px) {
    .vip-video-player-container {
        margin: 10px 0;
    }
    
    .vip-video-input-container {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .vip-video-player-wrapper {
        min-height: 180px;
    }
    
    .vip-video-player-wrapper[data-height="auto"] {
        min-height: 180px;
    }
    
    .vip-video-iframe {
        min-height: 180px;
    }
    
    .vip-video-placeholder {
        padding: 25px 12px;
    }
    
    .vip-video-placeholder-icon {
        font-size: 32px;
    }
    
    .vip-video-description {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* 与WordPress主题图片样式保持一致 */
.wp-block-image .vip-video-player-container,
.aligncenter .vip-video-player-container {
    margin: 20px auto;
}

.alignleft .vip-video-player-container {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright .vip-video-player-container {
    float: right;
    margin: 0 0 20px 20px;
}

.alignwide .vip-video-player-container,
.alignfull .vip-video-player-container {
    width: 100%;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .vip-video-player-container {
        background: #1a1a1a;
        border-color: #333;
        color: #fff;
    }
    
    .vip-video-input-container {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
    
    .vip-video-url-input,
    .vip-video-api-select {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .vip-video-url-input:focus,
    .vip-video-api-select:focus {
        border-color: #007cba;
    }
    
    .vip-video-placeholder {
        color: #ccc;
    }
    
    .vip-video-placeholder-icon {
        color: #666;
    }
    
    .vip-video-description {
        background: #2a2a2a;
        border-top-color: #333;
        color: #ccc;
    }
}
